Convert a mql4 EA to a mql5

MQL5 Uzman Danışmanlar

İş tamamlandı

Tamamlanma süresi: 1 gün
Geliştirici tarafından geri bildirim
Great customer - it was a pleasure to work with him!

İş Gereklilikleri

Hi, 

I need help to convert a mql4 EA to a Mql5 EA.

Looking forward to hear from you.

Thanks, Fertik

 

 

 



extern string R ="=========Réglages de base==========";

extern double PF_Départ       = 5000;  

extern double Lots            = 0.1;  

extern double TakeProfit      = 50;

extern double TakeProfit0     = 40;

extern double TakeProfit1     = 30;

extern double TakeProfit2     = 20;

extern double TakeProfit3     = 10;

extern double StopLoss        = 200;

extern double Coefflosse0     = 1;  

extern double Coefflosse1     = 2;   

extern double Coefflosse2     = 4;  

extern double Coefflosse3     = 6;  

double     MyPoint;  

int           Dg,i;

//============================================//

int init() 

   {

   ModifPoint(); 

   }

//===========================================//

int start() 

   {

   int y;

   double pr=0; // profit;

for (y = 0; y < OrdersTotal(); y++)

   {

      OrderSelect (y, SELECT_BY_POS, MODE_TRADES);

      if ((OrderMagicNumber()==301210) && (OrderSymbol()==Symbol()) && ((OrderType()==OP_BUY)||(OrderType()==OP_SELL))) {

          pr=pr+OrderProfit();

      }

   }

//==========================================+

//| Nombre de pertes consécutives           |

//==========================================+

   int    orders=HistoryTotal(); 

   int    losses=0;

   double pr1=0; 

   for( i=orders-1;i>=0;i--)

   {

      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; }

      if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;

         //----

      if(OrderProfit()>0) break;

      if(OrderProfit()<0) losses++;

         pr1=pr1+OrderProfit();

   }

   double pr3 = pr+pr1;       

//+============================+

   double P_PF,P_PF1;

   string Infos = "";

   /*int i=0;*/

   int    spread=MarketInfo("EURUSD",MODE_SPREAD);

   P_PF1 =((AccountBalance()-PF_Départ)/PF_Départ)*100;

   P_PF  =(AccountBalance()-PF_Départ);


   int li_28;

   double lp72,lp88,lp89,lp90,ll96;

   double SL=StopLoss*MyPoint;

  

   if (pr >= (500*Lots)+ MathAbs(pr1))  {

      for (int l_ord_total_0 = OrdersTotal(); l_ord_total_0 >= 0; l_ord_total_0--) {

        OrderSelect(l_ord_total_0, SELECT_BY_POS, MODE_TRADES);

         if (OrderSymbol() == Symbol() && OrderMagicNumber() == 301210) {

            if (OrderType() == OP_BUY || OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 5, CLR_NONE);

                if (OrderType() != OP_BUY && OrderType() != OP_SELL) OrderDelete(OrderTicket()); 

         }

      }return (0);

   }

 //===========================================================  

   int lt4 = 0;

   int lt8 = 0;

   int lt12 = 0;

   int lt16 = 0;

   double ll40 = 0;

   double ll48 = 0;

   double lo56 = 0;

   double lo64 = 0;

   double ltp104 = 0;

   double ltp112 = 0;

   double ll136 = 0;

   double ll144 = 0;

   double mA5= iMA(NULL,0,3,0,1,PRICE_HIGH,0);

   double mA6= iMA(NULL,0,3,0,1,PRICE_HIGH,1);

   double mA7= iMA(NULL,0,3,0,1,PRICE_LOW,0);

   double mA8= iMA(NULL,0,3,0,1,PRICE_LOW,1);

           

   if ( mA7 > mA8)li_28=2;

   if (mA5 < mA6)li_28=1; 


//==============================+

//Mode Close Orders             |

