AO+ EMA 34/5

SwingMann · study · 24 行 · 点赞 13 · TradingView 原页

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

Pine Script

//@version=6
//©SwingMann
// Awesome Oscillator script may be freely distributed under the MIT license.
 
indicator("[SwingMann©] AO+ EMA 34/5", shorttitle="[SM©] AO EMA 34/5", timeframe="", timeframe_gaps=true)
 
fastLength = input.int(5, "Fast Length")
slowLength = input.int(34, "Slow Length")
 
ao = ta.sma(hl2, fastLength) - ta.sma(hl2, slowLength)
 
ema34 = ta.ema(ao, 5)
ema5 = ta.ema(ema34, 5)
 
bullColor = #089981
bearColor = #f23645
 
aoColor = ao >= 0 ? ao[1] < ao ? #26A69A : #B2DFDB : ao[1] < ao ? #FFCDD2 : #EF5350
ema34Color = ema34 >= ema34[1] ? bullColor : bearColor
ema5Color = ema5 >= ema5[1] ? bullColor : bearColor
 
plot(ao, title="AO", style=plot.style_columns, color=aoColor)
plot(ema34, title="AO EMA 34", color=ema34Color, linewidth=1)
plot(ema5, title="AO EMA 5 Glättung", color=ema5Color, linewidth=1)

← 返回列表