SMA Trading Bot

To add comments, please log in or register
Fred7777
239
Fred7777  

Im just starting to write my first Trading Bot and following this guys example on Youtube :

https://www.youtube.com/watch?v=H-PvwiHVO34&t=0s&list=WL&index=95

But hes using MQL5 and I only have MQL4 and MQL4 which doesnt have CopyBuffer

Is there anyway around this ? 

What I have so far :


void OnTick()

  {

      // create an Array for several prices

      double myMovingAverageArray[];

  

      // define the properties of the Moving Average

      int movingAverageDefinition =iMA (_Symbol,_Period,20,0,MODE_SMA,PRICE_CLOSE);

      

      // sort the price array from the current candle downwards

      ArraySetAsSeries(myMovingAverageArray,true);

      

      // Defined EA, one line,current candle,3 candles, store result

      CopyBuffer(movingAverageDefinition,0,0,3,myMovingAverageArray); 

       

      // calculate EA for the current candle

      double myMovingAverageArray=myMovingAverageArray[0];

      

       // Chart output of the current EA

      Comment ("MovingAverageValue: ",myMovingAverageValue);     

          

  

  }   




Marco vd Heijden
Moderator
8426
Marco vd Heijden  
please read iMA documentation (MQL4)
Fred7777
239
Fred7777  
Otherwise I might stick to the MQL4 examples the Youtube guy gives which will make learning intially easier
Samuel Akinbowale
3006
Samuel Akinbowale  
Fred7777:
Otherwise I might stick to the MQL4 examples the Youtube guy gives which will make learning intially easier
mql 5 and 4 are different, few similarities . if u want to write in mql4 avoid watching mql5 video
Fred7777
239
Fred7777  
Samuel Akinbowale:
mql 5 and 4 are different, few similarities . if u want to write in mql4 avoid watching mql5 video

Lol - very true 

To add comments, please log in or register