Hi, could you please help me understand the problem?
rsiHandle = iRSI(_Symbol, PERIOD_CURRENT, inpRsiPeriod, inpRsiPrice);
macdHandle = iMACD(_Symbol, PERIOD_CURRENT, inpMacdFastPeriod, inpMacdSlowPeriod, inpMacdSignPeriod, inpMacdPrice);
int dig = _Digits + 1;
CopyBuffer(macdHandle, 0, 0, 3, _macdMain);
CopyBuffer(macdHandle, 1, 0, 3, _macdSignal);
CopyBuffer(rsiHandle, 2, 0, 3, _rsi);
macdMain = NormalizeDouble(_macdMain, dig); //Valid data
macdMainPrevious = NormalizeDouble(_macdMain, dig); //Valid data
macdSignal = NormalizeDouble(_macdSignal, dig); //Valid data
macdSignalPrevious = NormalizeDouble(_macdSignal, dig); //Valid data
rsi = NormalizeDouble(_rsi, dig); //Invalid data: always returns 0
rsiPrevious = NormalizeDouble(_rsi, dig); //Invalid data: always returns 0
I didn't described somehow the buffer numbers in CopyBuffer (0 for main MACD, 1 for signal MACD, 2 for RSI). Should I?If if change _rsi to _rsi some data appeared then, but it doesn't match to what I see on a chart. I mean 32.97 and 47.13 - a big difference.
Please read the documentation. What value is returned by CopyBuffer() ?
What is buffer 2 of RSI ?
Dear Alain,I thought the buffers should be enumerated somehow. In documentation it is not clear exactly what is the buffer and what it consist of (specifically for iRSI).
That's why I supposed these buffers should be unique. But I was wrong, replacing the number of buffer 2 with 0 solves the problem.
Thank you for paying attention even to such dumb questions )))