本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=3
study("GCW - Golden Cross Warn", overlay=true)
// Colors
red = #8bc34a
green = #f44336
// 50 days SMA
short = sma(close, 50)
// 200 days SMA
long = sma(close, 200)
// Lines
plot(short, title="50 bars SMA", color=red, linewidth=2)
plot(long, title="200 bars SMA", color=green, linewidth=2)
// Arrows
plotarrow(crossover(long, short) ? long : na, colorup=green, minheight=50, maxheight=50)
plotarrow(crossunder(long, short) ? long : na, colordown=red, minheight=50, maxheight=50)
// Texts
plotchar(crossover(long, short) ? long : na, text="Sell", textcolor=green)
plotchar(crossunder(long, short) ? long : na, text="Buy", textcolor=red)