copybuffer not adding to array. array returning nan.

 
I'm brand new to mql5 and I am having an issue where 2 arrays are returning a value but the other 2 are not. I included the journal in a backtest
// global variables

   int fast_ma_handle, med_ma_handle, slow_ma_handle, atr_handle;

// OnInit
   fast_ma_handle = iMA(_Symbol,PERIOD_CURRENT,fast_ma,0,MODE_EMA,PRICE_CLOSE);
   med_ma_handle = iMA(_Symbol,PERIOD_CURRENT,med_ma,0,MODE_EMA,PRICE_CLOSE);
   slow_ma_handle = iMA(_Symbol,PERIOD_CURRENT,slow_ma,0,MODE_EMA,PRICE_CLOSE);
   atr_handle = iATR(_Symbol,PERIOD_CURRENT,atr_period);

// OnTick

   double fastMA[1];
   double medMA[1];
   double slowMA[1];
   double atr[1];

   double fast_ma_price = fastMA[0];
   double med_ma_price = medMA[0];
   double slow_ma_price = slowMA[0];
   double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
   double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);
   
   CopyBuffer(fast_ma_handle,0,1,1,fastMA);
   CopyBuffer(med_ma_handle,0,1,1,medMA);
   CopyBuffer(slow_ma_handle,0,1,1,slowMA);
   CopyBuffer(atr_handle,0,1,1,atr);
   CopyRates(_Symbol,PERIOD_CURRENT,0,look_back_period,barData);
   
   Print("fast ma price " + (string) fast_ma_price);
   Print("med ma price " + (string) med_ma_price);
   Print("slow ma price " + (string) slow_ma_price);
   Print("ask ma price " + (string) ask);
   Print("bid ma price " + (string) bid);
   Print("atr ma price " + (string) atr[0]);
 
I figured it out -_- the order of the price variables needed to be after the copybuffer. But I don't understand why the fast_ma_price was able to return a value and the others were not. On top of that the value was wrong in the picture but now they are all correct. If anyone would like to drop some knowledge on me ty