Multi Momentum lower indicator w/AGAIG signal
This is something I created that focuses on the MACD, RSI, and MFI thus the MRM name.
Its looking increasing or decreasing values in those 3 indicators and when 2 of the 3 are increasing it will plot a 1/2 bar and when all three are present a full bar. Also it has 3 configurable ema's that will plot a label when they are stacked with a bar count as well.
Also A+ conditions are considered price is above last, all three momentum indicators are aligned higher, and above VWAP. Reverse that for puts. Also I embedded AGAIG from @csricksdds into the mix as well. I use this for scalping and have it on my 5, 3, and 1.
1 minute chart after hours
This is something I created that focuses on the MACD, RSI, and MFI thus the MRM name.
Its looking increasing or decreasing values in those 3 indicators and when 2 of the 3 are increasing it will plot a 1/2 bar and when all three are present a full bar. Also it has 3 configurable ema's that will plot a label when they are stacked with a bar count as well.
Also A+ conditions are considered price is above last, all three momentum indicators are aligned higher, and above VWAP. Reverse that for puts. Also I embedded AGAIG from @csricksdds into the mix as well. I use this for scalping and have it on my 5, 3, and 1.
1 minute chart after hours
Code:
# =========================================================
# === MOMENTUM INDICATOR USING MCAD RSI AND MONEY FLOW INDEX
# === ALSO CONTAINS AS GOOD AS IT GETS AGAIG FROM @csricksdds CODE FOR REVERSALS
# =========================================================
declare lower;
declare real_size;
# =========================================================
# === USER INPUTS (EMA CONTROL)
# =========================================================
input fastLength = 5;
input shortLength = 9;
input midLength = 21;
# =========================================================
# === AS GOOD AS IT GETS – ZIGZAG REVERSALS
# =========================================================
input atrReversal = 2.0;
input useAlerts = no;
def priceH = ExpAverage(high, 10);
def priceL = ExpAverage(low, 10);
def zigLow = ZigZagHighLow(
"price h" = priceH,
"price l" = priceL,
"percentage reversal" = 0.01,
"absolute reversal" = 0.05,
"atr length" = 5,
"atr reversal" = atrReversal
).lastL;
def zigHigh = ZigZagHighLow(
"price h" = priceH,
"price l" = priceL,
"percentage reversal" = 0.01,
"absolute reversal" = 0.05,
"atr length" = 5,
"atr reversal" = atrReversal
).lastH;
def zigLong = !IsNaN(zigLow);
def zigShort = !IsNaN(zigHigh);
AddVerticalLine(zigLong, "LONG", Color.GREEN, Curve.LONG_DASH);
AddVerticalLine(zigShort, "SHORT", Color.RED, Curve.LONG_DASH);
Alert(useAlerts and zigLong[1], "ZigZag LONG", Alert.BAR, Sound.Ding);
Alert(useAlerts and zigShort[1], "ZigZag SHORT", Alert.BAR, Sound.Ding);
# =========================================================
# === EMA DEFINITIONS (DYNAMIC)
# =========================================================
def emaFast = ExpAverage(close, fastLength);
def emaShort = ExpAverage(close, shortLength);
def emaMid = ExpAverage(close, midLength);
def bullFastShort = emaFast > emaShort;
def bearFastShort = emaFast < emaShort;
def bullStack = emaFast > emaShort and emaShort > emaMid;
def bearStack = emaFast < emaShort and emaShort < emaMid;
# =========================================================
# === VWAP
# =========================================================
def vwapValue = VWAP();
def aboveVWAP = close > vwapValue;
def belowVWAP = close < vwapValue;
# =========================================================
# === INDICATORS
# =========================================================
def macdValue = MACD()."Value";
def rsiValue = RSI()."RSI";
def mfiValue = MoneyFlowIndex()."MoneyFlowIndex";
# =========================================================
# === MOMENTUM CONDITIONS
# =========================================================
def macdBull = macdValue > macdValue[1];
def rsiBull = rsiValue > rsiValue[1];
def mfiBull = mfiValue > mfiValue[1];
def macdBear = macdValue < macdValue[1];
def rsiBear = rsiValue < rsiValue[1];
def mfiBear = mfiValue < mfiValue[1];
# =========================================================
# === CONDITION COUNTS (OUT OF 3)
# =========================================================
def bullCount =
(if macdBull then 1 else 0) +
(if rsiBull then 1 else 0) +
(if mfiBull then 1 else 0);
def bearCount =
(if macdBear then 1 else 0) +
(if rsiBear then 1 else 0) +
(if mfiBear then 1 else 0);
# =========================================================
# === A+ CONDITIONS
# =========================================================
def priceBull = close > close[1];
def priceBear = close < close[1];
def aPlusBull =
macdBull and rsiBull and mfiBull and priceBull and bullFastShort and aboveVWAP;
def aPlusBear =
macdBear and rsiBear and mfiBear and priceBear and bearFastShort and belowVWAP;
# =========================================================
# === 2 OF 3 STATES
# =========================================================
def bull2of3 =
bullCount == 2 and
bullFastShort and
!aPlusBull;
def bear2of3 =
bearCount == 2 and
bearFastShort and
!aPlusBear;
# =========================================================
# === EMA ALIGNMENT RUN COUNTS
# =========================================================
def bullRunFastShort =
if bullFastShort then
if !bullFastShort[1] then 1
else bullRunFastShort[1] + 1
else 0;
def bearRunFastShort =
if bearFastShort then
if !bearFastShort[1] then 1
else bearRunFastShort[1] + 1
else 0;
def bullRunStack =
if bullStack then
if !bullStack[1] then 1
else bullRunStack[1] + 1
else 0;
def bearRunStack =
if bearStack then
if !bearStack[1] then 1
else bearRunStack[1] + 1
else 0;
# =========================================================
# === HISTOGRAM OUTPUT (4 STATES)
# =========================================================
def histValue =
if aPlusBull then 2
else if bull2of3 then 1
else if bear2of3 then -1
else if aPlusBear then -2
else 0;
plot MomoHist = histValue;
MomoHist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
MomoHist.SetLineWeight(4);
MomoHist.AssignValueColor(
if histValue == 2 then Color.GREEN
else if histValue == 1 then Color.DARK_GREEN
else if histValue == -1 then Color.DARK_RED
else if histValue == -2 then Color.RED
else Color.DARK_GRAY
);
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.GRAY);
ZeroLine.SetLineWeight(1);
# =========================================================
# === LABELS (AUTO-UPDATE WITH EMA INPUTS)
# =========================================================
AddLabel(aPlusBull, "A+ LONG", Color.GREEN);
AddLabel(aPlusBear, "A+ SHORT", Color.RED);
AddLabel(bull2of3, "BULL 2 OF 3", Color.DARK_GREEN);
AddLabel(bear2of3, "BEAR 2 OF 3", Color.DARK_RED);
AddLabel(
bullRunFastShort > 0,
"EMA " + fastLength + "x" + shortLength + " BULL: " + bullRunFastShort,
Color.GREEN
);
AddLabel(
bearRunFastShort > 0,
"EMA " + fastLength + "x" + shortLength + " BEAR: " + bearRunFastShort,
Color.RED
);
AddLabel(
bullRunStack > 0,
"EMA " + fastLength + "x" + shortLength + "x" + midLength + " BULL: " + bullRunStack,
Color.DARK_GREEN
);
AddLabel(
bearRunStack > 0,
"EMA " + fastLength + "x" + shortLength + "x" + midLength + " BEAR: " + bearRunStack,
Color.DARK_RED
);
Last edited by a moderator: