Modify a free martingale system based EA

MQL4 Asesores Expertos

Trabajo finalizado

Plazo de ejecución 3 días
Comentario del Cliente
this person has no time to deal, he finds an excuse or the other and moves ahead
Comentario del Ejecutor
Be careful - this customer try to get You to do extra work for free, threatening not to complete already performed job. Use arbitration without hesitation

Tarea técnica

hi

 

I like this below given free EA, it is martingale based EA, the EA from below code places a 0.01 lots order, and if the order is in loss, then it will put second order with 0.02 lots to even out the loosing order, and it keeps on making multiple orders of 0.03 , 0.04 etc lots to even out the loosing trades, i like this. But, the problem is that i do not want the EA to place the second order of 0.02 lots, instead the EA should place 2 orders at 15 seconds interval of 0.01 lots each, and for 0.03 lot, it should put 3 orders of 0.01 lots each at 15 seconds interval and so on.... i think you can use for loop for it... or whatever suitable

 Please note it that i want the results of the below EA and the modified EA to be SAME, by same i don't mean exactly same, but the result should be almost 95% same.... 

Also, i would like to tell you that i have already tried to put the mult = 1, by doing so, the EA does not make a single order by 0.02 lots, it does as i wanted, it does 0.01 lots 2 orders, but the problem here is that the second order is generated about 1 hour late as it waits for the occurrence of the stochastic to put the next order to even out the loosing order... and this makes the EA go in loss

 so as i said above, i just want the EA to put 2 orders of 0.01 instead of 0.02... and 3 orders of 0.01 instead of 0.03 and so on...

or however it is possible.... use your logic....

 all i need is the same performance but not the order of 0.02 or 0.03, all orders should be of constant lot 0.01 only and result should be same, the orders should be with 15 seconds gap

 the reason for the 15 second gap and constant lot size.... all i can tell is that i want this EA to be placed on a system as an account manager and the company has the rule of 15 second gap and constant lot size, so that is the reason i want this EA to be modified

 

thanks ..below is the code to be modified

 

