Modify existing trailing stop snipet

MQL4 Indicadores Asesores Expertos

Trabajo finalizado

Plazo de ejecución 1 hora
Comentario del Cliente
Thanks for the fast and well done job! I will happily work again with you!
Comentario del Ejecutor
old customer nice to meet again :)

Tarea técnica

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


Han respondido

1
Desarrollador 1
Evaluación
(2)
Proyectos
4
25%
Arbitraje
2
50% / 50%
Caducado
1
25%
Trabaja
2
Desarrollador 2
Evaluación
(37)
Proyectos
66
23%
Arbitraje
10
0% / 60%
Caducado
18
27%
Libre
3
Desarrollador 3
Evaluación
(356)
Proyectos
632
26%
Arbitraje
89
73% / 13%
Caducado
12
2%
Libre
4
Desarrollador 4
Evaluación
(71)
Proyectos
97
43%
Arbitraje
2
50% / 0%
Caducado
2
2%
Libre
5
Desarrollador 5
Evaluación
(470)
Proyectos
706
56%
Arbitraje
45
31% / 31%
Caducado
115
16%
Trabaja
Solicitudes similares
I have simple EA i want to modify its parameters. If you are good at modifying EAs contact me for more details. I will issue the source code then you return after finishing without changing the buy or sell conditions
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
* Advanced level dev only, NDA required * Hi, I have a multi timeframe, multiindicator expert that requires additional features added to it. First started development 5 years ago. Upgrading with new features. To be added Entry - Add Stochastic and CCI options for trade entry to be added to existing signal options. Add config options to existing menu Bulk Exit - Master switch for close all trades based on basket
I am developing a master EA that integrates several sub-EAs. The project is complex, and the documentation is thoroughly structured, spanning 50 pages with detailed step-by-step procedures. 1st sub-EA: This EA opens trades without using indicators. Instead, it opens a new trade based on the color or status of the last candle. For instance, if the last candle was green, a new buy trade is opened. 2nd sub-EA: This EA
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
Trade Manger EA 30+ USD
Hello Programmer! I am looking to build an EA that will place my trade and manage it. Once i have manually found my setup, I will want an EA to open the trade, set the R:R and manage it according to my specifications. please take a look at the attached to get an Idea of what I would like. I will require the source code once completed
Hello there i need someone who will create a robot that will calculate the movement between buy/sell and show where to take profit the robot should work with all currency and indices including stock
EA to send account history to web request. It should send every 5 mins or when there is an update. It then sends the json to a web request where gain, drawdown, balance, equity will be displayed
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

Información sobre el proyecto

Presupuesto
30+ USD
IVA (19%): 5.7 USD
Total: 35.7 USD
Para el ejecutor
27 USD
Plazo límite de ejecución
de 1 a 2 día(s)