time passed to complete a bar (range-ticks-volume) indi  [SOLVED]

Questions about MultiCharts and user contributed studies.
Grigorios
Posts: 49
Joined: 30 Nov 2007
Has thanked: 13 times
Been thanked: 5 times

time passed to complete a bar (range-ticks-volume) indi  [SOLVED]

Postby Grigorios » 27 Sep 2015

Hello,

I am looking for an indicator to show me as histogram the elapsed time in seconds for a volume or range bar to complete...does anyone have this ?

thanks in advance

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby TJ » 27 Sep 2015

Hello,

I am looking for an indicator to show me as histogram the elapsed time in seconds for a volume or range bar to complete...does anyone have this ?

thanks in advance

Code: Select all


plot1( Time_s - Time_s[1] );

Grigorios
Posts: 49
Joined: 30 Nov 2007
Has thanked: 13 times
Been thanked: 5 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby Grigorios » 28 Sep 2015

Thanks TJ,

The indicator seems to add previous bars time on every hourly change...please take a look
at the picture...
Attachments
time per bar.png
(39.01 KiB) Downloaded 592 times

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby TJ » 28 Sep 2015

Give this a try:

Code: Select all


Plot10(( datetime - datetime[1] ) *86400 );

Grigorios
Posts: 49
Joined: 30 Nov 2007
Has thanked: 13 times
Been thanked: 5 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby Grigorios » 28 Sep 2015

now there is a big reading for the first bar of each day...
but not for all days...strange..
Attachments
time per bar 2.png
(89.44 KiB) Downloaded 578 times

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby TJ » 28 Sep 2015

now there is a big reading for the first bar of each day...
but not for all days...strange..
If you are not running a 24 hr chart, this will happen.

You have to add a condition to take the 1st calculation from the session opening instead of the previous bar.

Grigorios
Posts: 49
Joined: 30 Nov 2007
Has thanked: 13 times
Been thanked: 5 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby Grigorios » 29 Sep 2015

Hi TJ,
please take a look at this code...what you think..

Code: Select all

var: timelapsed(0);

if date <> date[1] then

timelapsed = time_s - (sessionstarttime(1,1)* 100)
else
timelapsed = (datetime - datetime[1]) * 86400;

Plot10(timelapsed);

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: time passed to complete a bar (range-ticks-volume) indi

Postby TJ » 29 Sep 2015

Hi TJ,
please take a look at this code...what you think..

Code: Select all

var: timelapsed(0);

if date <> date[1] then

timelapsed = time_s - (sessionstarttime(1,1)* 100)
else
timelapsed = (datetime - datetime[1]) * 86400;

Plot10(timelapsed);
Looks good !


Return to “MultiCharts”