搜索
产品
社区
市场
新闻
经纪商
更多
CN
开始
社区
/
脚本
/
MACD DEMA by Toff
OPEN-SOURCE SCRIPT
MACD DEMA by Toff
由shawn4812提供
关注
关注
2022年7月20日
5
1
添加到收藏
添加到收藏
2022年7月20日
MACD DEMA by Toff
converted to version 5
Changed Histogram formatting
Changed MACD plot to indicate macd direction change
//
version
=5
//by ToFFF converted to version 5, changed histogram formating changed macd plot to show macd direction changed with lighter color
indicator('MACD DEMA', timeframe = "", timeframe_gaps=true)
sma = input(12,title='DEMA Short')
lma = input(26,title='DEMA Long')
tsp = input(9,title='Signal')
lines = input(true,title="Lines")
col_grow_above = input(#26A69A, "Above Grow", group="Histogram", inline="Above")
col_fall_above = input(#B2DFDB, "Fall", group="Histogram", inline="Above")
col_grow_below = input(#FFCDD2, "Below Grow", group="Histogram", inline="Below")
col_fall_below = input(#FF5252, "Fall", group="Histogram", inline="Below")
col_macd = input(#2962FF, "MACD Line ", group="Color Settings", inline="MACD")
col_signal = input(#FF6D00, "Signal Line ", group="Color Settings", inline="Signal")
col_macd_i = #0000FF
col_macd_d = #66FFFF
slowa = ta.ema(close,lma)
slowb = ta.ema(slowa,lma)
DEMAslow = ((2 * slowa) - slowb)
fasta = ta.ema(close,sma)
fastb = ta.ema(fasta,sma)
DEMAfast = ((2 * fasta) - fastb)
MACD = (DEMAfast - DEMAslow)
signala = ta.ema(MACD, tsp)
signalb = ta.ema(signala, tsp)
signal = ((2 * signala) - signalb)
hist = (MACD - signal)
//swap1 = MACDZeroLag>0?green:red
plot(hist,style=plot.style_columns, color=(hist>=0 ? (hist[1] < hist ? col_grow_above : col_fall_above) : (hist[1] < hist ? col_grow_below : col_fall_below)),title='HIST')
p1 = plot(lines?MACD:na,style = plot.style_line, color=(MACD[1] < MACD) ? col_macd_i : col_macd_d , linewidth =3,title='MACD')
p2 = plot(lines?signal:na, color=col_signal, linewidth =2,title='Signal')
hline(0)
Centered Oscillators
doubleema
Moving Average Convergence / Divergence (MACD)
macdivergence
开源脚本
本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受
网站规则
约束。 您可以收藏它以在图表上使用。
想在图表上使用此脚本?
添加到收藏
shawn4812
关注
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在
使用条款
阅读更多信息。