Modify existing trailing stop snipet

MQL4 Indicateurs Experts

Tâche terminée

Temps d'exécution 1 heure
Commentaires du client
Thanks for the fast and well done job! I will happily work again with you!
Commentaires de l'employé
old customer nice to meet again :)

Spécifications

Hello, 

I am looking for a programmer who can modify an existing code for trailing SL (below you see the example for sell trades).

This code will add a trailing SL if a certain price has reached (see yellow part of code)

      if ( nsell(Magic1)>0 )
        {
         for(int j=0;j<OrdersTotal();j++)
           {
            if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES))
              {
               if(OrderType()==1 && OrderSymbol()==Symbol() && OrderMagicNumber()==Magic1)
                 {
                  double _commission=(OrderCommission()*-1/OrderLots()/MarketInfo(Symbol(),MODE_TICKVALUE)*MarketInfo(Symbol(),MODE_TICKSIZE));
                  double _trailmove=(Trail_Start*point);
                  double _spreadmove=((Trail_Start+MarketInfo(Symbol(),MODE_SPREAD))*point);
                  double _minmove=MathMax(_trailmove,_spreadmove);
                  double _totalmove=NormalizeDouble((_commission+_minmove),5);
                  if ( (OrderStopLoss()>Close[0]+(Trail_Start+Trail_Steps)*point || OrderStopLoss()==0) 
                    && (OrderOpenPrice()-Close[0])>=(_minmove) )
                    {
                     bool sb=OrderModify(OrderTicket(),OrderOpenPrice(),Close[0]+(_totalmove),OrderTakeProfit(),0,clrMagenta);
                     if(sb)
                       {
                          hsb=Close[0]+(_minmove);
                          Print("Move TSL Sell "+StringSubstr((string) _totalmove,0,6)+" pips");
                        }
                    }
                 }
              }
           }
        }
     }

Right now the code will only add the SL to sell trades which have:

(OrderOpenPrice()-Close[0])>=(_minmove)


The code should be changed so the same SL will added to all open sell trades, so they will be closed at the same time when SL is hit (basket close). 

Please understand that this is just the snipet for the trailing stop function.


If you have questions then dont hesitate to ask me.


Kind regards,

silverchair


Répondu

1
Développeur 1
Évaluation
(2)
Projets
4
25%
Arbitrage
2
50% / 50%
En retard
1
25%
Travail
2
Développeur 2
Évaluation
(35)
Projets
64
22%
Arbitrage
10
0% / 60%
En retard
18
28%
Gratuit
3
Développeur 3
Évaluation
(356)
Projets
632
26%
Arbitrage
89
73% / 13%
En retard
12
2%
Gratuit
4
Développeur 4
Évaluation
(71)
Projets
97
43%
Arbitrage
2
50% / 0%
En retard
2
2%
Gratuit
5
Développeur 5
Évaluation
(466)
Projets
697
56%
Arbitrage
43
30% / 33%
En retard
113
16%
Travail
Commandes similaires
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it
Hello, I have an indicator from a friend and I'd like to replicate it on my own TradingView or MT5 platform. Could you assist me with that?. Here is the link
so basically I have an EA(mql5), AI script(python), flask server and socket server both on python. Now this is an experimental script as I am trying to learn. However the EA is not entering any trades. How much would it cost for you to troubleshoot this for me? Thank you in advance
NEW FUNCTION 50+ USD
La idea es la siguiente, sería un EA semi automático. Yo como trader opero en zonas. En adelante las vamos a denominar ``zonas calientes´´. El EA debe que necesito debe operar conforme a 4 zonas calientes que yo configure en el mismo. ¿Qué hará el EA en cada una de esas zonas calientes que yo he configurado? En cada una de estas zonas el EA debe realizar hedging (crear un rango en el cual el EA entrara en sell o en
I have the bot just over half made, from another developer who let me down and decided they no longer wished to finish the project, so I have a basic example of the fundamentals of what it could look like, although multiple functions I require do not work, but I can show this to you on request. There are multiple features that I require, so please read the in depth requirement sheet on the attachment. Function: To

Informations sur le projet

Budget
30+ USD
TVA (19%): 5.7 USD
Total: 35.7 USD
Pour le développeur
27 USD
Délais
de 1 à 2 jour(s)