Need a function Equity target

İş tamamlandı

Tamamlanma süresi: 3 saat
Geliştirici tarafından geri bildirim
Good Customer
Müşteri tarafından geri bildirim
Exellent work, super and fast thank you I recomande :)

İş Gereklilikleri

Hello,

My problem is the trigger on the AccountProfit function.
 what I would like is that it is on AccountEquity + Target .


Example:

My account Equity is 458, my target is 1, when my AccountEquity will arrive at
459 "Boom" all orders are closed, and my AccountEquity goes to 460 then 461 ect ....


//+------------------------------------------------------------------+
//|                                              Balbuzia_3_in_1.mq4 |
//|                                         Copyright 2018, GCN ltd. |
//|                                          http://www.it-labmd.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, GCN ltd."
#property link      "http://www.it-labmd.com"
#property version   "1.00"
#property strict
extern double  lots1_1          = 0.01;
extern double  lots2_1          = 0.02;
extern double  lots3_1          = 0.04;
input int      TakeProfit1_1     =   10;
input int      StopLoss1_1       =   400;
input int      TakeProfit2_1     =   10;
input int      StopLoss2_1       =   400;
input int      TakeProfit3_1     =   10;
input int      StopLoss3_1       =   400;
extern int     magic_1=000013;
extern double  Level_1=1.3000;
extern double  MaxDeviation_1=9;         // Max Deviation, points

bool RunOnce_1=false;
int last_order_check_1=false;
datetime EaStartTime_1=TimeCurrent();
double takeprofit1_1=TakeProfit1_1;
double stoploss1_1=StopLoss1_1;
double takeprofit2_1=TakeProfit2_1;
double stoploss2_1=StopLoss2_1;
double takeprofit3_1=TakeProfit3_1;
double stoploss3_1=StopLoss3_1;

extern double  lots1_2          = 0.01;
extern double  lots2_2          = 0.02;
extern double  lots3_2          = 0.04;
input int      TakeProfit1_2     =   10;
input int      StopLoss1_2       =   400;
input int      TakeProfit2_2     =   10;
input int      StopLoss2_2       =   400;
input int      TakeProfit3_2     =   10;
input int      StopLoss3_2       =   400;
extern int     magic_2=000014;
extern int     Distance_2= 10;
double  Level_2          = 0;
extern double  MaxDeviation_2=9;         // Max Deviation, points

bool RunOnce_2=false;
int last_order_check_2=false;
datetime EaStartTime_2=TimeCurrent();
double takeprofit1_2=TakeProfit1_2;
double stoploss1_2=StopLoss1_2;
double takeprofit2_2=TakeProfit2_2;
double stoploss2_2=StopLoss2_2;
double takeprofit3_2=TakeProfit3_2;
double stoploss3_2=StopLoss3_2;
int distance_2=Distance_2;

