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 ;
Time Lapsed since beginning of bar
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times