Modify existing trailing stop snipet

MQL4 Indicadores Experts

Trabalho concluído

Tempo de execução 1 hora
Comentário do cliente
Thanks for the fast and well done job! I will happily work again with you!
Comentário do desenvolvedor
old customer nice to meet again :)

Termos de Referência

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


Respondido

1
Desenvolvedor 1
Classificação
(2)
Projetos
4
25%
Arbitragem
2
50% / 50%
Expirado
1
25%
Trabalhando
2
Desenvolvedor 2
Classificação
(35)
Projetos
64
22%
Arbitragem
10
0% / 60%
Expirado
18
28%
Livre
3
Desenvolvedor 3
Classificação
(356)
Projetos
632
26%
Arbitragem
89
73% / 13%
Expirado
12
2%
Livre
4
Desenvolvedor 4
Classificação
(71)
Projetos
97
43%
Arbitragem
2
50% / 0%
Expirado
2
2%
Livre
5
Desenvolvedor 5
Classificação
(466)
Projetos
697
56%
Arbitragem
43
30% / 33%
Expirado
113
16%
Trabalhando
Pedidos semelhantes
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

Informações sobre o projeto

Orçamento
30+ USD
IVA (19%): 5.7 USD
Total: 35.7 USD
Desenvolvedor
27 USD
Prazo
de 1 para 2 dias