Need some help with MQL5

 

I open a new EA, and I see so much code, so I jokingly think "Do I even need to add any more code for it to trade", and so I load it into the tester, IT TRADES!!

lol

I'm not really sure what's going on but I was hoping I could build my own EA based on the one I had designed on mt4 , using mt5 EAs as a reference, but I see so many "include"s that I'm sure no EA gives you the full picture of what is going on. 

 

Is there anything like the MACD sample from mql4, that would be a great start, atm the EA creator is getting too involved with aspects of the code, it's trying to manage my money management ect. 

 
MetaNt:

I open a new EA, and I see so much code, so I jokingly think "Do I even need to add any more code for it to trade", and so I load it into the tester, IT TRADES!!

lol

I'm not really sure what's going on but I was hoping I could build my own EA based on the one I had designed on mt4 , using mt5 EAs as a reference, but I see so many "include"s that I'm sure no EA gives you the full picture of what is going on. 

 

Is there anything like the MACD sample from mql4, that would be a great start, atm the EA creator is getting too involved with aspects of the code, it's trying to manage my money management ect. 

You can check the Moving Average EA, it's more classically coded.
 
Thank you.
 
Jeeze, what has happened to iMACD... no shift, no MODE...
 

How can I go about tackling this?

 

 int OpenOrdersThisPair(string pair)
{ 
  int total=0;
   for(int a=OrdersTotal()-1;a>=0;a--)
     {
      OrderSelect(a,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==pair) total++;
     } 
     return (total);  
} 


int OpenSellOrdersThisPair(string pair)
{ 
  int total=0;
   for(int b=OrdersTotal()-1;b>=0;b--)
     {
      OrderSelect(b,SELECT_BY_POS,MODE_TRADES);
      if(OrderType()==OP_SELL && OrderSymbol()==pair) total++;
     } 
     return (total);
} 


int OpenBuyOrdersThisPair(string pair)
{ 
  int total=0;
   for(int c=OrdersTotal()-1;c>=0;c--)
     {
      OrderSelect(c,SELECT_BY_POS,MODE_TRADES);
      if(OrderType()==OP_BUY && OrderSymbol()==pair) total++;
     } 

 I want to translate it into mql5 but it's totally different.

 
Why does mql5 and mql4 have such a large syntax difference?
Reason: