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")

DONATE/TIP

BTC: 3FKWwtaYrf5NHZzaCi1fyAfQj7XSgtyCqe
Can you please help me to convert this study to a strategy? it gives an error when I'm trying to convert it :((
it says:
xATRTrailingStop = iff(close > nz(xATRTrailingStop, 0) and close > nz(xATRTrailingStop, 0), max(nz(xATRTrailingStop), close - nLoss),
iff(close < nz(xATRTrailingStop, 0) and close < nz(xATRTrailingStop, 0), min(nz(xATRTrailingStop), close + nLoss),
iff(close > nz(xATRTrailingStop, 0), close - nLoss, close + nLoss)))
this part has an error when I'm trying to convert this to a starategy :((
I'm using a crossover(close, xATRTrailingStop) for open long.
Reply
HPotter azizgokbas
@azizgokbas, Look at this
+1 Reply
azizgokbas HPotter
@HPotter, Awesome! Thank you so much! Do you know c#?
Reply
HPotter azizgokbas
@azizgokbas, Yes.
Reply
azizgokbas HPotter
@HPotter, do you have this indicator in c# language too?
Reply
HPotter azizgokbas
@azizgokbas, I should to see in my database, but I think yes.
Reply
azizgokbas HPotter
@HPotter, If you can find that can you share with me? I just like this indicator as a trailing stopp loss.
Reply
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 prolongwealth
I don`t know.
Reply
Even the weekly trend chart has turned against Bitcoin:

Reply
EN English (IN)
EN English
EN English (UK)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
HE עברית
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Get Help Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Get Help Ideas Published Followers Following Private Messages Chat Sign Out