Forum

close series in OnCalculate() routine returns garbage when close[index-1] is used but works with close[index]

MT 5.00 build 4755, testing 1 month Dec. 2024 H1 timeframe but the problem is limited to that. I consistently was seeing a custom indicator being incorrect when testing but working when only used as an on-screen indicator. The problem was traced down to a calculation "diff = close[index] -