One may realise, that there are some "theoretical" Candles, that do not happen and are thus not "visible" / "accessible" in data of time-series - whence a market was not active during such period of time and no PriceDOMAIN change has happened during such administratively-framed epoch in time - for such situations, as there was no price-change, there was no QUOTE and thus such candle did not happen and is "missing" both in linear counting and in data-cells. Remeber, the "current" OHLCV-registers- are always "hot" = continuously changing throughout the time of the "current" TimeFRAME Candle duration, so one has to wait till a new Candle starts ( indirectly meaning the "now-previous" Candle has ended and has thus got a reverse-stepping index "re-indexed" to become, a frozen one ).įor detecting a new candle it is enough to monitor changes of a system register int Bars, resp. PERIOD_M1, // explicit reference to use M1 TimeFRAMEġ // a Cell-index last, closed CandleĪ2: There is neat way how to detect a new Candle, indirectly, the same trick allows one to thus detect a moment, when the previous Candle stops evolving ( values do not change anymore ) which thus makes sense to report "already frozen" OHLCV-values to be reported anywhere else. IOpen( aTradingSymbolNameSTRING, // Broker specific names, "DE-30." may surprise If your code does not want to rely on "current" implicit contexts, the syntax allows one to use explicit, indirect, specifications: /* iVolume( |||. Complex? Well, just on the first few reads. So Open, High, Low, Close are values for the "current instrument" ( _Symbol ), retrieved from the "current TimeFRAME" for a candle, that was already closed right before the "current Candle" has started. As a rule of thumb, these arrays are time-series, reverse-stepping indexed, so that the most recent cell ( The Current Bar ( candle ) ) always has cell-index = 0. A1: MQL4/MQL5 syntax reports OHLCV-values straight in Open, High, Low, Close, Volume time-series arrays.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |