Just a label indicator I have been messing around with. Currently using 2 candles and showing the current candle value along with previous candle close value and will color green if higher, red if lower, and grey if no change. It will plot the values for 5 momentum indicators. RSI, MACD,MFI, CCI, and ROC. I have 3 settings for display purposes that you can select from. They are Big 5, Fast Scalping, and Trend Continuation. Big 5 shows all 5, Fast Scalping shows RSI, CCI, and ROC, and Trend Continuation shows RSI, MACD, and MFI. I created this just as a visual label to see how these traditional indicators are moving.
Code:
# === 2-Candle Momentum Labels with Presets + MRM ===
declare upper;
# =======================
# USER INPUTS
# =======================
input showLabels = yes;
input momentumPreset = {
default BIG_5,
FAST_SCALPING,
TREND_CONTINUATION
};
# =======================
# Preset Indicators
# Big 5 RSI · MACD · MFI · CCI · ROC
# Fast Scalping RSI · CCI · ROC
# Trend Continuation RSI · MACD · MFI
# =======================
input rsiLength = 14;
input mfiLength = 14;
input cciLength = 20;
input rocLength = 9;
# =======================
# INDICATORS
# =======================
def rsi = RSI(length = rsiLength);
def macdValue = MACD()."Value";
def mfi = MoneyFlowIndex(length = mfiLength)."MoneyFlowIndex";
def cci = CCI(length = cciLength);
def roc = RateOfChange(price = close, length = rocLength);
# =======================
# 2-CANDLE DIRECTION LOGIC
# =======================
def rsiUp = rsi > rsi[1];
def rsiDn = rsi < rsi[1];
def macdUp = macdValue > macdValue[1];
def macdDn = macdValue < macdValue[1];
def mfiUp = mfi > mfi[1];
def mfiDn = mfi < mfi[1];
def cciUp = cci > cci[1];
def cciDn = cci < cci[1];
def rocUp = roc > roc[1];
def rocDn = roc < roc[1];
# =======================
# PRESET SELECTION FLAGS
# =======================
def useRSI =
momentumPreset == momentumPreset.BIG_5 or
momentumPreset == momentumPreset.FAST_SCALPING or
momentumPreset == momentumPreset.TREND_CONTINUATION;
def useMACD =
momentumPreset == momentumPreset.BIG_5 or
momentumPreset == momentumPreset.TREND_CONTINUATION;
def useMFI =
momentumPreset == momentumPreset.BIG_5 or
momentumPreset == momentumPreset.TREND_CONTINUATION;
def useCCI =
momentumPreset == momentumPreset.BIG_5 or
momentumPreset == momentumPreset.FAST_SCALPING;
def useROC =
momentumPreset == momentumPreset.BIG_5 or
momentumPreset == momentumPreset.FAST_SCALPING;
# =======================
# LABELS (SEPARATE)
# =======================
AddLabel(
showLabels and useRSI,
"RSI " + Round(rsi, 0) + " → " + Round(rsi[1], 0),
if rsiUp then Color.GREEN else if rsiDn then Color.RED else Color.GRAY
);
AddLabel(
showLabels and useMACD,
"MACD " + Round(macdValue, 2) + " → " + Round(macdValue[1], 2),
if macdUp then Color.GREEN else if macdDn then Color.RED else Color.GRAY
);
AddLabel(
showLabels and useMFI,
"MFI " + Round(mfi, 0) + " → " + Round(mfi[1], 0),
if mfiUp then Color.GREEN else if mfiDn then Color.RED else Color.GRAY
);
AddLabel(
showLabels and useCCI,
"CCI " + Round(cci, 0) + " → " + Round(cci[1], 0),
if cciUp then Color.GREEN else if cciDn then Color.RED else Color.GRAY
);
AddLabel(
showLabels and useROC,
"ROC " + Round(roc, 2) + " → " + Round(roc[1], 2),
if rocUp then Color.GREEN else if rocDn then Color.RED else Color.GRAY
);
Last edited by a moderator: