ATR TRAILING STOP
Forums › ProRealTime English forum › ProBuilder support › ATR TRAILING STOP
- This topic has 28 replies, 4 voices, and was last updated 5 years ago by nfulcher.
-
-
09/24/2019 at 2:20 PM #10835709/24/2019 at 11:16 PM #108397
Hi Nicolas, thanks for the fix. I’ve attached a Daily chart of TPM on the ASX just to highlight some little issues. I set the trailing stop to 5 x ATR(14).
Kind Regards Simon
Edit. I took another screenshot of the chart to see if it displayed better
09/25/2019 at 8:06 AM #10840509/25/2019 at 9:32 AM #108413All the following is based on a long position example.
The current trailing stop line should just hang 2X ATR(14) from the highest close.
For a new higher close, the trailing stop immediately moves up to be 2x ATR(14) under the new higher closing price.
Once a new bar closes lower , the 2x ATR(14) value of that bar is now deducted from the previous highest close.
If the current bars 2xATR(14) deducted from the highest close means the trailing stop would now hang further away, it stays horizontal.
If the current bars 2x ATR(14) deducted from the highest close means the trailing stop would now be closer to current price, it steps up.
It now steps up to hang down 2xATR(14) from that prior highest close.
Hope that makes sense.
Basically it would be a very responsive trailing stop that sometimes moves every single bar if volatility is decreasing but we are not getting new higher closes.
The work you’ve done so far is great. The indicator is getting extremely close to perfect.
Kind Regards Simon
09/25/2019 at 11:03 AM #108417f the current bars 2x ATR(14) deducted from the highest close means the trailing stop would now be closer to current price, it steps up.
Yes, that’s how it works now, but how it would step up if it can only move up if the ATR is decreasing? The trailing stop line substract ATR*multiplier to the highest close. So if the ATR is decreasing, it can’t go higher than the current trailing stop level.
09/26/2019 at 3:57 AM #108489In a sequence of say 7 bars the trailing stop (ts) should be doing this
a) close = 1 and ATR x multiplier= .10 TS=.90
b) close =1.10 and ATR x multiplier =.10 TS =1
c) close = 1.05 and ATR x multiplier =.10 TS =1 lower close but ts = highest close minus current bars ATR x multiplier
d) close=1.07 and ATR x multiplier =.08 TS= 1.02
e) close=1.04 and ATR x multiplier =.09 **TS=1.01 Trailing stop can’t move away from price so it stays at 1.02
f) close=1.04 and ATR x multiplier =.07 TS=1.03
g) close =1.16 and ATR x multiplier =.10 TS =1.06 We now have a new higher close that we are deducting our ATR x multiplier from
09/26/2019 at 7:37 AM #108490So basically we are just calculating volatlity every bar and deducting it from the highest close. Then hanging down a trailing stop ( from that highest close) that only moves closer or stays horizontal every bar until we have a new higher close OR price closes below the trailing stop. Then it will flip over to be a trailing stop for a short position.
09/26/2019 at 9:27 AM #10851109/26/2019 at 1:55 PM #108601Bar C has closed at $1.05 The ATR x multiplier for bar C is .10 ( for example the 14 period ATR was .05 and the multiplier was 2) The highest closing bar so far has been Bar B Bar B closed at $1.10 $1.10 minus .10 which is $1.00 So trailing stop moves to $1.00 and sits directly below Bar C
Bar D closes at $1.07 The ATR x multiplier for bar D is .08 The highest closing bar so far has been bar B Bar B closed at $1.10 $1.10 minus .08 is $1.02 So trailing stop moves to $1.02 and sits directly below Bar D
09/26/2019 at 2:15 PM #108602Try this version:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354//PRC_Another ATR trailing stop | indicator//24.09.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// --- settingsp=14 //ATR periodmult=2 //multipliermode=1 //trailing stop mode (0=straight line// --- end of settingsatr = AverageTrueRange[p](close) * multonce trend=1if trend=1 thenhh=max(hh,close)ll=hh//if atr<atr[1] thenhhlevel=hh-atrif hhlevel>ts thents=hhlevelendif//endifr=0g=168elsell=min(ll,close)hh=ll//if atr<atr[1] thenlllevel=ll+atrif lllevel<ts thents=lllevelendif//endifr=255g=0endifif close crosses over ts thentrend=1if mode>0 thents=llendifelsif close crosses under ts thentrend=-1if mode>0 thents=hhendifendifreturn ts coloured(r,g,200) style(line,3)Seems more responsive..
1 user thanked author for this post.
09/29/2019 at 4:51 AM #10873409/30/2019 at 10:27 PM #10895310/01/2019 at 7:49 AM #10895910/02/2019 at 9:11 PM #109133 -
AuthorPosts
Find exclusive trading pro-tools on