Need to change the size of my lots

MQL4 전문가 C++

작업 종료됨

실행 시간 3 시간
고객의 피드백
Super job very professional
피고용인의 피드백
Thanks!!!!!

명시

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

응답함

1
개발자 1
등급
(362)
프로젝트
506
40%
중재
147
18% / 72%
기한 초과
99
20%
로드됨
2
개발자 2
등급
(2428)
프로젝트
3057
66%
중재
77
48% / 14%
기한 초과
340
11%
작업중
3
개발자 3
등급
(590)
프로젝트
789
71%
중재
9
33% / 33%
기한 초과
22
3%
무료
4
개발자 4
등급
(1130)
프로젝트
1432
62%
중재
21
57% / 10%
기한 초과
43
3%
무료
5
개발자 5
등급
(229)
프로젝트
339
49%
중재
21
5% / 33%
기한 초과
24
7%
무료
6
개발자 6
등급
(202)
프로젝트
206
27%
중재
0
기한 초과
3
1%
무료
7
개발자 7
등급
(356)
프로젝트
590
70%
중재
14
43% / 7%
기한 초과
28
5%
무료
8
개발자 8
등급
(549)
프로젝트
826
73%
중재
15
53% / 13%
기한 초과
193
23%
작업중
9
개발자 9
등급
(1)
프로젝트
2
0%
중재
0
기한 초과
1
50%
무료
10
개발자 10
등급
(43)
프로젝트
72
49%
중재
4
0% / 50%
기한 초과
19
26%
무료
11
개발자 11
등급
(586)
프로젝트
1048
49%
중재
39
28% / 41%
기한 초과
49
5%
무료
12
개발자 12
등급
(108)
프로젝트
138
43%
중재
19
16% / 53%
기한 초과
20
14%
로드됨
비슷한 주문
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
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
Hi guys I would like to k ow if someone has experience with machine learning models? I would like to train a model to identify if there is a range market or trendy market based on several parameters like EMA and ATR for example. If we use for example a 20 and 50 EMA and we measure the distance between both lines the algo should oearn if the trend is strong or weak. If it‘s steong it keeps trending and if it‘s weak
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. THREE TYPES OF ENTRIES 1: AGGRESSIVE 2: DIVERGENCE 3
I need a simple panel to execute both buy and sell operations with very basic things like stopp loss take profit that functions for both market orders such as buy stop sell stop buy limit sell limit I don't care about colors or design I just want how you can do it what interests me most are the functions
I want to create an EA that can take bids according to information of a logic I have developed to give indication of a BUY or SELL opportunity. The EA will then be able to activate the BUY at the lowest possible position once the indicator clears it for a BUY and take bid upwards or identify the highest point and clears it for a SELL and take bids downwards. As you can see from example of JULY 2024 data to see how
Hello, I‘m interested in an indicator to predict the next candles probability (bullish or bearish). But honestly I have no idea how to do this. Would be interested in your opinion how we can create such an indicator. Please let me know if you‘ve done similar work
Hey greetings. Am in need of a developer that has already made profitable MT4 or MT5 EA that I can buy with the backtesting and proven result. How is the draw down ? What is the winning rate ? Kindly reply and let proceed
I need a TradingView script (not mine) converted to an Mt5 EA. There is some specifications for the robots on when to be able to take a trade. Attached bellow is the file of the script I want translated and converted to MT5 then EA
GOODAY TO YOU I AM NEED OF A FAST, TALENTED AND HIGH QUALITY CODER TO THIS JOB FOR ME. THE EA TRADE MANAGER WILL HAVE THE FOLLOWING: STOPLOSS & TAKEPROFIT IN PIPS LOT SIZE IN PIPS NUMBER OF TRADES (1-30 TRADES MAXIMUM) PLEASE LOOK AT THE PICTURE ABOVE FOR A GUIDE

프로젝트 정보

예산
40+ USD
VAT (20%): 8 USD
총: 48 USD
개발자에게
36 USD
기한
 10 일