CopyBuffer in MQL5: Read Closed Bars Without Reversing Your Signals
Technical revision: 1 October 2026 · Educational materialOn this pageFirst choose the barsUse a numerical test before using a chartRequire a complete and valid readDistinguish physical storage from series indexingA short verification sequenceA common MQL5 fault is to read two indicator values correctly, then interpret their array positions backward. Another is to evaluate an unfinished candle while describing the rule as a closed-bar signal. Both faults can change an EA's entries without producing a compiler error. First choose the bars Shift 0 refers to the current, unfinished bar. Shift 1 is the last closed bar; shift 2 is the closed…