Time Lapsed since beginning of bar

Questions about MultiCharts and user contributed studies.
User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Time Lapsed since beginning of bar

Postby TJ » 13 Mar 2007

I am trying to get the time lapsed since the beginning of the bar. It is a 5 min chart, and I would like to get the lapse time in seconds.

I wrote the code below, but it does not compile. Any help is appreciated.


variables:
starttime(0),
endtime(0),
timelapsed(0),
intrabarpersist barstart(0);

if barstart <> currentbar then begin
barstart = currentbar ;
starttime = TimeToSeconds(time);
end;

endtime=TimeToSeconds(time);

timelapsed = endtime - starttime ;

SP
Posts: 444
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 280 times

Postby SP » 14 Mar 2007

damageboy has posted one solution here

http://forum.tssupport.com/viewtopic.php?t=2488

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Postby TJ » 14 Mar 2007

thanks for the heads up

thanks to damageboy


Return to “MultiCharts”