I Make an EA Martingale and need some tips

MQL4 Indicatori Esperti

Lavoro terminato

Tempo di esecuzione 4 giorni
Feedback del cliente
It was great to work with Aleksei because in some situations I felt like I had a friend near me who gave me advice. Thanks Aleksei !!!

Specifiche

1. how to find the martingale level after a closing and reopening

2. How implement break even (template code)


I have this params:

input string  s1                   = "Last update: 2017/10/11";
input bool    UseMoneyManagement   = false;     //UseMoneyManagement use money management for the trade volume calculation
input double  RiskPercent          = 0.5;       //RiskPercent the percent of the risk for the trade volume calculation
input double  Lots                 = 0.01;      //Lots fixed lot size
input int     NBarsCalcStopLoss    = 4;         //NBarsCalcStopLoss The n. bars for calc Higest (for sell) or Lowest (for buy)
input double  GapStopLoss          = 5;         //GapStopLoss To be added to StopLoss
input double  RRTakeProfit         = 1.0;       //RRTakeProfit Rsk Reward for calc Take profit
input int     MagicNumber          = 1122112223;//Magic number for EA's orders
input int     Slippage             = 70;        //Slippage maximum allowed deviation (in pips) of the price by opening
input int     SpreadLimit          = 12;        //SpreadLimit maximum allowed spread in points
// input int     StrategyN            = 3;         //number of case in FcStrategy.MA routine that is the strategy used to determine the buy or sell

input string  s2                   = "-------------------";
input int     FromTimeHourTrade    = 6;         // Hour from start trade
input int     ToTimeHourTrade      = 19;        // Hour to stop trade
input int     MaxBarsStillTradeOpen= 10;        // Max number of bars where position can be open, after this the operation is closed
input int     PercOfGainForBE      = 0;         // PercOfGainForBE (0=Disalbed) The percentage of gain for apply Break even
input int     PercOfLotsToCloseAtBE= 50;        // The percetange of lots to be close when the PercOfGainForBE is reached
    
input string  s3                   = "-------------------";
input double  MultiplierLot        = 2.0;
input double  MaxLots              = 1.28;
input string  ContRev              = "RCCRCRRCCCRRC"; //C=Continue; R=Reverse; Continue is the versus of first (lose) trade, Reverse is the opposite versus of first (lose) trade



this routine menage break even but don't work

