Need to change the size of my lots

MQL4 Experten C++

Auftrag beendet

Ausführungszeit 3 Stunden
Bewertung des Kunden
Super job very professional
Bewertung des Entwicklers
Thanks!!!!!

Spezifikation

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);
}

Bewerbungen

1
Entwickler 1
Bewertung
(362)
Projekte
504
40%
Schlichtung
147
18% / 72%
Frist nicht eingehalten
98
19%
Überlastet
2
Entwickler 2
Bewertung
(2422)
Projekte
3042
66%
Schlichtung
77
48% / 14%
Frist nicht eingehalten
340
11%
Arbeitet
3
Entwickler 3
Bewertung
(590)
Projekte
789
71%
Schlichtung
9
33% / 33%
Frist nicht eingehalten
22
3%
Frei
4
Entwickler 4
Bewertung
(1127)
Projekte
1429
62%
Schlichtung
21
57% / 10%
Frist nicht eingehalten
43
3%
Frei
5
Entwickler 5
Bewertung
(229)
Projekte
339
49%
Schlichtung
21
5% / 33%
Frist nicht eingehalten
24
7%
Frei
6
Entwickler 6
Bewertung
(196)
Projekte
200
28%
Schlichtung
0
Frist nicht eingehalten
3
2%
Arbeitet
7
Entwickler 7
Bewertung
(355)
Projekte
589
70%
Schlichtung
14
43% / 7%
Frist nicht eingehalten
28
5%
Frei
8
Entwickler 8
Bewertung
(548)
Projekte
825
73%
Schlichtung
15
53% / 13%
Frist nicht eingehalten
193
23%
Arbeitet
9
Entwickler 9
Bewertung
(1)
Projekte
2
0%
Schlichtung
0
Frist nicht eingehalten
1
50%
Frei
10
Entwickler 10
Bewertung
(43)
Projekte
72
49%
Schlichtung
4
0% / 50%
Frist nicht eingehalten
19
26%
Frei
11
Entwickler 11
Bewertung
(586)
Projekte
1047
49%
Schlichtung
39
28% / 41%
Frist nicht eingehalten
49
5%
Frei
12
Entwickler 12
Bewertung
(105)
Projekte
135
42%
Schlichtung
19
16% / 53%
Frist nicht eingehalten
20
15%
Beschäftigt
Ähnliche Aufträge
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

Projektdetails

Budget
40+ USD
MwSt (20%): 8 USD
Insgesamt: 48 USD
Für die Entwickler
36 USD
Ausführungsfristen
bis 10 Tag(e)