Golden Cross by -Westy-

Westy_ · study · 15 行 · 点赞 265 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//@version=1
study(title="Golden Cross by -Westy-", overlay=true)
// fast ma
maFastSource   = input(defval = close, title = "Fast MA Source")
maFastLength   = input(defval = 50, title = "Fast MA Period", minval = 1)
// longest ma
maSlowestSource   = input(defval = close, title = "Slow MA Source")
maSlowestLength   = input(defval = 200, title = "Slow MA Period", minval = 1)
//
fastMA = ema(maFastSource, maFastLength)
slowestMA = ema(maSlowestSource, maSlowestLength)
//
plot(series=fastMA, color=lime, linewidth=2)
plot(series=slowestMA, color = red, linewidth=2)
plot(cross(fastMA, slowestMA) ? fastMA : na, style=cross, linewidth = 6, color=yellow)

← 返回列表