My First Indicator, Drawing 4 moving averages at once
This fixed it for me...
// Copy the indicator values to the corresponding buffers CopyBuffer(hmm5, 0, 0, rates_total, mm5Buffer); CopyBuffer(hmm8, 0, 1, rates_total, mm8Buffer); CopyBuffer(hmm21, 0, 2, rates_total, mm21Buffer); CopyBuffer(hmm72, 0, 3, rates_total, mm72Buffer);
For study purposes, I'm trying to create an indicator that draws 4 moving averages: 5, 8, 21 and 73 periods at once. But suddenly, MetaTrader stopped drawing all 4 moving averages.
Is it correct to use CopyBuffer in OnCalculate()?