what is the value returned when Close[0] is used when the current bar has not been closed yet

 

hi guys


can you guys help me fins a way to know whether the current bar has closed.specifically what is the value returned when Close[0] is used when the current bar has not been closed yet.

thanks

 
The current Bid.
 
nirVaan:

hi guys


can you guys help me fins a way to know whether the current bar has closed.specifically what is the value returned when Close[0] is used when the current bar has not been closed yet.

thanks

IMO there are two ways to know the "current" bar has closed . . .

  • from server time
  • when the next bar has opened (barshift for iTime of current bar changes from 0 to 1)

I am currently using GBPUSD tick data from Dukascopy for my Unit testing in the Strategy Tester, I have noticed that there are occasions where there are missing M1 bars, why? because there ere no ticks during that minute. So, if for example you tried to do your calculations/processing on the last minute of the current bar then there is a chance that it wouldn't happen due to a lack of ticks during that minute.

Reason: