Sometimes on illiquid instruments there is a missing bar (no operation on the time frame). How can I check if the bar is missing or not ?
I’ve tried
if Close[0] ==null
it doesn’t work
where? OBU, OMDa?
if no data is sent from exchange, then you won’t have a trigger to call either of those 2 events, so the bar will not be updated.
how are bars made, from time? 1 minute, etc?
if you are trying to detect if no data has arrived during the past minute, you would need to use a OnTimer event, which triggers every 60 seconds, as example
Thank you for your answer. It’s from obu, 1 minute. I’ll try your advice.
I have not tested this, but for 1 min bars you might try this…
if(Time[0].Minute - Time[1].Minute > 1) Print ("Missing Bar at: " + Time[0].AddMinutes(1));
Be Safe in this Crazy World!