TradingView
jessekr
14 Th12 2018 21:21

ATR + SMA 

Euro Fx/Australian DollarFXCM

Mô tả

Just a simple script that provides you with an ATR line and a corresponding SMA line.
Bình luận
vkant331
Plese help me ATR band stretagy for aply
vkant331
study("ATR Band Strategy")

// Define the ATR length and multiplier
atrLength = input(title="ATR Length", type=integer, defval=14)
atrMultiplier = input(title="ATR Multiplier", type=float, defval=1.5)

// Calculate the ATR
atr = trueRange(atrLength)

// Calculate the upper and lower bands
upperBand = highest(high, atrLength) + atrMultiplier * atr
lowerBand = lowest(low, atrLength) - atrMultiplier * atr

// Plot the bands
plot(upperBand, title="Upper Band", color=red, linewidth=2)
plot(lowerBand, title="Lower Band", color=green, linewidth=2)

// Buy signal
buy = crossover(close, lowerBand)

// Sell signal
sell = crossunder(close, upperBand)

// Plot the signals
plotshape(buy, style=shape.arrowup, location=location.belowbar, color=green, text="Buy")
plotshape(sell, style=shape.arrowdown, location=location.abovebar, color=red, text="Sell")
vkant331
Thêm nữa