Adding trailing stop loss for the strategy

MQL5 지표 전문가

명시

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)

파일:

MQ5
RSI_MA_EA.mq5
12.6 Kb

응답함

1
개발자 1
등급
(4)
프로젝트
5
0%
중재
3
0% / 67%
기한 초과
2
40%
무료
2
개발자 2
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
3
개발자 3
등급
(33)
프로젝트
35
40%
중재
11
9% / 91%
기한 초과
4
11%
무료
비슷한 주문
I'm looking for a skilled developer to create a custom MT5 EA that integrates with Twitter to copy trading signals from a specific Twitter handle and execute them on MT5. The EA should be able to monitor the Twitter feed in real time (or near real-time), parse trading signals based on predefined formats, and execute trades automatically. Project Requirements: Twitter API Integration : Set up and configure access to
Trade Copier 200 - 300 USD
Hi Sir im searching a Skilled MQL5 Developer Programmer , I want to Develop a Trade Copier , Like Master and Slave Accounts , Trade Copier Between MT4 to MT4 & MT5 to MT5 to MT5 & MT5 to Mt4 Copier with my Specific Requirements Thanks
A robot 40 - 46 USD
Hy I am looking for someone who can make me robot using my own strategy..my strategy is SMC ..I want it only shows me Bos , choch and liquidity... I have entry to show you and Tp that is only things are need
Hello everyone I‘ve designed a unique risk management and coded it already into a include file for mql5. The implementation is done with a few libe of code. I would like to booster your strategy and obviously take also advantage from it. Please provide me some backtests in pictures (5 years minimum with >99% data quality) of your best EA for MT5. It would be also good if your EA has a fixed takeprofit level
The Moving Average Cross needs debugging for live chart . [Condition 1] Personalized Omega Trailing Stop Loss ( Details of how it works will be provided , If still necessary the expert where it works just fine will be provided . ) Couple of Input parameters that needs to be removed (previous dev just added ) [ He can be contacted if necessary ]. Following are the implementations required by my expert : 1. Auto Lot
Hello Here Everyone, I need an expert to help me create a tradingview indicator that works exactly according to my requirements, Even though i will attach a file there review it and let me know if you could do it and we can talk about the price as well
Hi, I have a simple trading view strategy. Need to convert to a MT5 expert. open position based Tradingview alerts, and when new alerts come close old position and open new position. thanks
Hello Great Developer I want to convert a Tradingview indicator to Tradestation . The bigger project is to create a strategy after converting the indicator. Please see attached and let me know if this is something you can do? If so, please share your fee and time frame. thanks
Dear sir, i want to buy sell rob buy using multi indicator it can work with maximum accuracy. if you have any better suggestion then you are also welcome. 1 Bollinger Band 2. RSI 3. Moving Average 2 4 Super Trend 5. News Filter 6. Auto Move Sl to Breakeven 7. News Filter 8. Grid martingale
Siphiwe Jack 30+ USD
I am ordering a robot so I can easily use my trades and I am willing to have more positive numbers of currency that I could collect and with the use of it will better my understanding of the mt5 usage

프로젝트 정보

예산
30+ USD
개발자에게
27 USD