Dema Ema Crossover | viResearch

viResearch · study · 37 行 · 点赞 881 · TradingView 原页

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

Pine Script

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © bii_vg
 
//@version=5
indicator(title="Dema Ema Crossover | viResearch", overlay=true, timeframe="", timeframe_gaps=true)
import TradingView/ta/7 as ta
 
len_dema = input.int(15,"Dema len",group = "Dema smoothing")
src_dema = input.source(close,"Dema source",group = "Dema smoothing")
dema = ta.dema(src_dema, len_dema)
 
len1st = input.int(12,"fast ema",group = "Dema Ema Crossover | viResearch")
len2nd = input.int(26,"slow ema",group = "Dema Ema Crossover | viResearch")
 
ema1st = ta.ema(dema, len1st)
ema2nd = ta.ema(dema, len2nd)
 
emal = ema1st > ema2nd
emas = ema1st < ema2nd
 
L = emal
S = emas
 
var vii = 0
 
if L and not S 
	vii := 1
 
if S 
	vii := -1
 
x = plot(ema1st, color = color.rgb(0, 255, 187, 100))
y = plot(ema2nd, color = color.rgb(0, 255, 187, 100))
fill(x, y, color = vii ==  1  ?  color.rgb(0, 255, 187) : vii == -1  ?  color.rgb(255, 0, 157) : na)
 
alertcondition(L, title="Dema Ema Crossover Long", message="Dema Ema Crossover Long {{exchange}}:{{ticker}}")
alertcondition(S, title="Dema Ema Crossover Short", message="Dema Ema Crossover Short {{exchange}}:{{ticker}}")

← 返回列表