OPEN-SOURCE SCRIPT
Moving Average Exponential

//version=4
study(title="主图常用指标@小何", shorttitle="主图常用指标@小何",overlay=true)
emaSystem1 = input(false,title = "均线系统@斐波那契")//5,21,55,144
vegas = input(false,title = "Vegas双隧道")//144,169,576,676,12
emaSystem2 = input(false,title = "均线系统@常规时间周期")//10,20,30
boll = input(false, title = "布林带")
fastEma1 = emaSystem1?ema(close,5):na
midEma1 = emaSystem1?ema(close,21):na
slowEma1 = emaSystem1?ema(close,55):na
VIPslowEma1 = emaSystem1?ema(close,144):na
//输出均线系统1
plot(fastEma1,color = color.yellow,linewidth =2,title = "快线-5ema")
plot(midEma1,color = color.red,linewidth = 2,title = "中线-21ema")
plot(slowEma1,color = color.blue,linewidth = 2,title = "慢线-55ema")
plot(VIPslowEma1,color = color.white,linewidth = 2,title = "巨慢线-144ema")
fil1 = vegas?ema(close,12):na
fast4Ema = vegas?ema(close,576):na
slow4Ema = vegas?ema(close,676):na
fast1Ema = vegas?ema(close,144):na
slow1Ema = vegas?ema(close,169):na
//输出Vegas隧道
plot (fil1,color = color.green,linewidth = 2,title= "过滤线")
plot (fast4Ema,color = color.blue,linewidth = 2,title = "慢隧道快线")
plot (slow4Ema,color = color.blue,linewidth = 2,title = "慢隧道慢线")
plot (fast1Ema,color = color.yellow,linewidth = 2,title = "快隧道快线")
plot (slow1Ema,color = color.yellow,linewidth= 2,title = "快隧道慢线")
fastEma2 = emaSystem2?ema(close,10):na
midEma2 = emaSystem2?ema(close,20):na
slowEma2 = emaSystem2?ema(close,30):na
//输出均线系统2
plot(fastEma2,color = color.yellow,linewidth =2,title = "快线-5ema")
plot(midEma2,color = color.red,linewidth = 2,title = "中线-21ema")plot(slowEma2,color = color.blue,linewidth = 2,title = "慢线-55ema")
basis = boll?sma(close, 20):na
dev = 2 * stdev(close,20)//标准差
upper = boll?(basis + dev):na
lower = boll?(basis - dev):na
plot(basis, "中轨", color=#872323)
p1 = plot(upper, "上轨", color=color.teal)
p2 = plot(lower, "下轨", color=color.teal)
fill(p1, p2, title = "背景", color=#198787, transp=95)
study(title="主图常用指标@小何", shorttitle="主图常用指标@小何",overlay=true)
emaSystem1 = input(false,title = "均线系统@斐波那契")//5,21,55,144
vegas = input(false,title = "Vegas双隧道")//144,169,576,676,12
emaSystem2 = input(false,title = "均线系统@常规时间周期")//10,20,30
boll = input(false, title = "布林带")
fastEma1 = emaSystem1?ema(close,5):na
midEma1 = emaSystem1?ema(close,21):na
slowEma1 = emaSystem1?ema(close,55):na
VIPslowEma1 = emaSystem1?ema(close,144):na
//输出均线系统1
plot(fastEma1,color = color.yellow,linewidth =2,title = "快线-5ema")
plot(midEma1,color = color.red,linewidth = 2,title = "中线-21ema")
plot(slowEma1,color = color.blue,linewidth = 2,title = "慢线-55ema")
plot(VIPslowEma1,color = color.white,linewidth = 2,title = "巨慢线-144ema")
fil1 = vegas?ema(close,12):na
fast4Ema = vegas?ema(close,576):na
slow4Ema = vegas?ema(close,676):na
fast1Ema = vegas?ema(close,144):na
slow1Ema = vegas?ema(close,169):na
//输出Vegas隧道
plot (fil1,color = color.green,linewidth = 2,title= "过滤线")
plot (fast4Ema,color = color.blue,linewidth = 2,title = "慢隧道快线")
plot (slow4Ema,color = color.blue,linewidth = 2,title = "慢隧道慢线")
plot (fast1Ema,color = color.yellow,linewidth = 2,title = "快隧道快线")
plot (slow1Ema,color = color.yellow,linewidth= 2,title = "快隧道慢线")
fastEma2 = emaSystem2?ema(close,10):na
midEma2 = emaSystem2?ema(close,20):na
slowEma2 = emaSystem2?ema(close,30):na
//输出均线系统2
plot(fastEma2,color = color.yellow,linewidth =2,title = "快线-5ema")
plot(midEma2,color = color.red,linewidth = 2,title = "中线-21ema")plot(slowEma2,color = color.blue,linewidth = 2,title = "慢线-55ema")
basis = boll?sma(close, 20):na
dev = 2 * stdev(close,20)//标准差
upper = boll?(basis + dev):na
lower = boll?(basis - dev):na
plot(basis, "中轨", color=#872323)
p1 = plot(upper, "上轨", color=color.teal)
p2 = plot(lower, "下轨", color=color.teal)
fill(p1, p2, title = "背景", color=#198787, transp=95)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.