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

To add comments, please log in or register
Praneeth
41
Praneeth  

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

Ubzen
5298
Ubzen  
The current Bid.
Simon Gniadkowski
17660
Simon Gniadkowski  
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.

To add comments, please log in or register