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提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。