Waddah Attar Explosion V3 [NHK]

traderharikrishna · study · 51 行 · 点赞 1,344 · TradingView 原页

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

Pine Script

//@version=5
// @modified by HariKrishna for Forex 2022
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
//
 
// Modified for Crypto Market by ShayanKM
indicator('Waddah Attar Explosion V3 [NHK]', shorttitle='WAE3 [NHK]',overlay=false)
sensitivity = input(150, title='Sensitivity')
fastLength = input(20, title='FastEMA Length')
slowLength = input(40, title='SlowEMA Length')
channelLength = input(20, title='BB Channel Length')
mult = input(2.0, title='BB Stdev Multiplier')
deadzonemultiplier=input(3.7, title='DeadZone Multiplier')
showdeadzone=input(true,title='Show Dead Zone')
DEAD_ZONE = nz(ta.rma(ta.tr(true), 100)) * deadzonemultiplier
 
calc_macd(source, fastLength, slowLength) =>
    fastMA = ta.ema(source, fastLength)
    slowMA = ta.ema(source, slowLength)
    fastMA - slowMA
 
calc_BBUpper(source, length, mult) =>
    basis = ta.sma(source, length)
    dev = mult * ta.stdev(source, length)
    basis + dev
 
calc_BBLower(source, length, mult) =>
    basis = ta.sma(source, length)
    dev = mult * ta.stdev(source, length)
    basis - dev
 
t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1], fastLength, slowLength)) * sensitivity
 
e1 = calc_BBUpper(close, channelLength, mult)- calc_BBLower(close, channelLength, mult)
 
 
trendUp = t1 >= 0 ? t1 : 0
//trendDown = t1 < 0 ? -1 * t1 : 0
trendDown = t1 < 0 ?  t1 : 0
 
 
plot(trendUp, style=plot.style_columns, linewidth=1, color=trendUp < trendUp[1] ? color.new(#80daeb,0) : color.new(#00b7eb,0), title='UpTrend')
plot(trendDown, style=plot.style_columns, linewidth=1, color=trendDown < trendDown[1] ?color.new(#ff0090,0):color.new(#f984e5,0), title='DownTrend')
plot(e1, style=plot.style_line, linewidth=2, color=color.new(#00ff00, 0), title='+ExplosionLine')
plot(-e1, style=plot.style_line, linewidth=2, color=color.new(#ff0000, 0), title='-ExplosionLine')
 
d1=plot(showdeadzone?DEAD_ZONE:na, color=color.new(color.blue, 80), linewidth=1, style=plot.style_line, title='+DeadZoneLine')
d2=plot(showdeadzone?-DEAD_ZONE:na, color=color.new(color.blue,80), linewidth=1, style=plot.style_line, title='-DeadZoneLine')
fill(d1,d2,title='Dead Zone',color=color.new(color.blue,80))

← 返回列表