vyacheslav.shindin

Turbo option strategy

Strategy for turbo option

Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
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")