//+------------------------------------------------------------------+
//|                                                          aaa.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
extern double step=25;
extern int StepMode=0;
// Åñëè StepMode = 0, òî øàã ìåæäó îðäåðàìè ôèêñèðîâàííûé è ðàâåí step
// Åñëè StepMode = 1, òî øàã ïîñòåïåííî óâåëè÷èâàåòñÿ
extern double proffactor=10;
extern double mult=1.5;
extern double lotsbuy=0.01;
extern double lotssell=0.01;  
extern double per_K=200;
extern double per_D=20;
extern double slow=20;
extern double zoneBUY=50;
extern double zoneSELL=50;
extern double Magicbuy=555;
extern double Magicsell=556;
double openpricebuy,openpricesell,lotsbuy2,lotssell2,lastlotbuy,lastlotsell,tpb,tps,cnt,smbuy,smsell,lotstep,
ticketbuy,ticketsell,maxLot,free,balance,lotsell,lotbuy,dig,sig_buy,sig_sell,ask,bid;                           
                                int OrdersTotalMagicbuy(int Magicbuy)
 {
   int j=0;
   int r;
   for (r=0;r<OrdersTotal();r++)
   {
     if(OrderSelect(r,SELECT_BY_POS,MODE_TRADES))
     {
        if (OrderMagicNumber()==Magicbuy) j++;
     }
   }   
 return(j); 
 }

                                int OrdersTotalMagicsell(int Magicsell)
{
   int d=0;
   int n;
   for (n=0;n<OrdersTotal();n++)
   {
     if(OrderSelect(n,SELECT_BY_POS,MODE_TRADES))
     {
        if (OrderMagicNumber()==Magicsell) d++;
     }
   }    
 return(d);
  }     
                                      int orderclosebuy(int ticketbuy)
     {
string symbol = Symbol();
int cnt;
    for(cnt = OrdersTotal(); cnt >= 0; cnt--)
       {
       OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);       
       if(OrderSymbol() == symbol && OrderMagicNumber()==Magicbuy) 
         {
         ticketbuy=OrderTicket();OrderSelect(ticketbuy, SELECT_BY_TICKET, MODE_TRADES);lotsbuy2=OrderLots() ;                         
         double bid = MarketInfo(symbol,MODE_BID); 
         RefreshRates();
         OrderClose(ticketbuy,lotsbuy2,bid,3,Magenta); 
         }
       }
       lotsbuy2=lotsbuy;return(0);
     } 
                                      int orderclosesell(int ticketsell)
     {
string symbol = Symbol();
int cnt;   
    for(cnt = OrdersTotal(); cnt >= 0; cnt--)
       {
       OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);       
       if(OrderSymbol() == symbol && OrderMagicNumber()==Magicsell) 
         {
         ticketsell=OrderTicket();OrderSelect(ticketsell, SELECT_BY_TICKET, MODE_TRADES);lotssell2=OrderLots() ;                         
         double ask = MarketInfo(symbol,MODE_ASK); 
         RefreshRates();
         OrderClose(ticketsell,lotssell2,ask,3, Lime); 
         }
       }
       lotssell2=lotssell;return(0); 
     }
                                                 int start()
  {
//----
  double profitbuy=0;double profitsell=0;
  string symbol = OrderSymbol();
  double spread = MarketInfo(symbol,MODE_SPREAD);
  double minLot = MarketInfo(symbol,MODE_MINLOT);
  if (minLot==0.01){dig=2;maxLot=MarketInfo(symbol,MODE_MAXLOT);}
  if (minLot==0.1){dig=1;maxLot=((AccountBalance()/2)/1000);}
  if(OrdersTotalMagicbuy(Magicbuy)>0)
  {
  double smbuy;
  for (cnt=0;cnt<OrdersTotal();cnt++)
    {
    OrderSelect(cnt,SELECT_BY_POS, MODE_TRADES);
    if (OrderSymbol() == Symbol() && OrderMagicNumber () == Magicbuy) 
      {
      ticketbuy = OrderTicket();OrderSelect(ticketbuy,SELECT_BY_TICKET, MODE_TRADES);
      smbuy = smbuy+OrderLots();openpricebuy = OrderOpenPrice();lastlotbuy = OrderLots();
      }
    }
    {   
    if (smbuy+(NormalizeDouble((lastlotbuy*mult),dig))<maxLot)
      {     
      if(StepMode==0)
        {
        if(Ask<=openpricebuy-step*Point)
          {
          lotsbuy2=lastlotbuy*mult;
          RefreshRates();ticketbuy=OrderSend(Symbol(),OP_BUY,NormalizeDouble(lotsbuy2,dig),Ask,3,0,0,"MartingailExpert",Magicbuy,0,Blue);
          }
        }
      if(StepMode==1)
        {
        if(Ask<=openpricebuy-(step+OrdersTotalMagicbuy(Magicbuy)+OrdersTotalMagicbuy(Magicbuy)-2)*Point)
          {
          lotsbuy2=lastlotbuy*mult;
          RefreshRates();ticketbuy=OrderSend(Symbol(),OP_BUY,NormalizeDouble(lotsbuy2,dig),Ask,3,0,0,"MartingailExpert",Magicbuy,0,Blue);
          } 
        }
      }
    }
  }
  if(OrdersTotalMagicsell(Magicsell)>0)
  {
  double smsell;
  for (cnt=0;cnt<OrdersTotal();cnt++)
    {
    OrderSelect(cnt,SELECT_BY_POS, MODE_TRADES);
    if (OrderSymbol() == Symbol() && OrderMagicNumber () == Magicsell)
      {
      ticketsell = OrderTicket();OrderSelect(ticketsell,SELECT_BY_TICKET, MODE_TRADES);
      smsell = smsell + OrderLots();openpricesell = OrderOpenPrice();lastlotsell = OrderLots();
      }     
    }
    {
    if (smsell+(NormalizeDouble((lastlotsell*mult),dig))<maxLot)
      {
      if(StepMode==0)
        {
        if(Bid>=openpricesell+step*Point)
          {
          lotssell2=lastlotsell*mult;
          RefreshRates();ticketsell=OrderSend(Symbol(),OP_SELL,NormalizeDouble(lotssell2,dig),Bid,3,0,0,"MartingailExpert",Magicsell,0,Red);
          }
        }
      if(StepMode==1)
        {
        if(Bid>=openpricesell+(step+OrdersTotalMagicsell(Magicsell)+OrdersTotalMagicsell(Magicsell)-2)*Point)
          {
          lotssell2=lastlotsell*mult;
          RefreshRates();ticketsell=OrderSend(Symbol(),OP_SELL,NormalizeDouble(lotssell2,dig),Bid,3,0,0,"MartingailExpert",Magicsell,0,Red);
          }
        }
      }
    }  
  }
  if(OrdersTotalMagicbuy(Magicbuy)<1)
  { 
  if(iStochastic(NULL,0,per_K,per_D,slow,MODE_LWMA,1,0,1)>iStochastic(NULL,0,per_K,per_D,slow,MODE_LWMA,1,1,1)
  && iStochastic(NULL,0,per_K,per_D,slow,MODE_LWMA,1,1,1)>zoneBUY)ticketbuy = OrderSend(Symbol(),OP_BUY,lotsbuy,Ask,3,0,0,"MartingailExpert",Magicbuy,0,Blue);
  }
  if(OrdersTotalMagicsell(Magicsell)<1)
  {
  if(iStochastic(NULL,0,per_K,per_D,slow,MODE_LWMA,1,0,1)<iStochastic(NULL,0,per_K,per_D,slow,MODE_LWMA,1,1,1)
  && iStochastic(NULL,0,per_K,per_D,slow,MODE_LWMA,1,1,1)<zoneSELL)ticketsell = OrderSend(Symbol(),OP_SELL,lotssell,Bid,3,0,0,"MartingailExpert",Magicsell,0,Red);
  }
  for (cnt=0;cnt<OrdersTotal();cnt++)
  {
  OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
  if (OrderSymbol()==Symbol() && OrderMagicNumber () == Magicbuy)
    {
    ticketbuy = OrderTicket();OrderSelect(ticketbuy,SELECT_BY_TICKET, MODE_TRADES);profitbuy = profitbuy+OrderProfit() ;
    openpricebuy = OrderOpenPrice();
    }
  }  
  tpb = (OrdersTotalMagicbuy(Magicbuy)*proffactor*Point)+openpricebuy;
  double bid = MarketInfo(Symbol(),MODE_BID);
  if (profitbuy>0)
  {
  if (Bid>=tpb) orderclosebuy(ticketbuy);
  }
  for (cnt=0;cnt<OrdersTotal();cnt++)
  {   
  OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
  if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magicsell)
    {
    ticketsell = OrderTicket();OrderSelect(ticketsell,SELECT_BY_TICKET, MODE_TRADES);profitsell = profitsell+OrderProfit();
    openpricesell = OrderOpenPrice(); 
    }
  }
  tps = openpricesell-(OrdersTotalMagicsell(Magicsell)*proffactor*Point);
  double ask = MarketInfo(Symbol(),MODE_ASK);    
  if (profitsell>0)
  {
  if (Ask<=tps)orderclosesell(ticketsell);    
  }
  free = AccountFreeMargin();balance = AccountBalance();    
  for (cnt=0;cnt< OrdersTotal();cnt++)
  {   
  OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
  if (OrderSymbol()==Symbol() && OrderMagicNumber () == Magicbuy)  ticketbuy = OrderTicket();
  if (OrderSymbol()==Symbol() && OrderMagicNumber () == Magicsell) ticketsell = OrderTicket();
  }
  if (OrdersTotalMagicbuy(Magicbuy)==0)
  {
  profitbuy=0;ticketbuy=0;tpb=0;
  }
  if (OrdersTotalMagicsell(Magicsell)==0)
  {
  profitsell=0;ticketsell=0;tps=0;
  }
  Comment("FreeMargin = ",NormalizeDouble(free,0),"  Balance = ",NormalizeDouble(balance,0),"  maxLot = ",NormalizeDouble(maxLot,dig),"\n",
  "Totalbuy = ",OrdersTotalMagicbuy(Magicbuy),"  Lot = ",smbuy,"  Totalsell = ",OrdersTotalMagicsell(Magicsell),"  Lot = ",smsell,"\n",
  "---------------------------------------------------------------","\n","Profitbuy = ",profitbuy,"\n",
  "Profitsell = ",profitsell);