//+--------------------------------------------------------------------------------+
//| the function for managing of EA's Break even and max bars trade                |
//+--------------------------------------------------------------------------------+
void do_manageBE( int magicBuySell)
{
   int typ;double lot=0;double profit;
   double tmpLots=0;
   int BuyOrSell=0;
  
   double point = XGetPoint(Symbol());                            // get point value
   int total_ordersB = orders_count(MagicNumber);                 // count of opening orders
   int total_ordersS = orders_count(MagicNumber);                 // count of opening orders
   string symbol = Symbol();
  
   //
   //--- Check the action to do based on the last trade result
   //
   if(((total_ordersB+total_ordersS) > 0) ){                      // Check One order active
      if(nBSOT.LastStartHour!=Time[0]){                           // Check for increment n. of bar trade is active
         // Moved to History() routine --- nBSOT.nBarsStillOpenTrade=iBarShift(NULL,0,OrderOpenTime(),true);//++;
         nBSOT.LastStartHour=Time[0];
      }
      //
      // Manage n. max of bar where the trade must be opened
      //
      if((nBSOT.nBarsStillOpenTrade>MaxBarsStillTradeOpen) && (MaxBarsStillTradeOpen>0)){        // Check the numer of hour active trade exceed the threeshold
         int orders_total = OrdersTotal();                        // Num. tot. orders
         for( int count = 0; count < orders_total; count++ ){     // Cicle for orders
            if( OrderSelect(count,SELECT_BY_POS,MODE_TRADES) && OrderMagicNumber() == MagicNumber ){ // if selected order is active trade and magic ok
               // Print("Close..."+OrderTicket()+":-:"+OrderLots()+":-:"+Bid+":-:"+nBSOT.nBarsStillOpenTrade);
               int ord_type = OrderType();
               double PriceForClose=0.0;
                if( ord_type == OP_BUY  )
                  PriceForClose=Bid;
                if( ord_type == OP_SELL  )
                  PriceForClose=Ask;
               
               XOrderClose(OrderTicket(), OrderLots(), PriceForClose, Slippage);                               // Close order                                   
            }
         }
      }
      //
      // Manage Break Even
      //
      if((PercOfGainForBE>0)){        // Check the break even required by user input
         int orders_total = OrdersTotal();                        // Num. tot. orders
         for( int count2 = 0; count2 < orders_total; count2++ ){     // Cicle for orders
            if( OrderSelect(count2,SELECT_BY_POS,MODE_TRADES) && OrderMagicNumber() == MagicNumber ){ // if selected order is active trade and magic ok
               // Print("Close..."+OrderTicket()+":-:"+OrderLots()+":-:"+Bid+":-:"+nBSOT.nBarsStillOpenTrade);
               int ord_type = OrderType();
               double PriceForClose=0.0;
                if( ord_type == OP_BUY  ){
                  PriceForClose=0.0;
                  if(Bid>=LastTradeBE){    // Check if the LastTradeBE (setted at the order open) is more than Bid price
                     PriceForClose=Bid;    // is time to close order
                  }
                }
                if( ord_type == OP_SELL  ){
                  PriceForClose=0.0;
                  if(Ask<=LastTradeBE){    // Check if the LastTradeBE (setted at the order open) is less than Ask price
                     PriceForClose=Ask;    // is time to close order
                  }
                }
                if(PriceForClose>0.0){
                  XOrderModify(OrderTicket(),PriceForClose,OrderOpenPrice(),OrderTakeProfit(),0,0);         // Modify SL to entry price (Break Even)
                  //if(PercOfLotsToCloseAtBE>0){
                  //   XOrderClose(OrderTicket(), ActualTradePercOfLotsToCloseAtBE, PriceForClose, Slippage);
                  //   return;
                  //}
                  // XOrderClose(OrderTicket(), OrderLots(), PriceForClose, Slippage);                               // Close order                                   
                }
            }
         }
      }
           
     
   }



Con risposta

1
Sviluppatore 1
Valutazioni
(879)
Progetti
1392
67%
Arbitraggio
117
32% / 42%
In ritardo
215
15%
Gratuito
2
Sviluppatore 2
Valutazioni
(589)
Progetti
921
46%
Arbitraggio
31
39% / 29%
In ritardo
93
10%
In elaborazione
3
Sviluppatore 3
Valutazioni
(801)
Progetti
1372
72%
Arbitraggio
112
29% / 48%
In ritardo
341
25%
In elaborazione
4
Sviluppatore 4
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(2423)
Progetti
3046
66%
Arbitraggio
77
48% / 14%
In ritardo
340
11%
Gratuito
6
Sviluppatore 6
Valutazioni
(14)
Progetti
22
59%
Arbitraggio
2
0% / 50%
In ritardo
2
9%
Gratuito
Ordini simili
I'm looking for professional developer for my project.I'm having indicators source code , i want to convert it into MT4 EA .it is having some basic inputs such as lot size,TP,SL,B.E,trailing,News filter features along with some special inputs.detailed strategy will be discussed in chat room.i prefer Indian developers who speaks hindi
I would like some assistance modifying an indicator as I am not experienced enough to make these changes myself. The indicator is relatively simple high/low breakout indicator that I need to add additional logic to. Source code will be provided. Current Features The indicator provided scans swing highs and lows and based on certain conditions draws a green or red line showing a break high or low. Dots are drawn to
Create an indicator on MFI based on multi time frame. 15 minutes time frame MFI period 5 should be touching 5 and on 5 minutes time frame when it touches 20 it should give a BUY signal. For sell on 15 minutes 95 and 5 minutes 80
I am looking to have a tool developed that can connect and copy trade from Quantower on machine A to Quantower on machine B. I am aware that Quantower has a built in trade copier but I need to get the trades over to a different instance of QT on a separate machine. Is this possible and something you could help with? All orders for entry and exit would be market orders so do not need any targets or stop losses copied
HELLO, I need some modifications into my indicator . I need to add the possibility to show the old zones in addition to the current ones . We can already choose the possibility of displaying the old zones with the history mode with a double click when the option is ON, but this remove the current zones . What i want is the possibility when you activate the HISTORY MODE : to KEEP THE OLD ZONES DISPLAYED AUTOMATICALLY
MT4 INDICATOR 30 - 35 USD
Looking for a proven MT4 indicator that is highly consistent and profitable preferably that you have developed and are able to share with me. If you have some indicator that is valuable for making consistent profit please bid and show me trading history from using it in your MT4 account. Thanks
Hello great developer, I am a trader and I have an existing indicator in pinescript , but I need an expert to translate the specific concepts and functions of Pine Script to MQL4. I have many information to share with you in the comment section, so please if you are capable of handling this project successfully please apply to this order, looking forward to your response
Please fix code 30+ USD
everytime the a is greater than zero the value should be saved to be added to the previous value. so you should go back by all the consecutive times a is greater than zero and store the value to be summed i will send you my indicator and will ask you to please fix it
I need a EA to open 2 trades 1. one trade with a SL and a TP 2. one trade with a SL no TP if the 1st trade takes TP the 2nd trade SL needs to move on break even and trail the trade thereafter. will need the lot size Number of trades
there I hope you're doing well I want to convert the tradingview indicator to make an indicator for mt5. And in that, I want to make an automatic robot on the base of the indicator. I have the pine script of that indicator

Informazioni sul progetto

Budget
30 - 100 USD
IVA (22%): 6.6 - 22 USD
Totale: 36.6 - 122 USD
Per lo sviluppatore
27 - 90 USD