ozgurhan

Golden cross indikatörü

BITFINEX:BTCUSD   比特币
Merhabalar, 50 günlük hareketli ortalamanın 200 günlük hareketli ortalamayı yukarı kesmesi durumuna golden cross denmektedir.
Aşağıda geliştirmiş olduğum pine script kodlarında ,golden cross durumunda indikatör hem al durumunda hem sat durumunda hemde alarm sayısından kazanmak için her iki durumda da alarm vermektedir.


// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © ozgurhan

//@version=4
study("Hareketlii ortalama", overlay=true)

hizliPeriyot=input(50)
yavasPeriyot=input(200)

hizliMa=sma(close, hizliPeriyot)
yavasMa=sma(close, yavasPeriyot)

yukariKeser=crossover(hizliMa, yavasMa)
asagiKeser=crossunder(hizliMa, yavasMa)

kesisimRengi=(hizliMa>yavasMa ? color.green : color.red)

plotshape(yukariKeser, size=size.small, style=shape.labelup, location=location.belowbar, color=color.green, text="AL", textcolor=color.black)
plotshape(asagiKeser, size=size.small, style=shape.labeldown , location=location.abovebar, color=color.red, text="SAT", textcolor=color.black)

plot1=plot(hizliMa, color=color.blue, linewidth=3, title="HIZLI MA")
plot2=plot(yavasMa, color=color.orange, linewidth=3, title="YAVAŞ MA")

fill(plot1, plot2, color=kesisimRengi, transp=10)


yukselenTrendrengi=hizliMa>yavasMa

bgcolor(yukselenTrendrengi ? color.green : color.red)

barcolor(yukselenTrendrengi ? color.green : color.red)

alertcondition(yukariKeser, title="yukari kesti", message="yukarı keser")
alertcondition(asagiKeser, title="asagi kesti", message="asagi kesti")
alertcondition(asagiKeser or yukariKeser, title="asağı veya yukarı golden cross", message="asağı veya yukarı golden cross")


免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。