My attempt to code 3 Moving Average Crossover EA

 

Hi, I'm trying to code EA but I don't have programming background. I want to use 12 EMA, 26 EMA cross over with 55 SMA on 1-minute chart. The buy trade is carried out when 12 ema cross above 26 ema and 55 sma while sell trade is carried out when 12 ema cross below 26 ema and 55 sma. I want to start with $200 so I wish I could put static lot 0.01. I'm not sure the coding to take profit once the crossover is over. (Note: I'm regret for not choosing programming for degree study, hope that someone could guide me). Thank you. 

extern string  
         Indicator_Setting = "---------- Indicator Setting";
extern int FasterMA    =    12;
extern int FasterShift =    0;
extern int FasterMode  =    1; // 0 = sma, 1 = ema, 2 = smma, 3 = lwma

extern int MediumMA    =    26;
extern int MediumShift =    0;
extern int MediumMode  =    1; // 0 = sma, 1 = ema, 2 = smma, 3 = lwma

extern int SlowerMA    =   55;
extern int SlowerShift =    0;
extern int SlowerMode  =    0; // 0 = sma, 1 = ema, 2 = smma, 3 = lwma

extern int SoundAlert =    0; // 0 = disabled
extern int ChannelPeriod=15;
extern int Shift=0;
extern string IS="---------------- Indicator Settings";                    
extern int Take_Profit=200;
extern int StopLoss = 100;
extern int TrailingStop = 100;
extern double StaticLot = 0.01;//Fixed lots size

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+

Please advice whether am i coding it correctly? Thank you. 

 
  1. Roylsh: buy trade is carried out when 12 ema cross above 26 ema and 55 sma … Please advice whether am i coding it correctly?
    "Coding it correctly?" You haven't coded anything at all. Where do you get the MAs? Where do you test them? Where is your trading logic?

  2. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

  3. extern int SlowerMode  =    0; // 0 = sma, 1 = ema, 2 = smma, 3 = lwma
    The MA calls use ENUM_MA_METHOD not an int. If you use that, your extern will show a pop up in the input window.
 
William Roeder:
  1. "Coding it correctly?" You haven't coded anything at all. Where do you get the MAs? Where do you test them? Where is your trading logic?

  2. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

  3. The MA calls use ENUM_MA_METHOD not an int. If you use that, your extern will show a pop up in the input window.
Thank you, I will attempt to fix it. Maybe last resolution is to hire someone. It's my lost for not taking programming during study undergraduate. 
Reason: