Trailing Stop

MQL4 エキスパート

仕事が完了した

実行時間19 時間
開発者からのフィードバック
Thank you for your order.

指定

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. 






応答済み

1
開発者 1
評価
(584)
プロジェクト
915
46%
仲裁
31
39% / 29%
期限切れ
93
10%
仕事中
2
開発者 2
評価
(33)
プロジェクト
35
40%
仲裁
11
9% / 91%
期限切れ
4
11%
3
開発者 3
評価
(488)
プロジェクト
1014
58%
仲裁
29
28% / 24%
期限切れ
131
13%
仕事中
4
開発者 4
評価
(277)
プロジェクト
334
55%
仲裁
14
36% / 29%
期限切れ
1
0%
類似した注文
Olá Preciso de um código aberto para robô expert, com as seguintes informações com base no Indicador VWAP - volume pondered average price, não precisa todos os períodos, SOMENTE DIÁRIO. aberturas de COMPRA e VENDA no cruzamento de media móvel sobre a VWAP, deixar disposição alteração do modelo da media e o período da media. OBS: 'Reverter mão' conforma o cruzamento da mídia com a VWAP(exemplo se estava vendido e
I NEED AN EXPERT ADVISOR THAT IS BASED ON SMOOTHED MOVING AVARAGE INPUT/ PERIOD-55/ METHOD-SMOOTHED/APPLY TO HIGH.WHEN A BULLISH CANDDLE CLOSED AND OPEN ABOVE THIS MOVING AVARAGE IT MUST OPEN A BUY ORDER AND WHEN A BEARISH CANDDLE CLOSED AND OPEN BELOW MOVING AVARAGE MOVING AVARAGE PERIOD -55/ METHOD- SMOOTHED/APPLY-LOW IT MUST OPEN SELL ORDER IT MUST ALSO SCAN CHART IN ALL TIME FRAMES AND WITH TAKE PROFIT AND STOP
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend
I currently download multiple Metatrader 4 profiles onto a Windows 11 pc on a regular basis. In order to speed up the process of uploading those profiles to my MetaTrader 4 account I have a "profile updater" MQL4 script that will do that automatically with just a couple of clicks. I also have a Linux pc that runs MetaTrader 4 through Codeweaver's Crossover program but the "profile updater" doesn't work in that
Creating a customized Forex/Index Rob Bot based on price actions and candlestick formations requires advanced programming and algorithmic trading knowledge. Here is a high-level outline of the steps involved in developing such a bot: 1. Define Trading Strategy: Specify the specific price action and candlestick formations you want the bot to trade upon. This could include setups like engulfing patterns, doji
This is a Ready Made grid Automatic EA 1.Need some bug fixing and little modification. This EA has some bug like -Place Random Trade after MT4 Restart . Also not follow custom parameter grid distance, grid slippage . like if i set 300pips grid distance, some time it place trade at 400 pips distance . fix this bug 2.first trade open by RSI logic if rsi30 open buy trade
Hello developers, I need a trading robot that works on martingale and antimartingale (functions that can be activated or deactivated, so the robot can work both as a martingale and as an antimartingale together). Initially the robot will work as an entry strategy on RSI, but it must be an open project as new entry strategies will be implemented in the future
HEDGING EA 70+ USD
LET ME KNOW IF YOU CAN DO THE JOB SERIOUS PROGRAMMER TO DO EA WITH STRICT DETAILS I HAVE A PICTURE OF THE STRATEGY I DO NOT WANT TO POST IT HERE
Requiero un EA basado en un indicador con las siguientes caracteristicas 1. Abra operacion con una señal que da el indicador, despues que la vela toque el indicador y cierre por encima del indicador 2. Que cierre operacion con SL y TP en % de perdida y ganancia 3, Que en cada señal abra un maximo de X operaciones y si pierde en la siguiente señal haga el doble operaciones y todas seran con el mismo lotaje Todos los
Biro7 Freedom 60 - 120 USD
Looking for someone to build an EA for MT5 terminal using the following indicators. 4 supertrend indicators 1 TSI 1 MACD 1 Bollinger Band as well as candlesticks I will describe how I want trade entry, and trade management to work after I have pick the developer. I want the EA to be a multi currency EA, with an optional freeze trading during news events. AS I only want the EA to trade during certain times of the day

プロジェクト情報

予算
30+ USD
開発者用
27 USD
締め切り
最高 1 日