I created a simple script that prints the bar time on every first tick of bar recieved.
however it seems for some reason this IsFirstTickOfBar does not work for me or it is skipping bars when there is a gap.
MyScript.
if (IsFirstTickOfBar)
{
Print(Time[bi].TimeOfDay + " Checking");
}
My Output.
15:28:30 Checking
15:29:00 Checking
15:30:30 Checking
15:31:00 Checking
15:31:30 Checking
It seems to maybe happen when ever there is a gap on the chart,
if looking at the chjart for these two missing times.
15:29:30 and 15:00:00 it seems they are gapping a bit,
what causes this and how can i handle this ?
My end goal is to execute some code as close as posible to the open.
at the moment i am checking for the end time of the previous candle and if it is first tick of bar.
is there a better way to do this ?
Comment