Need to change the size of my lots

MQL4 Esperti C++

Lavoro terminato

Tempo di esecuzione 3 ore
Feedback del cliente
Super job very professional
Feedback del dipendente
Thanks!!!!!

Specifiche

Hello,
I need the size of my lots increases when my second orders opens and my third.
and when I close all my orders manually it starts again from the beginning. like a martingale.

example:

I enter the value 0.01 lots for the first order. 0.02 for the second order and 0.05 for the
third order. When my expert is active he opens an order at (example) 1.3542 and what I would like is that when a stoploss or takeprofit is hit he opens the second order at 0.02 lots and when my takeprofit or stoploss is hit he opens a third order at 0.05 lots. and if I close everything manually, everything starts from the beginning 0.01 lots then 0.02 lots then 0.05 lots ect.....

//+------------------------------------------------------------------+
//|                                                       test35.mq4 |
//|                                                              xxx |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "xxx"
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
extern double  lots           = 0.01;
input int     TakeProfit      = 20;
input int     StopLoss        = 10;
extern int     magic          = 111112;
extern double  Level          = 1.3441;
extern double  MaxDeviation   = 9;         // Max Deviation, points

bool RunOnce=false;


int last_order_check = false;

datetime EaStartTime=TimeCurrent();




double takeprofit=TakeProfit;
double stoploss =StopLoss;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   RunOnce=false;
   MathSrand(GetTickCount());
   if(Digits==5 || Digits==3)
     {
      takeprofit  =TakeProfit*10;
      stoploss    =StopLoss*10;
     }
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnTimer()
{
OnTick();        
}
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{

  if(IsLastOrderClose())
    {
    OnInit();
    Print("Ea Closed Manually ");
    EaStartTime=TimeCurrent();
    }

   int ticet;
   int t=MathRand();
  
   if(CountVsego()==0)
        {
      if(t>16384)
        {
         if(RunOnce || (Ask >=Level && Ask<=Level+(MaxDeviation*_Point) && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-stoploss*Point,Ask+takeprofit*Point,"1",magic,0,clrGreen);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        } 
     else if(t<16384)
        {
         if(RunOnce || (Bid <=Level && Bid >= Level-(MaxDeviation*_Point) && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+stoploss*Point,Bid-takeprofit*Point,"1",magic,0,clrRed);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountSELL()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_SELL)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountBUY()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUY)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountVsego()
  {
   int Vsego;
   Vsego=CountBUY()+CountSELL();

   return(Vsego);
  }
//+------------------------------------------------------------------+
bool IsLastOrderClose()
{
bool signal = false;
for(int i=OrdersHistoryTotal()-1;i>=0;i--)
  {
   bool select = OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
   if(select && OrderSymbol()==_Symbol && OrderMagicNumber()==magic)
     {
     if(OrderType()==OP_BUY && OrderCloseTime()>=EaStartTime)
       {
       if(OrderClosePrice()>OrderStopLoss() && OrderClosePrice()<OrderTakeProfit())
         {
         signal = true;
         
         }
         break;
       }
     else if(OrderType()==OP_SELL && OrderCloseTime()>=EaStartTime)
       {
       if(OrderClosePrice()<OrderStopLoss() && OrderClosePrice()>OrderTakeProfit())
         {
         signal = true;
         
         }
         break;
       }
       break;
     }
  }
return(signal);
}

Con risposta

1
Sviluppatore 1
Valutazioni
(362)
Progetti
504
40%
Arbitraggio
147
18% / 72%
In ritardo
98
19%
Occupato
2
Sviluppatore 2
Valutazioni
(2422)
Progetti
3042
66%
Arbitraggio
77
48% / 14%
In ritardo
340
11%
In elaborazione
3
Sviluppatore 3
Valutazioni
(590)
Progetti
789
71%
Arbitraggio
9
33% / 33%
In ritardo
22
3%
Gratuito
4
Sviluppatore 4
Valutazioni
(1127)
Progetti
1429
62%
Arbitraggio
21
57% / 10%
In ritardo
43
3%
Gratuito
5
Sviluppatore 5
Valutazioni
(229)
Progetti
339
49%
Arbitraggio
21
5% / 33%
In ritardo
24
7%
Gratuito
6
Sviluppatore 6
Valutazioni
(196)
Progetti
200
28%
Arbitraggio
0
In ritardo
3
2%
In elaborazione
7
Sviluppatore 7
Valutazioni
(355)
Progetti
589
70%
Arbitraggio
14
43% / 7%
In ritardo
28
5%
Gratuito
8
Sviluppatore 8
Valutazioni
(548)
Progetti
825
73%
Arbitraggio
15
53% / 13%
In ritardo
193
23%
In elaborazione
9
Sviluppatore 9
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
0
In ritardo
1
50%
Gratuito
10
Sviluppatore 10
Valutazioni
(43)
Progetti
72
49%
Arbitraggio
4
0% / 50%
In ritardo
19
26%
Gratuito
11
Sviluppatore 11
Valutazioni
(586)
Progetti
1047
49%
Arbitraggio
39
28% / 41%
In ritardo
49
5%
Gratuito
12
Sviluppatore 12
Valutazioni
(105)
Progetti
135
42%
Arbitraggio
19
16% / 53%
In ritardo
20
15%
Caricato
Ordini simili
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
My trust wallet was hacked and I have tokens to claim which unlock almost daily but the person who hacked the wallet drains the tokens as soon as I claim them in the hacked wallet. I have contacted the support for that crypto but they were not helpful. There is no way to claim this crypto to another wallet. I need a bot or another solution that can transfer the crypto out of the hacked wallet into my other wallet as
I want a program that will help calculate and enter the market on full margin for me. I just need to put in the price for entry, Stop loss and TP then it will calculate the lot sizes for entering the trade on full margin on Mt5
I want to design a website like https://www.ngnrates.com/ we will change some stuff but not much, if you can deliver a website like this let me know your budget and readiness to implement
Hi, I need a robot, which wil get instructions to trade in 3 symbols at the same time based on few parameters and calculations. Example: There is 1 symbol called Gold-Near and the rate for it is 1000-1002 If i specify that when the rate reaches 1050, it should sell 1 lot Upon execution it will have to sell 1 lot of cme gold, buy 3 lots of mcx gold and buy currently (lots will be based on calculation). All the
I have a full code ,, There are some errors in this.It does not add to the chart, does not show arrow marks, does not alert ,, fix this problem and work properly,, Contact on telegram @Gw_rakib1
Hey, great developer I have a thinkorswim script I want to convert it into TradingView. Can you please let me know if you can i will be looking for great developer that will bid for it best regards
Hey, great developer I have a thinkorswim script I want to convert it into TradingView. Can you please let me know if you can i will be looking for great developer that will bid for it best regards
Tradingview developer 30 - 35 USD
Hey greetings. I am in need of tradingview developer that can modify an open source PineScript indicator code to add additional features. Kindly bid for this project if it is what you handle and let proceed with the project
hi. I hv a strategy on tradingview need to convert to MT4/MT5 expert advisor for algo trading. would like to add some tradingview strategy setting to the EA(not included in my tradingview code): recalculate after order is filled, order size: xx% of equity

Informazioni sul progetto

Budget
40+ USD
IVA (20%): 8 USD
Totale: 48 USD
Per lo sviluppatore
36 USD
Scadenze
a 10 giorno(i)