//==============================+      

   for (int l_pos_284 = 0; l_pos_284 < OrdersTotal(); l_pos_284++) {

        OrderSelect(l_pos_284, SELECT_BY_POS, MODE_TRADES);

      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 301210) {

         if (OrderType() == OP_BUY && lt4 < OrderTicket()) {

            ll40 = OrderLots();

            lo56 = OrderOpenPrice();

            lt4 = OrderTicket();

            ltp112 = OrderTakeProfit();

         }

         if (OrderType() == OP_SELL && lt8 < OrderTicket()) {

            ll48 = OrderLots();

            lo64 = OrderOpenPrice();

            lt8 = OrderTicket();

            ltp104 = OrderTakeProfit();

         }

         if (OrderType() == OP_BUYSTOP) {

            lt12 = OrderTicket();

            ll136 = OrderLots();

         }

         if (OrderType() == OP_SELLSTOP) {

            lt16 = OrderTicket();

            ll144 = OrderLots();

         }

      }

   }

  

   if (lt4 == 0 && lt16 != 0) OrderDelete(lt16);

      if ((lt16== 0 && lt4 != 0)&&(OrderOpenPrice()-Ask>SL)&&(OrderLots()==Lots)) OrderClose(lt4, OrderLots(), OrderClosePrice(), 5, CLR_NONE);

        if (lt4 == 0 && lt16 == 0) {

            lp88 = Ask + TakeProfit * MyPoint;  

             if ((DayOfWeek() == 5 && (losses >0))||(DayOfWeek() == 1 && Hour() > 3)||(DayOfWeek() == 2)||(DayOfWeek() == 3)||(DayOfWeek() == 4)||(DayOfWeek() == 7 && Hour() > 24)){

               if (li_28 == 2 && lt8 == 0)  {

                  if (AccountFreeMarginCheck(Symbol(), OP_BUY, Lots * 50) >= 0.0) {

                     OrderSend(Symbol(), OP_BUY, Lots, Ask, 3,Ask-SL,lp88, "Magic = " + 301210, 301210, 0, DodgerBlue);

                     }

               }

            }

         }

        

   if (lt8 == 0 && lt12 != 0) OrderDelete(lt12);

      if ((lt12== 0 && lt8 != 0)&&(Bid-OrderOpenPrice()>SL)&&(OrderLots()==Lots)) OrderClose(lt8, OrderLots(), OrderClosePrice(), 5, CLR_NONE);

         if (lt8 == 0 && lt12 == 0) {

             lp88 = Bid - TakeProfit * MyPoint;

               if ((DayOfWeek() == 5 && (losses >0))||(DayOfWeek() == 1 && Hour() > 3)||(DayOfWeek() == 2)||(DayOfWeek() == 3)||(DayOfWeek() == 4)||(DayOfWeek() == 7 && Hour() > 24)){

                  if (li_28 == 1 && lt4 == 0)  {

                     if (AccountFreeMarginCheck(Symbol(), OP_SELL, Lots * 50) >= 0.0) { 

                        OrderSend(Symbol(), OP_SELL, Lots, Bid, 3,Bid+SL,lp88, "Magic = " + 301210, 301210, 0, Red);

                    }

               }

            }

         }

        

   if (lt4 != 0 && lt16 ==0) {

      if (AccountFreeMarginCheck(Symbol(), OP_BUY, 2.0 * ll40) >= 0.0) {

         lp72 = lo56 - SL;

            if (losses <0){ll96 = NormalizeDouble( Lots, 2);}else {ll96 = NormalizeDouble(Coefflosse0*ll40, 2);lp88 = lp72 - (TakeProfit0 * MyPoint);}

            if (losses ==1){ll96 = NormalizeDouble( Coefflosse1 * ll40 , 2);lp89 = lp72 - (TakeProfit1 * MyPoint);}

            if (losses ==2){ll96 = NormalizeDouble( Coefflosse2 * ll40 , 2);lp89 = lp72 - (TakeProfit2 * MyPoint);}

            if (losses ==3){ll96 = NormalizeDouble( Coefflosse3 * ll40 , 2);lp89 = lp72 - (TakeProfit3 * MyPoint);}

               OrderSend(Symbol(), OP_SELLSTOP, ll96, lp72, 3,lo56,lp89, "Magic = " + 301210, 301210, 0, OrangeRed);

            }

         }

     

   if (lt8 != 0 && lt12 ==0) {

      if (AccountFreeMarginCheck(Symbol(), OP_SELL, 2.0 * ll48) >= 0.0) {

         lp72 = lo64 + SL;

            if (losses <0){ll96 = NormalizeDouble( Lots, 2);}else {ll96 = NormalizeDouble(Coefflosse0*ll48, 2);lp88 = lo64 + SL + (TakeProfit0 * MyPoint);}

            if (losses ==1){ll96 = NormalizeDouble( Coefflosse1 * ll48 , 2);lp90 = lp72 + (TakeProfit1 * MyPoint);}

            if (losses ==2){ll96 = NormalizeDouble( Coefflosse2 * ll48 , 2);lp90 = lp72 + (TakeProfit2 * MyPoint);}

            if (losses ==3){ll96 = NormalizeDouble( Coefflosse3 * ll48 , 2);lp90 = lp72 + (TakeProfit3 * MyPoint);}

               OrderSend(Symbol(), OP_BUYSTOP, ll96, lp72, 3,lo64,lp90, "Magic = " + 301210, 301210, 0, DodgerBlue);

                }  

         } 

 //=====================================================================

  Infos =      "PROGRESSION PF: " +  DoubleToStr(P_PF,2) + "€"+"..."+DoubleToStr(P_PF1,2)+ "%" ; 

 Comment(Infos);

 return (0);

}


 void ModifPoint ()

