Need a function Equity target

仕事が完了した

実行時間3 時間
開発者からのフィードバック
Good Customer
依頼者からのフィードバック
Exellent work, super and fast thank you I recomande :)

指定

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)
           {
          ---------------------------------------------------------------+


応答済み

1
開発者 1
評価
(1086)
プロジェクト
1437
45%
仲裁
48
73% / 13%
期限切れ
35
2%
仕事中
2
開発者 2
評価
(365)
プロジェクト
412
36%
仲裁
35
26% / 57%
期限切れ
63
15%
3
開発者 3
評価
(586)
プロジェクト
918
46%
仲裁
31
39% / 29%
期限切れ
93
10%
4
開発者 4
評価
(173)
プロジェクト
201
49%
仲裁
18
11% / 44%
期限切れ
1
0%
5
開発者 5
評価
(620)
プロジェクト
680
57%
仲裁
25
16% / 60%
期限切れ
228
34%
6
開発者 6
評価
(466)
プロジェクト
697
56%
仲裁
43
30% / 33%
期限切れ
113
16%
仕事中
類似した注文
Trading bot 300+ USD
We need bot that trades when medium and low impact news hits It will release pending order both directions few min prior to news impact And will have certain risk management strategy attached Example If Monday and Tuesday news successful clears profits It will reduce risk for next news events until new week starts each week message on tg: Dstatewealthtrading NOTE: 4 YAERS OF EXPERIENCE UPWORD, YOU MUST BE A
I need someone the create a supertrend indicator based on Heikin Ashi candles instead of normal candles. Needs to be exactly the same as the supertrend (original one) + ha from tradingview. In m1,m5,m15 the indicator must have the same values ​​found with the tradingview. Work that meets this requirement will be accepted ( depending on the broker and spread, however, a few pips of difference will be accepted)
Here is a detailed instruction for the coder to implement the vertical lines based on the BrainTrainSignalAlert indicator: --- **Task: Implement Vertical Lines for Alerts from BrainTrainSignalAlert Indicator** **Objective:** Create a system that adds vertical lines on specified timeframes (M5 or M30) whenever an alert is generated by the BrainTrainSignalAlert indicator on the H1, H4, and D1 timeframes. The lines
Hello Guys! I want to modify/fix the indicator that uses sequential type of entries (it calculates from 1 to 9) and if the conditions are met it provides an arrow (signal) with alert. The problem is that, sometimes (for unknown for me reasons) it repaints arrow signal. Like on the picture: Signal 1 - correct signal Signal 2 - correct signal Signal 3 - correct signal Signal 4 - repaints (signal 3 arrow dissapeared
Hi, I have a Live Data feature for my trading accounts that lets me check details like total open positions, number of lots, profits, etc. I need someone to add the number of pending orders to this live data. This is important for me to ensure that all accounts have the same number of pending orders, since I use a copy trading system. Also, there is a website where I check all the data. In this case, you would need
Hello, i am searching for an experienced, professional software engineer, who can convert three Indicators from MQL4 to MQL5. This may sound like an easy job, but one indicator is like a trading system and therefore a bit complex. So you need to have a very good understanding of both languages. You should also be able to code MQL5 classes ( https://www.mql5.com/en/docs/basis/oop ). The intention is to code MQL5
I came across an indicator that's perfectly good in catching spikes in boom amd crash but i would want it to be modified and to improve accuracy As a professional you will have to go through the indicator and explain to me the strategy with which the indicator was buid and tell me the possibility of improving it better
An EA that executes when the 21 and 55 SMA Cross on certain time frame also the EA will understand supply and demand levels and executes when price reacts on this levels specified and target/stoploss levels will be predetermined...also the robot will also comprise stochastic oscillator
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
Starting from scratch, I need a solution to develop my own crypto trading and exchange platform. This platform should compare prices across various exchanges like Coinbase, Binance, KuCoin, and Unocoin, as well as different cryptocurrencies. The solution must identify opportunities to buy on one platform and sell on another for a profit, transferring funds to my personal wallet instantly for security. The bot should

プロジェクト情報

予算
30+ USD
VAT(付加価値税) (20%): 6 USD
合計: 36 USD
開発者用
27 USD
締め切り
最高 2 日