LazyBear's Intraday Momentum Index for Thinkorswim

netarchitech

netarchitech

Well-known member
VIP


Another TradingView port...Looking forward to thoughts, feedback, backtests, etc...

Here's some additional information regarding the Intraday Momentum Index, courtesy of LazyBear:
The Intraday Momentum Index (IMI), developed by Tushar Chande, is a cross-breed between RSI and Candlestick analysis. IMI determines the candle type that dominated the recent price action, using that to pinpoint the extremes in intraday momentum.

As the market tries to bottom after a sell off, there are gradually more candles with green bodies, even though prices remain in a narrow range. IMI can be used to detect this shift, because its values will increase towards 70. Similarly, as the market begins to top, there will be more red candles, causing IMI to decline towards 20. When the market is in trading range, IMI values will be in the neutral range of 40 to 60.
Also in this port are volatility band-based OB/OS, in addition to fixed OB/OS levels. You can also turn on/off EhlersSuperSmoothing...

Code:
# filename: _Intraday_Momentum_Index_LB_
# source: https://www.tradingview.com/script/3CufgHsc-Indicator-Intrady-Momentum-Index/

# Original idea and execution:
# Code by LazyBear

# initial port by netarchitech
# 2019.11.06

declare lower;

input length = 14; #IMI Length
input lengthMA = 6; #IMI MA Length
input mult = 2.0; #Volatility Bands Stdev Mult
input lengthBB = 20; #Volatility Bands Length
input applySmoothing = yes; #Smooth IMI
input lowBand = 10; #Smoothing LowerBand

def PI = 3.14159265359;

input data = close;
input lower = low; #Research Lower = Low?

def a1 = Exp(-PI * Sqrt(2) / lower);
def coeff2 = 2 * a1 * Cos(Sqrt(2) * PI / lower);
def coeff3 = - Power(a1, 2);
def coeff1 = 1 - coeff2 - coeff3;
def filt = coeff1 * (data + (data[1])) / 2 + coeff2 * (filt[1]) + coeff3 * (filt[2]);

def gains = if close > open then (gains[1]) + (close - open) else 0;
def losses = if close < open then (losses[1]) + (open - close) else 0;
def upt = Sum(gains, length);
def dnt = Sum(losses, length);

plot imi_essf = if applySmoothing then EhlersSuperSmootherFilter(100 * (upt / (upt + dnt)), lowBand) else 100 * (upt / (upt + dnt));
imi_essf.SetDefaultColor(Color.GREEN);
imi_essf.SetLineWeight(2);

def basisx = ExpAverage(imi_essf, lengthBB);
def devx = (mult * StDev(imi_essf, lengthBB));
def ulx = (basisx + devx);
def llx = (basisx - devx);

input over_bought = 70;
plot ob = over_bought;
ob.SetDefaultColor(Color.DARK_RED);
ob.SetStyle(Curve.FIRM);
ob.HideTitle();

input over_sold = 20;
plot os = over_sold;
os.SetDefaultColor(Color.DARK_GREEN);
os.SetStyle(Curve.FIRM);
os.HideTitle();

plot imi_ob = if imi_essf >= ulx then imi_essf else Double.NaN;
imi_ob.SetDefaultColor(Color.YELLOW);
imi_ob.SetLineWeight(3);
imi_ob.SetStyle(Curve.POINTS);
imi_ob.HideTitle();

plot imi_midline = (ob + os) / 2;
imi_midline.SetDefaultColor(Color.ORANGE);
imi_midline.SetLineWeight(1);
imi_midline.SetStyle(Curve.SHORT_DASH);
imi_midline.HideTitle();

plot imi_os = if imi_essf <= llx then imi_essf else Double.NaN;
imi_os.SetDefaultColor(Color.YELLOW);
imi_os.SetLineWeight(3);
imi_os.SetStyle(Curve.POINTS);
imi_os.HideTitle();

plot imi_average = ExpAverage(imi_essf, lengthMA);
imi_average.SetDefaultColor(Color.RED);
imi_average.SetLineWeight(2);

AddCloud(imi_essf, imi_average, Color.GREEN, Color.RED);

AddCloud(0, os, Color.DARK_GREEN, Color.DARK_GREEN);
AddCloud(ob, 100, Color.DARK_RED, Color.DARK_RED);
Good Luck and Good Trading :)
 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Well done with all the recent conversions. Keep it up!
 
H

HighBredCloud

Well-known member
VIP
@netarchitech How did I miss this one? Is OB 70 and OS 20? Never seen such a configuration before...
 
H

HighBredCloud

Well-known member
VIP
Yeah...that was what was specified in the original LazyBear TradingView code...

obLevel=input(70, "IMI static OB level")
osLevel=input(20, "IMI static OS level")
@netarchitech very interesting...I like to read about the theory behind it...I've seen 65 35 and read what that's a better RSI setting but never seen this before. I had it up shortly but looks like my ON Demand is lagging...I like the smoothness of it for a momentum type indicator.
 
H

HighBredCloud

Well-known member
VIP
@netarchitech exactly step at a time...Thanks for the link...will read about it and see how that indicator does against others you've made...When you get a chance check out that Schaff indicator and possible implementation to the PercentR_MAC that @vvcv posted...I've been testing it for the past hour or so and its very promising...
 
netarchitech

netarchitech

Well-known member
VIP
@HighBredCloud You're certainly welcome, as always :cool: Will do with the Schaff indicator...
 
T

TDowns34

New member
@netarchitech Hi - I downloaded this study over the weekend and really like what I see so far. I've tried to back test it by looking at a few dozen prior charts and the volatility based OB/OS (yellow dot) indicators look to be very useful. Question: do you know if or how much of a lag there is on the yellow dots? Are they near real time or back filled after a several candle delay? (sorry if this is a noob question).
Thank you!
 

Similar threads

Top