Hello!
The thinkorswim platform has a reverse engineering RSI and MACD indicator and I was wondering if someone could create a reverse engineering relative momentum index indicator for the upper chart. Below is the thinkorswim RMI code. Thanks in advance!
declare lower;
input length = 20;
input momentum = 5;
Assert(momentum > 0, "'momentum' must be positive: " + momentum);
def emaInc = ExpAverage(Max(close - close[momentum], 0), length);
def emaDec = ExpAverage(Max(close[momentum] - close, 0), length);
plot RMI = if emaDec == 0 then 0 else 100 - 100 / (1 + emaInc / emaDec);
plot OverBought = 70;
plot OverSold = 30;
The thinkorswim platform has a reverse engineering RSI and MACD indicator and I was wondering if someone could create a reverse engineering relative momentum index indicator for the upper chart. Below is the thinkorswim RMI code. Thanks in advance!
declare lower;
input length = 20;
input momentum = 5;
Assert(momentum > 0, "'momentum' must be positive: " + momentum);
def emaInc = ExpAverage(Max(close - close[momentum], 0), length);
def emaDec = ExpAverage(Max(close[momentum] - close, 0), length);
plot RMI = if emaDec == 0 then 0 else 100 - 100 / (1 + emaInc / emaDec);
plot OverBought = 70;
plot OverSold = 30;