TradingView
teknkanalzci
31 May 2020 09:25

deneme 1 

PERGAMON DIS TICARETBIST

Açıklama

//@version=3
//Cryptocurrency Trading Tools by XMAXPRO
//PÝVOT DÖNÜÞLERÝ INDIKATORU
//Test 1.0v Tarih:04.08.2019

study("Pivot Returns", overlay=true, shorttitle="PivotR")
leftBars = input(4)
rightBars = input(4)

// Hesaplama
swh = pivothigh(leftBars, rightBars)
swl = pivotlow(leftBars, rightBars)
swh_cond = not na(swh)
hprice = 0.0
hprice := swh_cond ? swh : hprice[1]
swl_cond = not na(swl)
lprice = 0.0
lprice := swl_cond ? swl : lprice[1]

// Tetikler
long = crossover(high, hprice + syminfo.mintick)
short = crossunder(low, lprice - syminfo.mintick)
last_signal = 0
long_final = long and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == -1)
short_final = short and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == 1)
last_signal := long_final ? 1 : short_final ? -1 : last_signal[1]

plotshape(long_final, style = shape.arrowup, color = green, location = location.abovebar, text = "Long")
plotshape(short_final, style = shape.arrowdown, color = red, location = location.belowbar, text = "Short")

plot(lprice, color = red)
plot(hprice, color = green)

// Alarmlar
alertcondition(long_final, "Pivot Long", "Pivot Long")
alertcondition(short_final, "Pivot Short", "Pivot Short")
Daha Fazla