Convert MQL4 expert to MQL5

MQL5 Experts

Specification

MQL4 to MQL5
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
int random;
int ord[8];
double tp,step,sr_cena,lot,sumlot,lotprice;
double maxlot=-1;
double minbuyprice=1000000000000;
double maxsellprice=-1;
double MA=iMA(Symbol(),0,MA_Period,0,MA_averaging_method,MA_Used_Price,0);
if (Digits==2 || Digits==4){tp=TakeProfit*Point;step=OrderStep*Point;}
if (Digits==3 || Digits==5){tp=TakeProfit*Point*10;step=OrderStep*Point*10;}
lot=StartLot;
Uchet_orderov(Magic,Symbol(),ord);
if (ord[6]==0 && ord[7]==0)
{
   if (!Use_Trend_Analysis)
   {
      MathSrand(TimeLocal());
      random = MathRand();
      if (random<16384)
      {
         OrderSend(Symbol(),OP_SELL,lot,Bid,100,0,Bid-tp,NULL,Magic,0,Red);
         OrderSend(Symbol(),OP_SELLLIMIT,NormalizeDouble(lot*Multiplicator,2),Bid+step,100,0,0,NULL,Magic,0,Red);

      }
      else
      {
         OrderSend(Symbol(),OP_BUY,lot,Ask,100,0,Ask+tp,NULL,Magic,0,Blue);
         OrderSend(Symbol(),OP_BUYLIMIT,NormalizeDouble(lot*Multiplicator,2),Ask-step,100,0,0,NULL,Magic,0,Blue);

      }
   
   }
   else
   {
    if (Close[1] > MA )
    {
        OrderSend(Symbol(),OP_BUY,lot,Ask, 100,0,Ask+tp,NULL,Magic,0,Blue);
        OrderSend(Symbol(),OP_BUYLIMIT,NormalizeDouble(lot*Multiplicator,2),Ask-step,100,0,0,NULL,Magic,0,Blue);

    }
    else if (Close[1] < MA)
    {
         OrderSend(Symbol(),OP_SELL,lot,Bid,100,0,Bid-tp,NULL,Magic,0,Red);
         OrderSend(Symbol(),OP_SELLLIMIT,NormalizeDouble(lot*Multiplicator,2),Bid+step,100,0,0,NULL,Magic,0,Red);

    }
   }
}

if (ord[6]==0 && ord[7]==1)
{
   OrderSelect(0,SELECT_BY_POS);
   OrderDelete(OrderTicket());   
}
if (ord[6]>0 && ord[7]==0)
{
   for (int pos=0; pos<OrdersTotal(); pos++)
   {
      OrderSelect(pos,SELECT_BY_POS);
      if (OrderMagicNumber()==Magic && OrderSymbol()==Symbol())
      {
         lotprice=lotprice+OrderOpenPrice()*OrderLots();
         sumlot=sumlot+OrderLots();
         if (maxlot < OrderLots()) maxlot = OrderLots();
         if (OrderType()==OP_BUY && minbuyprice > OrderOpenPrice()) minbuyprice=OrderOpenPrice();
         if (OrderType()==OP_SELL && maxsellprice < OrderOpenPrice()) maxsellprice = OrderOpenPrice();
         int tipsdelok = OrderType();
      }
   }
   sr_cena = NormalizeDouble(lotprice/sumlot,Digits);
   for(pos=0; pos<OrdersTotal(); pos++)
   {
      OrderSelect(pos,SELECT_BY_POS);
      if (OrderMagicNumber()==Magic && OrderSymbol()==Symbol() && tipsdelok == OP_BUY)
      {
      OrderModify(OrderTicket(),0,0,sr_cena+tp,0,CLR_NONE);
      }
      if (OrderMagicNumber()==Magic && OrderSymbol()==Symbol() && tipsdelok == OP_SELL)
      {
      OrderModify(OrderTicket(),0,0,sr_cena-tp,0,CLR_NONE);
      }
   }
   if (tipsdelok==OP_BUY) OrderSend(Symbol(),OP_BUYLIMIT,NormalizeDouble(maxlot*Multiplicator,2),minbuyprice-step,100,0,0,NULL,Magic,0,Blue);
   if (tipsdelok==OP_SELL) OrderSend(Symbol(),OP_SELLLIMIT,NormalizeDouble(maxlot*Multiplicator,2),maxsellprice+step,100,0,0,NULL,Magic,0,Red);
   
}
Comment("Balance: ", DoubleToStr(AccountBalance(),2),   "\n Equity: ",DoubleToStr(AccountEquity(),2));   
//----
   return(0);
  }
//+------------------------------------------------------------------+

