Partial Lot Size Close at Floating Loss

Auftrag beendet

Ausführungszeit 17 Stunden
Bewertung des Kunden
Very prompt in replying and making fixes. I recommend this developer to anyone
Bewertung des Entwicklers
Nice Customer.. thx bro..

Spezifikation

Hello , I need to Modify an expert advisor (Trade Manager for other EAs) to add new functionality :

1) Partial Lot Size Close at Floating Loss Amount:

  • Close % Partial Lot-size if Loss reached a defined amount (Note: Closing Priority will lead it the orders orders being closed first)
  • Close All Modify Take Profit of Remaining Lots to Breakeven (Dollar profit of Zero when taking into account Commission)

BONUS: For the Advanced Coders, I am willing to increase my budget if you are able to achieve the configuration that is shown in the Screenshot "Part 2"  . I can elaborate on this more, if you are interested/able to achieve this request.


This will require the following adjustment, modify the Magic Number the Open Orders so that the EA is able to manage them.

Here is an example of some source code that is able to achieve this, however it is not viable for my EA as it modifies the take profit of individuals orders and not the weighted average lot size of the orders for a specific symbol within a sequence.

void OnTick()
{
        for ( int z = OrdersTotal() - 1; z >= 0; z -- )
        {
                if ( !OrderSelect( z, SELECT_BY_POS, MODE_TRADES ) )
                {
                        Print( "OrderSelect( ", z, ", SELECT_BY_POS, MODE_TRADES ) - Error #", GetLastError() );
                        continue;
                }
                if ( MagicNumber != -1 && OrderMagicNumber() != MagicNumber ) continue;
                if ( OnlyCurrentSymbol && OrderSymbol() != _Symbol ) continue;

                int D = getDigits( OrderSymbol() );
                double P = getPoint( OrderSymbol() );

                if ( TakeProfit_B > 0.0 && OrderType() == OP_BUY )
                {
                        double correct_tp = NormalizeDouble( OrderOpenPrice() + TakeProfit_B*P, D );
                        if ( fabs( OrderTakeProfit() - correct_tp ) > P/20.0 && !AlreadyModified() )
                        {
                                Print( "Modifying TP of buy-order #", OrderTicket(), " (", 
                                                        DoubleToString( OrderTakeProfit(), D ), " -> ", DoubleToString( correct_tp, D ), ")..." );
                                if ( !OrderModify( OrderTicket(), OrderOpenPrice(), OrderStopLoss(), correct_tp, 0 ) )
                                        Print( "OrderModify failed with error #", GetLastError(), "!" );
                                else
                                        OrderSave();
                        }
                }
                if ( TakeProfit_S > 0.0 && OrderType() == OP_SELL )
                {
                        double correct_tp = NormalizeDouble( OrderOpenPrice() - TakeProfit_S*P, D );
                        if ( fabs( OrderTakeProfit() - correct_tp ) > P/20.0 && !AlreadyModified() )
                        {
                                Print( "Modifying TP of sell-order #", OrderTicket(), " (", 
                                                        DoubleToString( OrderTakeProfit(), D ), " -> ", DoubleToString( correct_tp, D ), ")..." );
                                if ( !OrderModify( OrderTicket(), OrderOpenPrice(), OrderStopLoss(), correct_tp, 0 ) )
                                        Print( "OrderModify failed with error #", GetLastError(), "!" );
                                else
                                        OrderSave();
                        }
                }
        }
}

As a result you may want to use some snippets from this code:

   void ModifyTP(int m)
{
   int i,r;
   double tpnya,dtp,bbep,sbep,ssize,bsize;
   tpnya=0;dtp=0;bbep=0;sbep=0;ssize=0;bsize=0;
   for (i=0; i<OrdersTotal();i++) 
   { 
      if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
      if (OrderSymbol() != Symbol()|| OrderMagicNumber() != MagicNumber || OrderType()!=m) continue;
         tpnya=OrderTakeProfit();
         if (m==0) {bbep += OrderOpenPrice()*OrderLots(); bsize= bsize+OrderLots();}
         if (m==1) {sbep += OrderOpenPrice()*OrderLots(); ssize= ssize+OrderLots();}
               
   }
   if (bbep>0) { bbep/=bsize; tpnya=NormalizeDouble(bbep + TP*pt,Digits); }
   if (sbep>0) { sbep/=ssize; tpnya=NormalizeDouble(sbep - TP*pt,Digits); }
      
   for (i=OrdersTotal()-1; i>=0; i--) 
   {
      if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
      if(OrderSymbol() != Symbol()|| OrderMagicNumber() != MagicNumber|| OrderType()!=m) continue;
         dtp=OrderTakeProfit();
         //if (m==0) {bbep += OrderOpenPrice()*OrderLots(); bsize= bsize+OrderLots();}
         //if (m==1) {sbep += OrderOpenPrice()*OrderLots(); ssize= bsize+OrderLots();}
         Print("tpnya",tpnya,": ",i);
         Print("dtp",dtp,": ",i);
         if( MathAbs(tpnya-dtp)>=pt &&  OrderType()==m)
         r  =  OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), tpnya, 0, CLR_NONE); 
   }
   //if (bbep>0) bbep/=bsize; dtp=bbep;
   //if (sbep>0) sbep/=ssize; dtp=sbep;  
}
   

The key inputs would be as follows:

input    string      CHART_MANAGEMNET1= "====== Trade Managerment ======";
input    string      symbol1          = "EURUSD";    // Symbol //Symbol that the modification would occur for
int                     MagicNumber                                             = -1;                           // * MagicNumber (-1 - modify all) - this is the magic number that the EA would change the Open Orders to
input double      TakeProfit           = 0.0;         //Breakeven amount in dollars (excluding commission) - this would be the modification amount in dollars taking into account commision (Note: I don't want pips as I will use this on other symbols that are not just forex)
^//Forgot to add this 

input double      PartialClose           = .3;         //Partial close percentage of lots when floating loss is reached on symbol 

EXAMPLE 1:

extern bool Partial_Close= true;

IF_LOSS = -500  ( $ )

{

Close 30% of Symbol in Loss 

Modify Take Profit to breakeven in dollars (taking into account Commission)

}





Dateien:

PNG
Part_1.PNG
78.0 Kb
PNG
Part_2.PNG
99.5 Kb

Bewerbungen

1
Entwickler 1
Bewertung
(600)
Projekte
935
46%
Schlichtung
31
39% / 29%
Frist nicht eingehalten
93
10%
Frei
2
Entwickler 2
Bewertung
(120)
Projekte
159
49%
Schlichtung
15
53% / 27%
Frist nicht eingehalten
4
3%
Frei
3
Entwickler 3
Bewertung
(298)
Projekte
427
26%
Schlichtung
18
61% / 33%
Frist nicht eingehalten
26
6%
Frei
4
Entwickler 4
Bewertung
(10)
Projekte
17
24%
Schlichtung
3
67% / 33%
Frist nicht eingehalten
2
12%
Frei
5
Entwickler 5
Bewertung
(9)
Projekte
4
0%
Schlichtung
11
0% / 82%
Frist nicht eingehalten
0
Frei
6
Entwickler 6
Bewertung
(325)
Projekte
411
22%
Schlichtung
44
61% / 23%
Frist nicht eingehalten
48
12%
Arbeitet
7
Entwickler 7
Bewertung
(1)
Projekte
1
0%
Schlichtung
1
0% / 0%
Frist nicht eingehalten
0
Frei
8
Entwickler 8
Bewertung
(261)
Projekte
427
38%
Schlichtung
86
44% / 19%
Frist nicht eingehalten
71
17%
Beschäftigt
Ähnliche Aufträge
Fintech robots 30+ USD
Specification I need a grid ea that puts buy stops and sell stops on the chart (only stops no limits). See image Example: if the price moves up filling the buy stops. The ea should place new sell stops below the price for the set parameters. And vice versa. Also if price moves up it should place new buy stops above the last buy stop. So if the parameter is set to 50 buy stops. There should always be 50 buy stops in
Develop a multi-strategies EA that makes entries based on selectable indicator-based criteria. Each can be toggled on/off, and trades can also be placed using a selectable combination of signals. Each trade position shall be entered on the bar and managed as a modified martingale. Position management will include partial close, variable grid increase as grid number increases, News stops, and a Dashboard for manual
Hello, In need an expert advisor that can copy my CFD (GBPUSD) into Futures 6B, along with AUDUSD. & that whenever I close the position, it closes it aswell. Also if there is limited broker API access, I don't mind getting a broker recommendation
I need an EA that opens trades according to the crossover of Moving Averages. The EA is based on two Moving Averages MA1 and MA2: For every new candle the EA attempts to open a new position, according to the MA crossover direction: If MA1>MA2, open a BUY position If MA1<MA2, open a SELL position There is a limit for current open trades which is also set in the settings. If the number of open trades reaches that
The job is simple, I want a custom indicator which consist of a combination of 3 indicators in separate window as I will show you in the screenshot of my mt5 trading platform. The indicators are RSI(period 14, Apply to close) Level 10 Buy, Level 50 Take profit, level 90 Sell) MA( Period 200, Method Exponential, Apply to Median price, Shift 0) BB (Period 25, Apply to close, Deviation 0.035, Shift 0) Ideally on a 1
the code wasn't mine, i have got it somewhere on the web, but i like the performance of the EA, so i want to use it on mt5 platform. the given code based on price movements with ladder entry concept
Good Day I would like to order a trading robot. Pairs: XAUUSD (GOLD) EUR/USD USD/JPY The robot should be trading daily with TP/SL build in, would like to have trailing and stop loss, should execute up to 5 trades (preffarable setting choice) up to 10 trades Los sizes to be choise setting, must also trade major US vews events Like:US- PPI, CPI, NFP, Sales m/m and so on Must also show/display alert when opening
Hello Guys, I need a trading bot for the MT5 to place order based on my trading strategy which is based on - >> entry based on EMA with rejection from specific levels like support and resistance area - levels and time frame i will apply into the robot manually on daily basis. also need - trailing stoploss , shift to breakeven after gaining some points. need a highly expert developer
I have a full strategy based on indicator and candle based on . i would like to make it into a robot which will trade for me on a specific time and specific rules. i need a person who can do this project for me. If you have done this type of job . you are most welcome for this. Apply only if you know binary trading option and binomo trading platform well and how it works
I want to make AI based on Attached Picture Swing High low. If you have experience can share demo first. Stop loss, take profit, trailing , break even ,DD etc. also amiable

Projektdetails

Budget
30 - 60 USD
Für die Entwickler
27 - 54 USD
Ausführungsfristen
von 1 bis 3 Tag(e)