{

   if (Digits == 5 || Digits == 3) 

   {

      MyPoint = Point*10;

      Dg = (Digits - 1);

   }

   else  

   { 

      MyPoint = Point; 

      Dg = Digits;

   }

   }

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(90)
Projeler
159
61%
Arabuluculuk
40
18% / 63%
Süresi dolmuş
70
44%
Serbest
2
Geliştirici 2
Derecelendirme
(15)
Projeler
65
58%
Arabuluculuk
6
17% / 33%
Süresi dolmuş
39
60%
Serbest
3
Geliştirici 3
Derecelendirme
(187)
Projeler
367
56%
Arabuluculuk
45
22% / 56%
Süresi dolmuş
188
51%
Serbest
Yayınlandı: 1 makale, 6 kod
4
Geliştirici 4
Derecelendirme
(48)
Projeler
91
31%
Arabuluculuk
28
29% / 43%
Süresi dolmuş
42
46%
Serbest
Yayınlandı: 1 kod
5
Geliştirici 5
Derecelendirme
(63)
Projeler
80
28%
Arabuluculuk
17
12% / 76%
Süresi dolmuş
48
60%
Serbest
6
Geliştirici 6
Derecelendirme
(64)
Projeler
144
46%
Arabuluculuk
19
42% / 16%
Süresi dolmuş
32
22%
Serbest
Benzer siparişler
I need an MT4/MT5 EA modification. Requirements: 1. Equity protection based on DAILY and TOTAL drawdown 2. Automatically close all trades when limit is hit 3. Disable trading after drawdown hit 4. Email notification when: - Daily loss limit reached - Total loss limit reached 5. EA must work on multiple accounts simultaneously 6. Clean and error-free code 7. Compatible with MT5 (or MT4 mention yours)
If you have profitable strategy or profitable EA on the gold pair without martingale / Hedge, then share me the EA with expiry time to back test and to test on the live market. Platform: MT5 pair: Gold Non-Martingale, No Hedging
I have a working Python backtester for my “DC-WAD Donchian” strategy. I need a MetaTrader 5 Expert Advisor (MQL5) for live trading that matches the Python logic as closely as possible ( no lookahead ). ✅ Critical requirement (must accept) EA must be tick-driven for entries/exits (touch logic). Bar-close approximation is not acceptable . Timeframes Strategy runs on a single Setup Timeframe (HTF) (user input, e.g
This indicator will code into MT5 EA. Trade on live, demo and strategy tester. No repaint, no redraw and stable on chart. 1. Include all inputs variable and value, Lots size in points adjustable, TP in points true or false adjustable, SL in points true or false adjustable, close position on opposite signal true or false, Use pending order true or false, use BE points true or false, use slippage point true or false
can you help me with the strategy for my mt4 or mt5 bot? I am learning trading, while working and I was thinking this could be a good way to still earn from the market while learning. If I have someone like you to guide me on strategy and maintaining the trading bot going forward. I do not have anything setup, I am going to pay a ten to build the EA, I just need the mentorship and we can agree on a unique price to
Good day, I am searching the very high level expert, which could create the auto-trade robot and I would like to order the trading robot for GOLD XAU/USD auto-trade on MetaTrader. I could pay a lot for the institutional grade auto-trade robot, just contact me and let me know what level of the robot you could offer and we will negotiate the price
Looking to purchase a EA for Gold and US30 with source Requirements: must have proper built in Risk Management Must yield good profit factor and recovery Factor Must work on any Broker Must have less than 15% drawdown Year over Year Z-Score should be high Consecutive Profits Must Outweigh Consecutive losses atleast 3/1 Must be able to work on accounts from 100USD and up Testing must be based off of real Tick Values
I’m looking for a NinjaTrader 8 developer to build or customize a fully automated futures strategy . Goals: Target ~$100/day (consistency over aggression) Long-term survivability (not scalping hype) Requirements: Trade ES/MES or NQ/MNQ Fixed risk per trade Daily profit & loss limits Time/session filters Break-even & trailing stop logic Full NT8 strategy (not indicator) Nice to have: Backtest + optimization
Je cherche un développeur pour un bot Fundednext pour le passage de challenge jusqu'au trading quotidien après le passage.le robot va s'occuper du compte du début à la suite du compte de 15k chez Fundednext.après le passage aux challenges,le robot doit être capable de me fournir 6-10% mensuel de rendement de ce compte. Il doit être capable de passer le challenge dans un bref délai de 2-3 semaine ou soit 10-15 jours
🧠 Project Overview We require an automated trading system that performs statistical arbitrage between: XAGUSD (MT5 account) MCX Silver (separate broker / API / account) The bot will calculate custom percentage movement from a daily anchor time and trade based on spread convergence, not broker-provided percentage values. --- 🧩 Core Concept The system must: 1. Capture daily anchor prices at 11:30 PM IST 2. Compute

Proje bilgisi

Bütçe
20 - 60 USD
Son teslim tarihi
from 2 to 15 gün