void Uchet_orderov(int Mag,string Symb, int &mas[8])
{

ArrayInitialize(mas,0);

int tip;
for (int pos=0; pos<OrdersTotal(); pos++)
   {
      OrderSelect(pos,SELECT_BY_POS,MODE_TRADES);
      tip=OrderType();
      switch(tip)
      {
         case 0:{mas[0]++;mas[6]++;break;}
         case 1:{mas[1]++;mas[6]++;break;}
         case 2:{mas[2]++;mas[7]++;break;}
         case 3:{mas[3]++;mas[7]++;break;}
         case 4:{mas[4]++;mas[7]++;break;}
         case 5:{mas[5]++;mas[7]++;break;}
         
      
      }
   }
}

Responded

1
Developer 1
Rating
(63)
Projects
80
28%
Arbitration
17
12% / 76%
Overdue
48
60%
Free
2
Developer 2
Rating
(187)
Projects
367
56%
Arbitration
45
22% / 56%
Overdue
188
51%
Free
3
Developer 3
Rating
(336)
Projects
620
38%
Arbitration
39
23% / 64%
Overdue
93
15%
Free
4
Developer 4
Rating
(62)
Projects
140
46%
Arbitration
19
42% / 16%
Overdue
32
23%
Free
5
Developer 5
Rating
(3)
Projects
5
20%
Arbitration
1
100% / 0%
Overdue
3
60%
Free
6
Developer 6
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
Hi there, I need a very highly skilled mt4 programmer to code and design an EA from scratch. The logic of the EA will be discussed with you in comments section, only reach out if you can code perfectly for mt4 using MQL4 coding solutions language, EA must be able to run well without any problems and work according to the logic thanks
I came across an indicator that's perfectly good in catching spikes in boom amd crash but i would want it to be modified and to improve accuracy As a professional you will have to go through the indicator and explain to me the strategy with which the indicator was buid and tell me the possibility of improving it better
### Summary of EA Requirements 1. **Time Period**: - The EA should operate on the H4 timeframe. 2. **RelicusRoad MACD v2 Indicator**: - **Parameters**: - Fast EMA Period: 12 - Fast EMA Type: Close price - Slow EMA Period: 24 - Slow EMA Type: Close price - Signal SMA Period: 9 - The EA should use this indicator to determine the crossover condition between the MACD line and the signal line. 3
An EA that executes when the 21 and 55 SMA Cross on certain time frame also the EA will understand supply and demand levels and executes when price reacts on this levels specified and target/stoploss levels will be predetermined...also the robot will also comprise stochastic oscillator
Ind V5 TV Strategy Requirements: Instruments: Forex pairs, Crypto and Stocks across exchanges TimeFrame: Multi-Time Frame comparisons, details below Indicators: Ichimoku Cloud, ATR & Choppiness Index Trade times: First Order: Day of Week Start Time, Day of Week First Order time, Day of Week Last Order Time and Day of Week Square Off Time Intraday TF: 1 min, 3 mins, 9 mins, 27 mins and 81 mins Position Size (Lots)
I want this EA in mql4. The two indicators are written in pinescript Developer should please understand it to develop the EA. One of the indicator will be used as direction and the other for entry. The should have code that it can be used for( only one PC and an expiration date. ; this the developer should show me how to adjust it, so that I can adjust to my preference). Parameters:number of trades.lotsize, SL pips
I need a robot for forex trading~~The way the robot should work is that when I put it into a 5 minute chart, the chart will show 15 minutes, one hour, Regardless of whether they are buying or selling, they must buy or sell in the same color at the same time~~~ Use the following indicators: HalfTrend 1 & alerts mtf Trafficlight indicator.MQ4 When placed into a 5 minute chart ~ the chart will show 15 minutes, one
I am looking for a programmer to do EA trader. If you can understand what I want from the video i do and you can do it, contact me because you will be able to do what I want. https://drive.google.com/file/d/1wbHxbUQQqCkdpr0-pHfIh2b288LzYTV2/view?usp=sharing maximum budget = 150$ Preference is given to someone who: -speaks Arabic so I can explain it clearly to him - And the lowest price
I SIMPLY NEED SOMEONE TO INTEGRATE THESE OPTIMIZATION ALGOS INTO MY EA. THE LIBRARY IS ATTACHED BELOW. NEED THIS DONE FAST. LET ME KNOW IF YOU HAVE OTHER QUESTIONS A list of implemented optimization algorithms: BGA (binary genetic algorithm) ANS (across neighbourhood search) CLA (code lock algorithm) P_O_ES ((P+O) evolution strategies) CTA (Comet Tail Algorithm) SDSm (stochastic diffusion search M) ESG (evolution of
Create a robot like this live on YouTube, it is a simple hedge system that does not have martingale or other risky means of.making money.... please check out the link and if it is possible for you to repeat this then reach out with a sample and price. YouTube: https://www.youtube.com/live/cT_42RWzq_0?si=Z8M5mKkAMGZhxdTL

Project information

Budget
10 - 30 USD
For the developer
9 - 27 USD
Deadline
from 1 to 7 day(s)