Convert a mql4 EA to a mql5

MQL5 专家

工作已完成

执行时间1 一天
员工反馈
Great customer - it was a pleasure to work with him!

指定

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;

   }

   }

反馈

1
开发者 1
等级
(90)
项目
159
61%
仲裁
40
18% / 63%
逾期
70
44%
空闲
2
开发者 2
等级
(15)
项目
65
58%
仲裁
6
17% / 33%
逾期
39
60%
空闲
3
开发者 3
等级
(187)
项目
367
56%
仲裁
45
22% / 56%
逾期
188
51%
空闲
4
开发者 4
等级
(48)
项目
91
31%
仲裁
28
29% / 43%
逾期
42
46%
空闲
5
开发者 5
等级
(63)
项目
80
28%
仲裁
17
12% / 76%
逾期
48
60%
空闲
6
开发者 6
等级
(62)
项目
140
46%
仲裁
19
42% / 16%
逾期
32
23%
空闲
相似订单
Creating of an expert advisor or trading bot that uses a Top Down analysis (using monthly, weekly, daily, hourly, minutes ( 30, 15, 5, 1) to determine trade direction or trend direction and makes multiple trade decisions for mt4. You can use or combine accurate trend indicators
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA
I am looking forward to automate my trading strategy where I use renko bars on Tradingview. I really want to use unirenkos too, but unfortunately I couldn't figure out how to use ninjatrader on my MacBook and Tradingview does not offer unirenkos. As far as I see from your offered services you are very familiar with ninjatrader. I wanted to ask you if you could code me an Indicator for unirenkos for Tradingview so I
I am looking forward to automate my trading strategy where I use renko bars on Tradingview. I really want to use unirenkos too, but unfortunately I couldn't figure out how to use ninjatrader on my MacBook and Tradingview does not offer unirenkos. As far as I see from your offered services you are very familiar with ninjatrader. I wanted to ask you if you could code me an Indicator for unirenkos for Tradingview so I
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA
Hello, I want to create an EA that can be able to take and optimise trade bids using the trend tracker concept I have developed. The tracker will monitor 2 lines to determine the trend of the market and afterwards take bids towards the correct direction. It will also be able to use a distance between the bids for the direction of the trend and plan a reverse bid when the price of the extreme doesn’t change again. The
Gradient boosting and L2 100 - 200 USD
I am looking for a well experienced programmer to put/implement a gradient boosting algorithm and an L2 to reduce overfitting in my ea which l already have which uses indicators . If you are experienced please adhere
Hello, I'm looking for a developer for repair calendar in EA MT4/MT5 (News Filter - https://ec.forexprostools.com ) for all windows servers. Note: EA MT4/MT5 works with calendar on PC Win 10, 11 but not on all windows servers. I have the source code and will post within the comments section for review. If you are able to do this and quality. Please apply. Thanks
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs
SCALP MARTINCALE SPY TIMEFRAME 1MIN CANDLE - SHORT SIDE ONLY 1-SET RISK : A IS A VARIABLE (HOW MUCH $) 2-SET ATR(3) : SET THE TIME AT WHICH THE ATR SHOULD BE TAKEN, IF SET 933AM THEN THE ATR OF THE 1MIN CANDLE AT 933AM CANDLE WILL BE USED (ROUND AT 0.25 UP OR DOWN) *USE NEW YORK TIME 3-SET MAX NUMBER OF ENTRY : B IS A VARIABLE 4-SET RSI(14) / C IS A VARIABLE, IF RSI(14) > C = ORDERS OPEN 5-IF RSI(14) > C IS TRIGGERED

项目信息

预算
20 - 60 USD
开发人员
18 - 54 USD
截止日期
 2  15 天