Adding trailing stop loss for the strategy

MQL5 Indicadores Experts

Termos de Referência

I have attached a strategy below which I require you to add a trailing stop loss, there is an explanation below on how the trailing stop loss works, it is from the meta stock system tester in case you are wondering or have used it before.

All I require is the following stop loss to be added



Also, regarding the buy and sell condition it is available on the sheet



How does the Trailing Stop work?

The following is an example of a 2 point trailing stop, with and without a 3 bar delay:

A trade is triggered on a security. The entry price is 50. Over the next several bars, the price rises to 55. On the next bar, the price drops to 54. The following bar sees a drop to 52.5. Then the price rises to 53.5. From there, it continues to climb till it reaches 65. At this point, the price starts to fall rapidly. The next several bars have prices of 63, 61, 59, and 57 respectively.

A two point trailing stop, with no delay:

The trade is entered at 55. The stop moves up with the prices. When the price reaches 55, the stop is at 53. Two bars later, the stop is triggered and the trade is closed.

A two point trailing stop, with a 3 bar delay:

The trade is entered at 55. The stop moves up with the prices, but using the closing price from 3 bars prior to the current to calculate the stop level. Therefore, when the price begins to fall from the 55 bar high, the stop is being calculated from the price 3 bars earlier. It will not use the value of 55 till the prices have already moved back above 53 and the trade will remain open. When the prices reach 65 and begin to fall, the stop is still being used on the price 3 bars earlier. This means the prices will fall past 63, probably to 61 before being stopped out.



{Long trailing stop}

x:=1 { enter the trailing stop percent } ;

trade:= 1 { enter buy condition };

tep:=C; { trade entry price }

start:=ValueWhen(1,trade,tep);

r:=C-start;

lvl:= C-(r*(x/100));

stop:=If(trade,H-((H-tep)*(x/100)),

  If(ROC(C,1,%)>0,Max(lvl,PREV),PREV));

Cross(stop,L)



{Short trailing stop}

x:=1 { enter the trailing stop percent } ;

trade:= 1 { enter sell short condition };

tep:=C; { trade entry price }

start:=ValueWhen(1,trade,tep);

r:=start-C;

lvl:= C+(r*(x/100));

stop:=If(trade,L+((tep-L)*(x/100)),

  If(ROC(C,1,%)<0,Min(lvl,PREV),PREV));

Cross(H,stop)

Arquivos anexados:

MQ5
RSI_MA_EA.mq5
12.6 Kb

Respondido

1
Desenvolvedor 1
Classificação
(4)
Projetos
5
0%
Arbitragem
3
0% / 67%
Expirado
2
40%
Livre
2
Desenvolvedor 2
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(33)
Projetos
35
40%
Arbitragem
11
9% / 91%
Expirado
4
11%
Livre
Pedidos semelhantes
The service of a coder is required to Add an indicator menu and indicator file to the existing ea The Indicator will work with already installed indicator Details of the strategy will discussed when you applies The ea will be proof on the live market before its approved
Hi, Project Description: Develop a sophisticated Expert Advisor (EA) for MetaTrader 5 that leverages custom indicator signals to execute trades with advanced trade management features. The EA should support dynamic trade entries, customizable stop loss (SL) and trailing stops, versatile lot sizing, handling of opposite signals, detailed trade commenting, and incorporate Inside Candle pattern detection along with
Overview: I'm searching for a highly skilled and experienced MQL5 coder to create an Expert Advisor (EA) based on a purchased indicator from the MQL5 marketplace. The EA should execute trades with specific trade management settings, allowing full customization for trade entry, stop loss, trailing, and lot sizes, as well as handling opposite signals. Only serious applicants should apply, as I have no time to waste
Hi, I have been working on this EA robot for days, but been busy with other things to complete. I am looking for a skilled coder who can modify an existing Expert Advisor (EA) for immediate profitable trading in all forex pairs. The finalization of the EA can then be completed within the next 1 or 2days after back testing. The source code will be shared only after the applicant demonstrates their capability to
I need a local program that copies mt5 to mt5, mt5 to ctrader, mt5 to dxtrade, mt5 to macht trade. It can't be through EA because the prop firm doesn't allow copytrading. It can't be detectable
T here is one simple robot with an open code, it can be modified - news filter, etc. I will attach the source code and the Image of the filter i want to add to the ea If you can do it, Kindly reach out to me so we can discuss about and also here is my tg handle TG: Ibiscotrader
1. Knowledge and Expertise Forex Market Understanding : A strong understanding of how the forex market operates, including currency pairs, trading hours, spreads, liquidity, and other fundamental market dynamics. Trading Strategies : Knowledge of various trading strategies such as trend-following, scalping, arbitrage, hedging, and using indicators (e.g., moving averages, RSI, MACD, Fibonacci retracements). Risk
TIME FRAME: 15 MIN LOT SIZE: 0.01 CANDLE START TIME: 2:00 CANDLE END TIME: 2:14 ENTRY BUFFER: 1 SL BUFFER: 1 TARGET $: 10 MARTINGALE % : 200 (All the above data should be adjustable) Details: 1. We have to mention candle start time and end time (ie: 4.00 to 4.59). If the candle breaks the high of the given time it should go for buy. If it breaks the low of the given time it should go for sell. 2
We need to redesign the utility to work with Discord, we need a developer who has previously worked with Discord and knows how to link sending messages from the MetaTrader terminal to Discord. I will consider your suggestions
An hft to pass prop firms sybthetic challengues fast. The bot has to be able to pass the challengues with no Dd. Please don't offer if You don't have what i post. I am not looking s friend. Ibwsnt tanto bebdone as soon as possible

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD