Trailing Stop

MQL4 Experts

Job finished

Execution time 19 hours
Feedback from employee
Thank you for your order.

Specification

I need a Trailing Stop that is based on the highest high or the lowest low after the order is opened. 

For the long trade, I need the trailing stop to move the stop loss price to the highest high price after the order is opened minus the 2 Average True Range. For the long trade, if the bar that the trade is entered is the highest bar (the system usually enters a trade at the opening of the bar) after the trade is entered, the trailing stop should include the bar that the trade is entered.  As for short trade, I need the trailing stop to move the stop loss price to the lowest low price after the order is opened plus the 2 Average True Range. For the short trade. if the bar that the trade is entered is the lowest bar (the system usually enters a trade at the opening of the bar) after the trade is entered, the trailing stop should include the bar that the trade is entered. 

To make this trailing stop more flexible, I need you to make number of ATRs as an input as well. 

The function should include the code attached. 

void AdjustTrail()
{

//buy order section
   for(int b=OrdersTotal()-1;b>=0;b--)
                {
      if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
         if(OrderMagicNumber()==MagicNumber)
            if(OrderSymbol()==Symbol())
               if(OrderType()==OP_BUY)
                   if(OrderStopLoss()< B_ATRStop)
                        {                                                                                               OrderModifyResult=OrderModify(OrderTicket(),OrderOpenPrice(),BATRStop,OrderTakeProfit(),0,Orange);
                        }
                }

for(int s=OrdersTotal()-1;s>=0;s--)
                {
      if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))
         if(OrderMagicNumber()==MagicNumber)
            if(OrderSymbol()==Symbol())
               if(OrderType()==OP_SELL)
                  if(OrderStopLoss()> S_ATRStop)
                        {                                                                       OrderModifyResult=OrderModify(OrderTicket(),OrderOpenPrice(),SATRStop,OrderTakeProfit(),0,Orange);
                        };
                }

If there is an error code in sending the order, the function should be able to resend the order 3 times with a 1sec pause in between. 






Responded

1
Developer 1
Rating
(584)
Projects
913
46%
Arbitration
31
39% / 29%
Overdue
93
10%
Loaded
2
Developer 2
Rating
(33)
Projects
35
40%
Arbitration
11
9% / 91%
Overdue
4
11%
Free
3
Developer 3
Rating
(487)
Projects
1013
58%
Arbitration
29
28% / 24%
Overdue
131
13%
Working
4
Developer 4
Rating
(277)
Projects
334
55%
Arbitration
14
36% / 29%
Overdue
1
0%
Free
Similar orders
I'm looking for an experienced MQL5 developer to create a script or Expert Advisor (EA) that can identify the requested price/order price, executed price, and slippage for any closed order in MT5. The script or EA should be able to: - Identify the requested price/order price for each order - Identify the executed price for each order - Calculate the slippage for each order (the difference between the requested price
Hi, I need to make an EA for use on MT5, on a simple strategy based on the High and Low of candles. Below is the strategy where I should be able to change the variables (number of candles, candle frequency, hours, multiplier, etc): Entry Long -------------------- Open Position = 0 AND CMP > Highest High of last 5 candles -------------------- Exit Long -------------------- Time > Entry Time + 5 hours AND CMP < Lowest
Hello, I have an EA working nice but I required some modification / additions in it. Addition / Modification! 1. EA must follow the Buy - Sell Arrow Alert indicator (copy of Arrow indicator attached) in combination of Heiken Ashi candles and Stochastic Oscillator Indicator to Buy / Sell orders 2. Placing X number of pending orders with an initial distance and proportional increase in distance and lot size. 3. Close
Hello am looking for someone that can you help me with fixing a custom indicator for me. I need the indicator buffer value fixing to work perfectly with EA. I think you understand the matter of the issue. Normally the indicator is good to give the signal. But based on the signal I can't get into the EA. Because of the buffer value working issue. Also some time it's doing issue to show the singnal when re-start the
Hello good programmers I need a robot that will be based on a trendline strategy using 3 timeframes to analyse the market 1 hour timeframe and 5min end with 1Min for entry
Hi, I would like to have some functionality of an existing trade manager amended, and some new functionality added in order to suit my needs. The existing trade manager is free, so there are no licensing issues to worry about. However, I only have the .ex4 file, so you would need to decompile it first. I have attached the file here for you to see. This original manager was written for the exact strategy I trade by
Hello, I'm looking for someone to build an EA that will copy trades from MT4 & 5 over to DX trade and Match Trader. If you already have one built even better, I'll buy it. Talk soon
Preciso de um replicador de ordens do mt5 para o profit. Não é necessário muita coisa no EA,preciso de: selecionar quantidade de contratos , copiar entradas e saídas, take e stop loss
Please see indicator to base the Expert on attached. Entry: 1. Enter a market buy order if the next candle breaks above the trigger candle 2. Enter a market sell order if the next candle breaks below trigger candle Only one entry for each trigger candle (i.e. if a buy is triggered, do not enter sell / if sell is triggered, do not enter buy) 3. Stop loss is the lowest price (for buys) or highest price (for sells) of
THE GOAL OF THIS PROJECT IS TO DEVELOP AN EXPERT ADVISOR THAT OPERATES AUTOMATICALLY DURING MARKET OPENING SESSIONS,FOCUS EN FOREX ,CRYPTOCURRENCIES ,STOCKS, AND GOLD. BELOW ARE THE SPECIFIC REQUIREMENTS the EA should be able to analyze the 20 period and 200 period moving averages as part of its entry and exit estategy implementation of an order blockis required to allow the EA to open and close positions efficiently

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
to 1 day(s)