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
(618)
Projekte
968
46%
Schlichtung
32
38% / 34%
Frist nicht eingehalten
96
10%
Frei
Veröffentlicht: 6 Beispiele
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
Veröffentlicht: 8 Beispiele
4
Entwickler 4
Bewertung
(11)
Projekte
18
28%
Schlichtung
3
67% / 33%
Frist nicht eingehalten
1
6%
Frei
5
Entwickler 5
Bewertung
(10)
Projekte
4
0%
Schlichtung
11
0% / 82%
Frist nicht eingehalten
0
Frei
6
Entwickler 6
Bewertung
(368)
Projekte
472
24%
Schlichtung
52
60% / 19%
Frist nicht eingehalten
53
11%
Überlastet
7
Entwickler 7
Bewertung
(1)
Projekte
1
0%
Schlichtung
1
0% / 0%
Frist nicht eingehalten
0
Frei
8
Entwickler 8
Bewertung
(284)
Projekte
459
39%
Schlichtung
94
44% / 18%
Frist nicht eingehalten
73
16%
Beschäftigt
Veröffentlicht: 2 Beispiele
Ähnliche Aufträge
I'm looking to acquire a ready-made, consistently profitable Expert Advisor (EA) for MetaTrader 5 (MT5). The EA should be well-tested in both backtesting and live trading conditions and based on a clear, logical trading strategy (not a black box). I'm open to a variety of strategies as long as they are stable, explainable, and show consistent results
I am looking for a profitable trading bot (Expert Advisor) for MT5. The bot should have: Consistent performance with proven backtest and preferably live results Strong risk and money management features Easy setup and user-friendly inputs Please share your proposals with details and pricing
Hello, I am looking for an experienced QuantConnect/Lean developer for a trading strategy project on futures (Micro Nasdaq – MNQ) with Interactive Brokers integration (paper + live). The strategy includes several key features: • Multi-timeframe analysis (signal validation across multiple horizons) • Integration of economic news/events into the trading logic • Advanced risk management (daily stop, position sizing
I'm looking for an experienced MQL5 developer and trader to assist with the refinement, backtesting, and live trading optimization of a custom Expert Advisor (EA). The EA is based on a pure breakout strategy on XAUUSD. The main goals are: 1. Compile and straighten the code – ensure error-free, optimized, and professional coding standards. 2. Run and set up backtesting – produce results with gradual positive
The EA will have 3 moving average and trade are executed upon cross over.The EA will finally be in MQL4 and MQL5. The EA will also be protected with a password. Further description will be given after agreement
I need a good programmer who will build a forex EA with exact specifications. The EA parameters should be easily activated by on/off clicks... It's so multiple timeframe filters, monthly, weekly, daily and a H4 entry. Using Moving averages, RSI, %R, and candlestick ranges
Technical Skills: - Programming Languages: Proficiency in low-latency programming languages like C++ is crucial for developing high-speed trading algorithms. - Algorithmic Trading: Experience with algorithmic trading strategies, including market making, statistical arbitrage, and trend following. - Market Data Analysis: Ability to analyze large datasets and extract meaningful insights to inform trading decisions
I need a trading robot expert advisors/EA on MQL5. With the following strategies. Trend Following and Mean Reversion/Scalping and Range Trading* 1. *Trend Following and Mean Reversion*: Capture trends and profit from mean reversion opportunities. 2. *Scalping and Range Trading*: Profit from short-term price movements and range-bound opportunities. *Trend Following and Mean Reversion* - *Indicators:* - Moving
Hi guys Does anyone have experience with K-Means and MQL5? I would like to get an include file which I can use in my EAs. I would need to work with an ML Engineer who has deep understanding with K-Means. The include file should be used for regime detection. I can drop more information about my EA once I see that you qualify for the job :-) Cheers
Please translate the FX Blue copy trading EA into Chinese EA. Additionally, the software must centrally manage newly installed and uninstalled MT4/MT5 platform directories to uniformly manage the association between multi-terminal login trading accounts and copy trading accounts. Existing program solutions are preferred; candidates with relevant project development experience will be given priority consideration

Projektdetails

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