Partial Lot Size Close at Floating Loss

작업 종료됨

실행 시간 17 시간
고객의 피드백
Very prompt in replying and making fixes. I recommend this developer to anyone
피고용인의 피드백
Nice Customer.. thx bro..

명시

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)

}





파일:

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

응답함

1
개발자 1
등급
(616)
프로젝트
963
46%
중재
31
39% / 32%
기한 초과
96
10%
무료
게재됨: 6 코드
2
개발자 2
등급
(120)
프로젝트
159
49%
중재
15
53% / 27%
기한 초과
4
3%
무료
3
개발자 3
등급
(298)
프로젝트
427
26%
중재
18
61% / 33%
기한 초과
26
6%
무료
게재됨: 8 코드
4
개발자 4
등급
(11)
프로젝트
18
28%
중재
3
67% / 33%
기한 초과
1
6%
무료
5
개발자 5
등급
(10)
프로젝트
4
0%
중재
11
0% / 82%
기한 초과
0
무료
6
개발자 6
등급
(366)
프로젝트
465
23%
중재
50
60% / 20%
기한 초과
52
11%
바쁜
7
개발자 7
등급
(1)
프로젝트
1
0%
중재
1
0% / 0%
기한 초과
0
무료
8
개발자 8
등급
(284)
프로젝트
458
39%
중재
93
44% / 18%
기한 초과
72
16%
로드됨
게재됨: 2 코드
비슷한 주문
I am looking for big dogs -- no puppies to assist with my upcoming project, which involves two files that require minor modifications. The project includes approximately 30 different input options, most of which will need copying, pasting, and minor adjustments. To help track progress, there will be checkboxes to check off and navigate through the specifications more easily as you progress and getting things done. I
THE STUDY : Add 4 study overlay in the input settings and color bar based on alert condition is sg1=1 I want it to trail the order instead of flat to avoid too much slippage What I do is the 15-Minutes chart I have filter also in the 10tick chart if those filters are meet the bar is green or red using sierrachar color bar based on alert condition I overlay the 4 in the study in the 6tick Renko chart that will
I am looking for a MetaTrader 4 (MT4) developer to create a scalping-based Expert Advisor (EA) for the US30 index. The EA will be based on pending orders with trend filtering and equity-based risk management. It should include virtual SL/TP, support multiple pending orders, and be optimized for high-volatility sessions. Only experienced developers with proven MT4 EA development should apply
want an aggressive scalping Expert Advisor (EA) for XAUUSD (Gold) on M1 timeframe with the following features: ✅ Uses a combination of EMA, RSI, and ATR for entry signals. ✅ Recovery Mode to increase lot size on confirmed setups to recover losses safely. ✅ Trailing Stop functionality with adjustable start and step parameters. ✅ Stop trading after daily target or daily loss limit is reached. ✅ Money Management (fixed
I want you to build an Expert Advisor (EA) that mirrors trades between two accounts in opposite directions , maintaining identical TP and SL distances in pips with adjustable lot sizes. The EA logic is as follows: ✅ Core Requirements • EA monitors trades opened on Account A . • When a trade is opened on Account A: • An opposite direction trade is opened on Account B . • The TP and SL distances (in pips) are
Create a ZigZag indicator, which is constructed based on extreme values determined using oscillators. It can use any classical normalized oscillator, which has overbought and oversold zones. The algorithm should first be executed with the WPR indicator, then similarly add the possibility to draw a zigzag using the following indicators
What I Need I'm looking for solid MQL4/5 and Pine Script developers for ongoing projects. No agencies, no middlemen - just skilled devs who know their stuff. The Deal ~5 projects per month to start Fair pay - I don't lowball good work Per-project rates - we'll agree on price upfront You Should Know MQL4/5 programming (EAs, indicators, scripts) Pine Script for TradingView How trading actually works How to write clean
Hello! I've been working on a strategy that uses Ninzarenko candles from ninza.co, and while I am making incremental progress, i think I need someone to get me 100% across the finish line. This is a simple standard deviation strategy, take a look at the screenshot and see if this is something you think we can do together. Basic requirements below .. . let me know if you have any questions! Goal of the Strategy Trade
Strategy Purpose: Place a trade immediately at the close of a Renko candle or wait for close of 1 st, 2nd or 3rd renko candle (user defined) when color changes (trend reversal) for placing entry, with a confirmation that previous trend had at least 1, 2 (user defined) number of continues same-color bricks. User Inputs (Customizable Parameters): 1. EntryOnCandlenumber = 1 o Enter on 1st, 2nd, 3rd or same-color candle
I am looking for an experienced Expert Advisor (EA) developer who specializes in building AI-powered trading bots for MetaTrader 5. This is not a traditional indicator-based EA—we are seeking a solution that uses artificial intelligence to make dynamic trading decisions based on real market conditions. 💡 Project Overview: We want to develop a fully autonomous EA that leverages AI/machine learning to analyze: Price

프로젝트 정보

예산
30 - 60 USD
개발자에게
27 - 54 USD
기한
에서 1  3 일