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)

파일:

응답함

1
개발자 1
등급
(39)
프로젝트
69
9%
중재
18
11% / 56%
기한 초과
18
26%
무료
2
개발자 2
등급
(202)
프로젝트
206
27%
중재
0
기한 초과
3
1%
무료
3
개발자 3
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
4
개발자 4
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
I would like to modify the RSI Epert Avisor with a developer. I would like to use the RSI Expert on the inverse mode and the base setting doesnt conatain this strategy mode
EA DEJA FABRIQUE ? MODIFIER QUELQUE LIGNE POUR LE RENDRE RENTABLE /////////////////////++++++++++++++++++++++++++++++++++ EA AVEC UN SYTEME SIMPLE ; SEULEMENT A MODIFIER %%%%%%%%%%%%%%%%%% SI PERSONNE SACHANT CODER CORRECTEMENT , CE TRAVAIL EST POUR TOI
Buy an sell symbols and guide showing entry to buy or sell setups and I need it gives and tell me to enter buy or to enter sell by automation nnnnnnnnnn fgggghhuuuiijh hhrddfhuuufffff yygggg hhgt hiidcb hygdfbby gyytdv uttrdd. Httdd hyyydv. Yhygf. Uu juhgff uyttt uuuytdbhy uuuyyy hhhff jjueeiivhgffdgu hyuu7trg yyyyffj yyytd u6tttf uuyrrrhi uytrrfh utterly jyrfgkkttv uhyybhhyy hytfgivuyt utfbh utghjio7t. Uuytg uytru
Utilizing the MQL5 MetaEditor Wizard, I created an Expert Advisor, having the following Signal indicators: I was able to optimize the EA and reached a backtest with the following specifications: I was able to reach a profit level of 30K, as indicated below. However, the Bot is not without faults and following the backtest, I started a forward test with real live data and the results were not so great. The EA took a
Connect from Mt5 via binary deriv account api I have mt5 indicator, need to connect with binary deriv account through api. If anyone can setup via API then contact me. everything control mt5
Hello I am looking for a developer to create an 50% retracement Indicator of the previous candle . So once a candle close the Indicator is supposed to take the full candle size from high to low and make a 61% and 50% level on that candle and I would like the candle to show until the next previous candle is done creating. After this I would look to create an ea with it possibly
Hi, I have 2 indicators which are based on the super trend , the alerts on indicator (1) does not work at all , and on the other indicator the alerts do not come on time on time, which is kind of delayed. see attached file below
Looking for an experienced developer to modify my existing TDI strategy , want to add filter for Buy and Sell Signals, Arrows are displayed on chart and what only to leave high accurate arrows Source code to be provided
I have the mq5 file, I need a buffer adding to the indicator, so it appears in the data window so I can reference it later in an EA. As the below screenshot shows, there is a median ray line from yesterday (the dashed horizontal line) - I want this value in the data window called Median Ray. I want this to be a single value per day, so todays Median Ray would be 17868, and so on each day. So I want all the Developing
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to

프로젝트 정보

예산
30 - 35 USD
개발자에게
27 - 31.5 USD
기한
에서 1  2 일