Trailing Stop

MQL4 Experts

Tâche terminée

Temps d'exécution 19 heures
Commentaires de l'employé
Thank you for your order.

Spécifications

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. 






Répondu

1
Développeur 1
Évaluation
(584)
Projets
915
46%
Arbitrage
31
39% / 29%
En retard
93
10%
Travail
2
Développeur 2
Évaluation
(33)
Projets
35
40%
Arbitrage
11
9% / 91%
En retard
4
11%
Gratuit
3
Développeur 3
Évaluation
(488)
Projets
1014
58%
Arbitrage
29
28% / 24%
En retard
131
13%
Travail
4
Développeur 4
Évaluation
(277)
Projets
334
55%
Arbitrage
14
36% / 29%
En retard
1
0%
Gratuit
Commandes similaires
Hello everyone, I need a simple Hedging EA that won't open opposing trades right away. The key is to avoid Hedging with the aim to lock in a price/spread arbitrage. If you already have a profitable EA that is similar and that has result I would be more than welcome to take a look at it or if you can build one for me I am more than welcome to pay for it. It must be an MT5 EA
Spike EA 41+ USD
Hi coder in the house i need an experience coder who can make two indicators into EA The ea will open on joint signal and also on single indicator signal details of open order strategy and closing will be discussed inside THE ea will have able to work on all asset on mt5 platform, Money Mgt/Manual Lot size, Auto Stop lot etc Trailing , Breakeven and profit locked and partial close etc Trading Days, and others feature
Must have no pending jobs Must work in the Eastern Standard Time Zone Must clearly and fluently SPEAK english Must can provided coding and consultative experience Must code in MQL4 Must adjust my EA without any bugs. This is a time sensitive matter, Subject: Seeking Experienced MQL4 Developer for Expert Advisor Hello, I am currently in the process of developing an Expert Advisor (EA) for MT4 and am seeking a skilled
Temple EA 30 - 50 USD
The goal of this project is to catch positions which are moving in the right direction, while locking / hedging the ones that do not. Positions are only opened when price has been moving according to the predominant trend, and wins are used to buy down existing locked positions as required. Please see the attached files for full explanation
Hi there, I need a profitable MT5 trading robot with confirmed profitable results. It can be for any major pair, I just need a profitable bot, on autopilot. If you have a profitable bot, please contact me. And if possible, will need to test it for sometime before I purchase it. Thanks
Make a horizontal line for the following. Opening candle ( Keep a solid line across the entire chart for the day. Sessions Opening candle ( Keep a solid line across just the time frame specified only. Then when it restarts, start a new line) 15 mins 30 mins 1 hr 4 hr Daily Weekly Monthly Example —————————————————————————————————————— Entries Order Type Buy Sell Both Set a pip count for entry. Example Long
Need an expert to create an EA based on my strategy for any broker,fast execution of opening and closing trade,also with a condition for take profit,lot size isn't fixed,it should be easy to change without editing the code for a no programmer
Hello there, I have a functional EA that I need a modification done to. Previous developer is overloaded with work and has been dragging his feet. Basically what I need is a modification to the Auto Lot option. Currently you can set a lot size per x amount of account balance and it will auto trade readjusting the lots based on account balance. What I am looking for is a modification that allows me to specify the
I need a robot/Ea that can open pending orders based on th market price for SELL/BUY fora given pair. It needs a few configurable parameters like: MARKET_PRICE --> As described, it is the entry point from where to create an initial marker for the orders. (The real market price for a PAIR) INITIAL_GAP - this is a number in pips that, in addition to the MARKET price, becomes the first real entry point for the first
I already have a Trading View EA for Renko Candles with most of what is required. However i am looking for it to be modified with a few extra options. This is what I am looking for as a whole. Rules Trades executed on Renko Candles on Trading View Only allow one trade at a time. Buy/Long trade closes when Sell/Short trade opens, and visa versa. Ability to exclude certain days from opening trades. E.g. no trades to

Informations sur le projet

Budget
30+ USD
Pour le développeur
27 USD
Délais
à 1 jour(s)