My First Indicator, Drawing 4 moving averages at once

 

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()?

Files:
 

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);