vyacheslav.shindin

Turbo option strategy

157 0 27
Strategy for turbo option
Remove from Favorite Scripts Add to Favorite Scripts
study("One minut option strategy", overlay=true)

len = input(title="Length", type=integer, defval=3)

TrueRange = max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1])))
DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? max(high-nz(high[1]), 0): 0
DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? max(nz(low[1])-low, 0): 0

SmoothedTrueRange = nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1])/len) + TrueRange
SmoothedDirectionalMovementPlus = nz(SmoothedDirectionalMovementPlus[1]) - (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlus
SmoothedDirectionalMovementMinus = nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinus

DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
DX = abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100
ADX = sma(DX, len)

val = (DIPlus - DIMinus) * ADX
smaval = sma(val, 8)

//plot(val, color=val > 0 ? green : red, style=histogram, linewidth=4)
//plot(sma(val, 8), color=val > 0 ? green : red, style=histogram, linewidth=4)

source = close
fastLength = input(3, minval=1), slowLength=input(7,minval=1)

// TEMA
ema1 = ema(source, fastLength)
ema2 = ema(ema1, fastLength)
ema3 = ema(ema2, fastLength)
fastMA = 3 * (ema1 - ema2) + ema3

// DEMA
e1 = ema(source, slowLength)
e2 = ema(e1, slowLength)
slowMA = 2 * e1 - e2

hist = fastMA - slowMA

plotshape(hist > 0 and val > val[1] and smaval > smaval[1] ? 1 : na, color=lime, style=shape.arrowup, text="Buy")
plotshape(hist < 0 and val < val[1] and smaval < smaval[1] ? -1 : na, color=red, style=shape.arrowdown, text="Sell")
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder 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 Account and Billing Sign Out