ZERO LAG MACD WITH BOLLINGER BANDS.
I watch for an crossunder the bands or zero level to take trades its very responsive.
I watch for an crossunder the bands or zero level to take trades its very responsive.
Code:
# Zero Lag MACD With Bollinger Bands
# Mobius
# V01.01.2018 Chat Room Request .0.19.2018
declare lower;
input fastLength = 13;
input slowLength = 34;
input MACDLength = 13;
input showBreakoutSignals = yes;
script EMA{
input length = 10;
input price = close;
def K = 2 / (length + 1);
def lag = (length - 1) / 2;
def ZLEMA = K * (2 * price - price[lag]) + (1 - K) * ZLEMA[1];
plot data = ZLEMA;
}
plot Value = EMA(length = fastLength) - EMA(length = slowLength);
def Avg = EMA(length = MACDLength, price = value);
plot Diff = Value - Avg;
def SD = StDev(Diff, MACDLength);
plot upper = Diff + SD;
plot lower = Diff - SD;
plot ZeroLine = 0;
Value.SetPaintingStrategy(PaintingStrategy.Line_Vs_Points);
Value.AssignValueColor(if Value > Value[1]
then color.green
else color.red);
Diff.SetStyle(Curve.Short_Dash);
Diff.SetLineWeight(1);
Diff.SetDefaultColor(color.gray);
upper.SetDefaultColor(color.gray);
lower.SetDefaultColor(color.gray);
ZeroLine.SetDefaultColor(GetColor(0));
ZeroLine.HideBubble();
ZeroLine.HideTitle();
# End Code Zero Lag MACD