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에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.