extern double  lots1_3          = 0.01;
extern double  lots2_3          = 0.02;
extern double  lots3_3          = 0.04;
input int      TakeProfit1_3     =   10;
input int      StopLoss1_3       =   400;
input int      TakeProfit2_3     =   10;
input int      StopLoss2_3       =   400;
input int      TakeProfit3_3     =   10;
input int      StopLoss3_3       =   400;
extern int     magic_3=000015;
extern int     Distance_3= 10;
double  Level_3          = 0;
extern double  MaxDeviation_3=9;         // Max Deviation, points
input int GlobalEATP=1; // Profit close in USD (should be positive value, 0=off)
bool RunOnce_3=false;
int last_order_check_3=false;
datetime EaStartTime_3=TimeCurrent();
double takeprofit1_3=TakeProfit1_3;
double stoploss1_3=StopLoss1_3;
double takeprofit2_3=TakeProfit2_3;
double stoploss2_3=StopLoss2_3;
double takeprofit3_3=TakeProfit3_3;
double stoploss3_3=StopLoss3_3;
int distance_3=Distance_3;
double profitCurrent=0;
string label_name="profit";
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer

   MathSrand(GetTickCount());
   if(Digits==5 || Digits==3)
     {
      takeprofit1_1  =TakeProfit1_1*10;
      stoploss1_1    =StopLoss1_1*10;
      takeprofit2_1  =TakeProfit2_1*10;
      stoploss2_1    =StopLoss2_1*10;
      takeprofit3_1  =TakeProfit3_1*10;
      stoploss3_1    =StopLoss3_1*10;
      takeprofit1_2=TakeProfit1_2*10;
      stoploss1_2    =StopLoss1_2*10;
      takeprofit2_2  =TakeProfit2_2*10;
      stoploss2_2    =StopLoss2_2*10;
      takeprofit3_2  =TakeProfit3_2*10;
      stoploss3_2    =StopLoss3_2*10;
      distance_2=Distance_2*10;
      takeprofit1_3=TakeProfit1_3*10;
      stoploss1_3    =StopLoss1_3*10;
      takeprofit2_3  =TakeProfit2_3*10;
      stoploss2_3    =StopLoss2_3*10;
      takeprofit3_3  =TakeProfit3_3*10;
      stoploss3_3    =StopLoss3_3*10;
      distance_3=Distance_3*10;
     }
   Level_2=Level_1+Point()*distance_2;
   Level_3=Level_1-Point()*distance_3;
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   OnTick_1();
   OnTick_2();
   OnTick_3();
   
   statisticEA();
   if(profitCurrent>=GlobalEATP && GlobalEATP>0)
      CloseAll();


  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick_1()
  {
   if(IsLastOrderClose(magic_1,EaStartTime_1))
     {
      OnInit();
      Print("Ea Closed Manually ");
      EaStartTime_1=TimeCurrent();
     }
   int ticet;
   int t=MathRand();
   double MA_Fast1,MA_Low1;
   if(CountVsego(magic_1)==0)
     {
      MA_Fast1=iMA(NULL,0,5,0,MODE_SMA,PRICE_TYPICAL,0);
      MA_Low1=iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,1);

      if(Counts(magic_1,EaStartTime_1,RunOnce_1)==0 && MA_Fast1>MA_Low1 && (RunOnce_1 || (Ask>=Level_1 && Ask<=Level_1+(MaxDeviation_1*_Point) && Level_1!=0)))
        {
         ticet=OrderSend(Symbol(),OP_BUY,lots1_1,Ask,3,Bid-stoploss1_1*Point,Ask+takeprofit1_1*Point,"1.1",magic_1,0,clrGreen);
        }

      if(Counts(magic_1,EaStartTime_1,RunOnce_1)==0 && MA_Fast1<MA_Low1 && (RunOnce_1 || (Bid<=Level_1 && Bid>=Level_1-(MaxDeviation_1*_Point) && Level_1!=0)))
        {
         ticet=OrderSend(Symbol(),OP_SELL,lots1_1,Bid,3,Ask+stoploss1_1*Point,Bid-takeprofit1_1*Point,"1.1",magic_1,0,clrRed);
        }

      if(Counts(magic_1,EaStartTime_1,RunOnce_1)==1)
        {
         if(getLastOrderCloseType(magic_1)==1) ticet=OrderSend(Symbol(),OP_BUY,lots2_1,Ask,3,Bid-stoploss2_1*Point,Ask+takeprofit2_1*Point,"1.2",magic_1,0,clrGreen);
         if(getLastOrderCloseType(magic_1)==0) ticet=OrderSend(Symbol(),OP_SELL,lots2_1,Bid,3,Ask+stoploss2_1*Point,Bid-takeprofit2_1*Point,"1.2",magic_1,0,clrRed);
        }

      if(Counts(magic_1,EaStartTime_1,RunOnce_1)==2)
        {
         if(getLastOrderCloseType(magic_1)==1) ticet=OrderSend(Symbol(),OP_BUY,lots3_1,Ask,3,Bid-stoploss3_1*Point,Ask+takeprofit3_1*Point,"1.3",magic_1,0,clrGreen);
         if(getLastOrderCloseType(magic_1)==0) ticet=OrderSend(Symbol(),OP_SELL,lots3_1,Bid,3,Ask+stoploss3_1*Point,Bid-takeprofit3_1*Point,"1.3",magic_1,0,clrRed);
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick_2()
  {
   if(IsLastOrderClose(magic_2,EaStartTime_2))
     {
      OnInit();
      Print("Ea Closed Manually ");
      EaStartTime_2=TimeCurrent();
     }
   int ticet;
   int t=MathRand();
   double MA_Fast1,MA_Low1;
   if(CountVsego(magic_2)==0)
     {
      MA_Fast1=iMA(NULL,0,5,0,MODE_SMA,PRICE_TYPICAL,0);
      MA_Low1=iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,1);
      if(Counts(magic_2,EaStartTime_2,RunOnce_2)==0 && MA_Fast1>MA_Low1 && (RunOnce_2 || (Ask>=Level_2 && Ask<=Level_2+(MaxDeviation_2*_Point) && Level_2!=0)))
        {
         ticet=OrderSend(Symbol(),OP_BUY,lots1_2,Ask,3,Bid-stoploss1_2*Point,Ask+takeprofit1_2*Point,"2.1",magic_2,0,clrGreen);
        }
      if(Counts(magic_2,EaStartTime_2,RunOnce_2)==0 && MA_Fast1<MA_Low1 && (RunOnce_2 || (Bid<=Level_2 && Bid>=Level_2-(MaxDeviation_2*_Point) && Level_2!=0)))
        {
         ticet=OrderSend(Symbol(),OP_SELL,lots1_2,Bid,3,Ask+stoploss1_2*Point,Bid-takeprofit1_2*Point,"2.1",magic_2,0,clrRed);
        }
      if(Counts(magic_2,EaStartTime_2,RunOnce_2)==1)
        {
         if(getLastOrderCloseType(magic_2)==1) ticet=OrderSend(Symbol(),OP_BUY,lots2_2,Ask,3,Bid-stoploss2_2*Point,Ask+takeprofit2_2*Point,"2.2",magic_2,0,clrGreen);
         if(getLastOrderCloseType(magic_2)==0) ticet=OrderSend(Symbol(),OP_SELL,lots2_2,Bid,3,Ask+stoploss2_2*Point,Bid-takeprofit2_2*Point,"2.2",magic_2,0,clrRed);
        }

      if(Counts(magic_2,EaStartTime_2,RunOnce_2)==2)
        {
         if(getLastOrderCloseType(magic_2)==1) ticet=OrderSend(Symbol(),OP_BUY,lots3_2,Ask,3,Bid-stoploss3_2*Point,Ask+takeprofit3_2*Point,"2.3",magic_2,0,clrGreen);
         if(getLastOrderCloseType(magic_2)==0) ticet=OrderSend(Symbol(),OP_SELL,lots3_2,Bid,3,Ask+stoploss3_2*Point,Bid-takeprofit3_2*Point,"2.3",magic_2,0,clrRed);
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick_3()
  {
   if(IsLastOrderClose(magic_3,EaStartTime_3))
     {
      OnInit();
      Print("Ea Closed Manually ");
      EaStartTime_3=TimeCurrent();
     }
   int ticet;
   int t=MathRand();
   double MA_Fast1,MA_Low1;
   if(CountVsego(magic_3)==0)
     {
      MA_Fast1=iMA( NULL,0,5, 0, MODE_SMA, PRICE_TYPICAL, 0); // áûñòðàÿ ÌÀ
      MA_Low1=iMA( NULL, 0, 14, 0, MODE_SMA, PRICE_CLOSE, 1); // ìåäëåííàÿ ÌÀ 
      if(Counts(magic_3,EaStartTime_3,RunOnce_3)==0 && MA_Fast1>MA_Low1 && (RunOnce_3 || (Ask>=Level_3 && Ask<=Level_3+(MaxDeviation_3*_Point) && Level_3!=0)))
        {
         ticet=OrderSend(Symbol(),OP_BUY,lots1_3,Ask,3,Bid-stoploss1_3*Point,Ask+takeprofit1_3*Point,"3.1",magic_3,0,clrGreen);
        }
      if(Counts(magic_3,EaStartTime_3,RunOnce_3)==0 && MA_Fast1<MA_Low1 && (RunOnce_3 || (Bid<=Level_3 && Bid>=Level_3-(MaxDeviation_3*_Point) && Level_3!=0)))
        {
         ticet=OrderSend(Symbol(),OP_SELL,lots1_3,Bid,3,Ask+stoploss1_3*Point,Bid-takeprofit1_3*Point,"3.1",magic_3,0,clrRed);
        }
      if(Counts(magic_3,EaStartTime_3,RunOnce_3)==1)
        {
         if(getLastOrderCloseType(magic_3)==1) ticet=OrderSend(Symbol(),OP_BUY,lots2_3,Ask,3,Bid-stoploss2_3*Point,Ask+takeprofit2_3*Point,"3.2",magic_3,0,clrGreen);
         if(getLastOrderCloseType(magic_3)==0) ticet=OrderSend(Symbol(),OP_SELL,lots2_3,Bid,3,Ask+stoploss2_3*Point,Bid-takeprofit2_3*Point,"3.2",magic_3,0,clrRed);
        }
      if(Counts(magic_3,EaStartTime_3,RunOnce_3)==2)
        {
         if(getLastOrderCloseType(magic_3)==1) ticet=OrderSend(Symbol(),OP_BUY,lots3_3,Ask,3,Bid-stoploss3_3*Point,Ask+takeprofit3_3*Point,"3.3",magic_3,0,clrGreen);
         if(getLastOrderCloseType(magic_3)==0) ticet=OrderSend(Symbol(),OP_SELL,lots3_3,Bid,3,Ask+stoploss3_3*Point,Bid-takeprofit3_3*Point,"3.3",magic_3,0,clrRed);
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int getLastOrderCloseType(int magic)
  {
   datetime t=0;
   int tick=-1;
   int i,total=OrdersHistoryTotal();
   for(i=0; i<total; i++)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic)
           {
            if(t<OrderCloseTime())
              {
               t=OrderCloseTime();
               tick=OrderTicket();
              }
           }
        }
     }

   for(i=0; i<total; i++)
     {
      if(OrderSelect(tick,SELECT_BY_TICKET))
        {
         return OrderType();
        }
     }

   return tick;
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountSELL(int magic)
  {
   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 magic)
  {
   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 Counts(int magic,datetime &EaStartTime,bool &RunOnce)
  {
   int count=0,i;

   for(i=OrdersHistoryTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderOpenTime()>=EaStartTime)
           {
            if(OrderProfit()<0)
              {
               if(count==0)
                 {
                  OnInit();
                  EaStartTime=TimeCurrent();
                  RunOnce=true;
                  return(count);
                 }
              }
            else
              {
               count++;
              }
           }
         if(count>2)
           {
            OnInit();
            EaStartTime=TimeCurrent();
            RunOnce=true;
            return(count);
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountVsego(int magic)
  {
   int Vsego;
   Vsego=CountBUY(magic)+CountSELL(magic);

   return(Vsego);
  }
//+------------------------------------------------------------------+
bool IsLastOrderClose(int magic,datetime &EaStartTime)
  {
   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 && OrderOpenTime()>=EaStartTime)
           {
          ---------------------------------------------------------------+


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(1092)
Projeler
1448
45%
Arabuluculuk
49
73% / 12%
Süresi dolmuş
36
2%
Serbest
2
Geliştirici 2
Derecelendirme
(365)
Projeler
412
36%
Arabuluculuk
35
26% / 57%
Süresi dolmuş
63
15%
Serbest
3
Geliştirici 3
Derecelendirme
(595)
Projeler
927
46%
Arabuluculuk
31
39% / 29%
Süresi dolmuş
93
10%
Çalışıyor
4
Geliştirici 4
Derecelendirme
(173)
Projeler
201
49%
Arabuluculuk
18
11% / 44%
Süresi dolmuş
1
0%
Serbest
5
Geliştirici 5
Derecelendirme
(620)
Projeler
680
57%
Arabuluculuk
25
16% / 60%
Süresi dolmuş
228
34%
Serbest
6
Geliştirici 6
Derecelendirme
(467)
Projeler
701
56%
Arabuluculuk
44
30% / 32%
Süresi dolmuş
114
16%
Çalışıyor
Benzer siparişler
Connect from Mt5 via binary deriv account api I have mt5 indicator, need to connect with binary deriv account through api. If anyone can setup via API then contact me. everything control mt5
Hello I am looking for a developer to create an 50% retracement Indicator of the previous candle . So once a candle close the Indicator is supposed to take the full candle size from high to low and make a 61% and 50% level on that candle and I would like the candle to show until the next previous candle is done creating. After this I would look to create an ea with it possibly
Hi, I have 2 indicators which are based on the super trend , the alerts on indicator (1) does not work at all , and on the other indicator the alerts do not come on time on time, which is kind of delayed. see attached file below
Looking for an experienced developer to modify my existing TDI strategy , want to add filter for Buy and Sell Signals, Arrows are displayed on chart and what only to leave high accurate arrows Source code to be provided
I have the mq5 file, I need a buffer adding to the indicator, so it appears in the data window so I can reference it later in an EA. As the below screenshot shows, there is a median ray line from yesterday (the dashed horizontal line) - I want this value in the data window called Median Ray. I want this to be a single value per day, so todays Median Ray would be 17868, and so on each day. So I want all the Developing
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to
I urgently require swift assistance to convert a complex indicator into a fully functional scanner, capable of automatically sending real-time data, alerts, and notifications via email, ensuring seamless integration and prompt delivery of critical information to facilitate informed decision-making and timely action
I need to improve the code of an indicator that is too heavy and slow when running and when used with iCustom in an EA. No other changes to the indicator are requested: the original features of the indicator should remain as theay are. I'll provide the indicator after job acceptance. I request final source code mq5 file. Thank you Regards
I have a mt5 indicator that is working perfectly but I will like to make it an expert advisor to have an automated trade. I will be glad if I can get a well experienced developer to execute this project. Thanks
O TRABALHO CONSISTE NA MUDANÇA DO HISTOGRAMA DO INDICADOR TREDN DIRECTION AND FORCE DSEMA SMOOTHED PARA O HISTOGRAMA DA FOTO ANEXA, OBEDECENDO AS TRES CORES VERDE (UP, VERMELHOR(DOWN) E CINZA(TREND). O MESMO TEM QUE ODECER O MESMO CALCULO E COLORIR DA MESMA FORMA POREM COM HISTOGRAMA DDE FORMATO DIFERENTE

Proje bilgisi

Bütçe
30+ USD
KDV (20%): 6 USD
Toplam: 36 USD
Geliştirici için
27 USD
Son teslim tarihi
to 2 gün