HPotter

Average True Range Trailing Stops, by Sylvain Vervoort

Average True Range Trailing Stops, by Sylvain Vervoort
The related article is copyrighted material from Stocks & Commodities Jun 2009
Remove from Favorite Scripts Add to Favorite Scripts
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 16/09/2014
// Average True Range Trailing Stops, by Sylvain Vervoort
// The related article is copyrighted material from Stocks & Commodities Jun 2009 
////////////////////////////////////////////////////////////
study(title="Average True Range Trailing Stops, by Sylvain Vervoort", overlay = true)
nATRPeriod = input(5)
nATRMultip = input(3.5)
xATR = atr(nATRPeriod)
nLoss = nATRMultip * xATR
xATRTrailingStop = iff(close > nz(xATRTrailingStop[1], 0) and close[1] > nz(xATRTrailingStop[1], 0), max(nz(xATRTrailingStop[1]), close - nLoss),
                    iff(close < nz(xATRTrailingStop[1], 0) and close[1] < nz(xATRTrailingStop[1], 0), min(nz(xATRTrailingStop[1]), close + nLoss), 
                        iff(close > nz(xATRTrailingStop[1], 0), close - nLoss, close + nLoss)))
plot(xATRTrailingStop, color=red, title="ATR Trailing Stop")

ChartArt
2 years ago
Even the weekly trend chart has turned against Bitcoin:

snapshot
Reply
HPotter PRO ChartArt
2 years ago
it happened from nz(xATRTrailingStop, 0) Formula use previos value and can not get it. This function return 0.
Reply
ChartArt HPotter
2 years ago
I have no problem with the beginning of the weird ATR trailing stop, because the end of the chart is what interests me.
Reply
FluidicFX PRO ChartArt
2 years ago
You mean where the red line passes thru and above the price. I was frowning at that too.
Reply
ChartArt FluidicFX
2 years ago
yes, exactly
Reply
prolongwealth
2 years ago
So what is the strategy that can be used.. How do you know if you should take an ATR change trade. I get the buy point on the change but is there something that help say this change is better than the last?
Reply
HPotter PRO prolongwealth
2 years ago
I don`t know.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out