ifstoch ve macd indikatörlerinin birleşimi

Merhabalar aşağıdaki pine script kodnda ifstoch ve macd indikatörlerini birleştirerek aşırı alım ve satım noktalarında macd indikatörünün aşağı ve yukarı kesimlerinide katarak al ve sat kodu oluşturdum.
Al ve sat üzerine alarm kurabilirsiniz.
if stoch yukarı çıkarken macd indikatöründen gelen al sinyalı yapmak veya tersi tavsiye ederim


//version=4
study("IIFSTOCH ve MACD", overlay=false, shorttitle="IIFSTOCH ve MACD")
wprlength=input(14,"Williams%R Length")
wmalength=input(9,"Smoothing Length")
wprs=0.1*(wpr(wprlength)+50)
wprsw=wma(wprs,wmalength)
INVWR=(exp(2*wprsw)-1)/(exp(2*wprsw)+1)
linecolor=#f39c12
plot(INVWR,color=linecolor, linewidth=1, title="%R")
obPlot=hline(0.9, color=color.black,title="Upper Band")
osPlot=hline(-0.9, color=color.black,title="Lower Band")


fill(obPlot,osPlot,color.black)
//alertcondition(INVWR, title="al", message="al")

// macd
fastLength = input(8, minval=1)
slowLength = input(16,minval=1)
signalLength=input(11,minval=1)

fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA
signal = sma(macd, signalLength)



yukariKesermacd=crossover(macd, signal)
asagiKesermacd=crossunder(macd, signal)
//plotshape(yukariKesermacd,size=size.small,style=shape.labelup,location=location.bottom,text="AL")
//plotshape(asagiKesermacd,size=size.small,style=shape.labeldown,location=location.top,text="SAT")

//alertcondition(yukariKesermacd, title="AL", message="Al")
//alertcondition(asagiKesermacd, title="SAT", message="SAT")
alertcondition(INVWR and yukariKesermacd, title="Al", message="AL")
plotshape(INVWR and yukariKesermacd,size=size.small,style=shape.labelup,location=location.bottom,color=color.green,text="AL",textcolor=color.black)
alertcondition(INVWR and asagiKesermacd, title="SAT", message="SAT")
plotshape(INVWR and asagiKesermacd, size=size.small,style=shape.labeldown,location=location.top,color=color.red,text="SAT",textcolor=color.black)
Technical Indicators

Мои профили:

Отказ от ответственности