//----
   for(int ii=0; ii<2; ii+=2)
     {
      ObjectDelete("rect"+ii);
      ObjectCreate("rect"+ii,OBJ_HLINE, 0, 0,tps);
      ObjectSet("rect"+ii, OBJPROP_COLOR, Red);
      ObjectSet("rect"+ii, OBJPROP_WIDTH, 1);
      ObjectSet("rect"+ii, OBJPROP_RAY, False);
      }    
   for(int rr=0; rr<2; rr+=2)
      {
      ObjectDelete("rect1"+rr);
      ObjectCreate("rect1"+rr,OBJ_HLINE, 0, 0,tpb);      
      ObjectSet("rect1"+rr, OBJPROP_COLOR, Blue);
      ObjectSet("rect1"+rr, OBJPROP_WIDTH, 1);
      ObjectSet("rect1"+rr, OBJPROP_RAY, False);     
     }
   return(0);
}  
//+------------------------------------------------------------------+

 

Han respondido

1
Desarrollador 1
Evaluación
(803)
Proyectos
1374
72%
Arbitraje
113
28% / 48%
Caducado
342
25%
Trabaja
2
Desarrollador 2
Evaluación
(272)
Proyectos
394
63%
Arbitraje
70
53% / 26%
Caducado
198
50%
Libre
3
Desarrollador 3
Evaluación
(59)
Proyectos
182
55%
Arbitraje
31
45% / 16%
Caducado
103
57%
Libre
4
Desarrollador 4
Evaluación
(182)
Proyectos
342
42%
Arbitraje
118
12% / 73%
Caducado
104
30%
Libre
5
Desarrollador 5
Evaluación
(9)
Proyectos
20
70%
Arbitraje
1
0% / 100%
Caducado
9
45%
Libre
6
Desarrollador 6
Evaluación
(180)
Proyectos
301
30%
Arbitraje
54
24% / 56%
Caducado
98
33%
Libre
7
Desarrollador 7
Evaluación
(4)
Proyectos
7
43%
Arbitraje
5
0% / 60%
Caducado
3
43%
Libre
8
Desarrollador 8
Evaluación
(20)
Proyectos
46
54%
Arbitraje
3
67% / 0%
Caducado
14
30%
Libre
9
Desarrollador 9
Evaluación
(58)
Proyectos
89
38%
Arbitraje
26
4% / 77%
Caducado
39
44%
Trabaja
Solicitudes similares
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
I WRITE a code i want to conect this for automatic trading through vps .and als advanced features for this code .i attached afile please watch .and give me perfect ea
Hello, I need a martingale and grid bot. The programmer must provide a test of about 5 minutes for the EA to see how it works and if everything is fine, it will be selected to make some modifications for personal use to that EA that you provide. If it has a lot of graphics or buttons. better It doesn't matter if the robot is bad, I'm more interested in its functionalities to use with my strategy
Hi Developer, I would like to create the Scalping EA based for Mt4 on the investing.com data https://www.investing.com/currencies/eur-usd-technical EA have timing to adjust time to trade. follow the broker time. From starting time to end time EA have a adjustable Lot size (0.01 incremental to 0.01) EA have a adjustable TP (1pip to 100pip incremental 1pip) EA have a adjustable SL (1pip to 100pip incremental 1pip) EA
Here is the Idea: I want a Semi Auto Trade Panel Manager EA that only activates when I press the BUY or SELL or BUY LIMIT or SELL LIMIT then the EA will do the rest : that includes the BUY STOP 0r SELL STOP and the hedging calculations according to below diagram. So overall , my only intervention is entering the lot size , hedge zone distance and TP ratio or entering the price for buy limit/sell limit then pressing
Hi, I'm looking for a martingale MT4 EA that performs a lot of trading volume per day. If you have the robot, you'll need to send me the demo so I can backtest it. Thank you very much
Hello potential Freelancers I’m very new to trading so please bear with me as I try to explain what ‘m looking for. I'm currently getting signals ( XAUUSD )sent to me and I’m looking to find a person who can look at the data either watch account live, or I send the trade history. The bot my provider is using makes 100’s of trades a day and does very well on average. I’m also looking to have the following features
we want to build a dashboard ea that would display on another chart key metrics : i will foward screeshot of what i want to dashboard to look like : the function i would need to get display are the following: 1. classified past performance ea by magic number ( with classic : total trade , total profit , return/dd , max dd (base on history) , ) 2. equity chart of performance if we click on a magic number we should
the task will be actually quiet simple , i need an active develloper to devellope out of 3 updates an ea STEP 1 (this job): make a classical pair trading ea , that can calculate correlation between assets and trade when the correlation diverge above a specified % the develloper that will postulate for the job will need : 1- to be ok to do the full project this job and the update following 2- very low arbitration , i
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 the 2 lines in the below pictures and then start to activate bids once they cross each other and then be able to manage all bids afterwards towards the direction of the market by opening and closing them intermittently and profitably until the position at the other

Información sobre el proyecto

Presupuesto
100 - 110 USD
Para el ejecutor
90 - 99 USD
Plazo límite de ejecución
de 1 a 7 día(s)