Momentum Dashboard For ThinkOrSwim

T

Tostechnical

Guest
So I have seen the work people have done with CSA which is amazing, however I does not work for me because it has too many indicators and I like to see each individual signal. So I created my own simple one that combines Heikin ashi, trend, momentum and Volatility. I was going to add RSI Laguerre and TMO but for my type of trading, swing trading on the daily chart, the more traditional indicators where better suited.

From the top row to bottom.

Heikin Ashi candle color

Simpler Trading 34 EMA wave Grab candle color, indicator is available on this forum.
Impulse indicator: standard MACD histogram with an 8 period EMA.

Bollinger Bands: Dashes: close is between bands, Points: close is outside bands. Red current bandwidth is less than previous bandwidth and previous bandwidth is less than its previous bandwidth. Orange current bandwidth is greater than previous bandwidth. Magenta current bandwidth is greater than previous bandwidth and previous bandwidth is greater than its previous bandwidth.

Relative volatility Index: replaced keltner channel

The typical Elder Impulse system uses 13 EMA with a longer term EMA 5x its length, 65 EMA. However, I liked the 34 EMA Wave GraB for the overall trade and 34/5 is 6.8 but I decided to stick with an 8 EMA, similar to Slimmer Ribbon. I also used this side by side with a weekly chart.

Hope one of you guys could benefit from this.


Code:
declare lower;
input agg   = AggregationPeriod.DAY;
input usehigheraggperiod = {default "Current", "Higher"};
def curr = if !IsNaN(close) then 1 else 0;
def o;
def h;
def c;
def l;
switch (usehigheraggperiod){
case Current:

    o = open;

    h = high;

    l = low;

    c = close;
case Higher:

    o = open(period = agg);

    h = high(period = agg);

    l = low(period = agg);

    c = close(period = agg);

}
def price = c;
########################################heikin ASHI
plot HASeperator = if !curr then Double.NaN else 1.375;
HASeperator.AssignValueColor(Color.WHITE);
HASeperator.SetLineWeight(2);
def haclose = (h + c + l + o) / 4;
def haopen = (haopen[1] + haclose[1]) / 2;

plot HA = if !curr then Double.NaN else 1.25;
HA.SetPaintingStrategy(PaintingStrategy.POINTS);
HA.AssignValueColor(if haclose > haopen then Color.GREEN else if haclose < haopen then Color.RED  else Color.BLUE);
HA.SetLineWeight(5);


##############################################RSI Laguerre
def ema1 = movavgExponential (h, 34);
def ema2 = movavgExponential (c, 34);
def ema3 = movavgExponential (l, 34);

plot Grab = if !curr then Double.NaN else if c < ema1 and c > ema3 then double.NaN else 1;
#Grab.AssignValueColor(if c > ema1 and o < c then Color.GREEN
#  else if c > ema1 and o >= c then Color.DARK_GREEN
#  else if c < ema3 and o <= c then Color.dark_RED
#  else if c < ema3 and o > c then Color.RED
#  else if o < c then Color.CYAN
#  else if o >= c then Color.BLUE
#  else Color.BLUE);

Grab.AssignValueColor(if c > ema1  then Color.GREEN
  else if c < ema3 then Color.RED
  else Color.BLUE);

Grab.SetPaintingStrategy(PaintingStrategy.POINTS);
Grab.SetLineWeight(5);
plot momSeperator = if !curr then Double.NaN else 1.125;
momSeperator.AssignValueColor(Color.WHITE);
momSeperator.SetLineWeight(2);
################################################Impulse
input impulseMA_length = 8;

def EMA = expAverage(c, impulseMA_length);
def MACD = expAverage(c, 12) - expAverage(c, 26);
def MACDHist = MACD - expAverage(MACD, 9);
def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1];
def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1];

def Bullish = GreenPrice;
def Neutral = !GreenPrice and !RedPrice;
def Bearish = RedPrice;

plot impulse = if !curr then Double.NaN else if Neutral then Double.NaN else .75;
impulse.SetPaintingStrategy(PaintingStrategy.POINTS);
impulse.AssignValueColor(if GreenPrice then Color.GREEN else if RedPrice then Color.RED  else Color.BLUE);
impulse.SetLineWeight(5);

#############################################################3
############################################################

def displace = 0;
input length = 20;
input Num_Dev_Dn = -1;
input Num_Dev_up = 1;
input averageType = AverageType.EXPONENTIAL;

def sDev = StDev(data = price[-displace], length = length);
def MidLine = MovingAverage(averageType, data = price[-displace], length = length);
def LowerBand = MidLine + Num_Dev_Dn * sDev;
def UpperBand = MidLine + Num_Dev_up * sDev;
def width = (UpperBand - LowerBand) / MidLine * 100;
def volA = if (width > width[1]) and width[1] > width[2] and (c > upperband or c < lowerband) then 2 else if (width > width[1])  and (width[1] <= width[2]) and (c > upperband or c < lowerband) then 1 else if (c > upperband or c < lowerband) and (width < width[1]) and width[1] < width[2] then -2 else 0;
plot vol = if !curr then Double.NaN else if c < upperband and c > lowerband then Double.NaN else .5;
vol.SetPaintingStrategy(PaintingStrategy.POINTS);
vol.AssignValueColor(if (width > width[1]) and width[1] > width[2] then Color.MAGENTA else if (width > width[1])  and (width[1] <= width[2]) then Color.ORANGE else if (width < width[1]) and width[1] < width[2] then Color.RED  else Color.BLUE);
vol.SetLineWeight(5);


plot vol2 = if !curr then Double.NaN else if c> upperband or c < lowerband then Double.NaN else .5;
vol2.SetPaintingStrategy(PaintingStrategy.DASHES);
vol2.AssignValueColor(if (width > width[1]) and width[1] > width[2] then Color.MAGENTA else if (width > width[1])  and (width[1] <= width[2]) then Color.ORANGE else if (width < width[1]) and width[1] < width[2] then Color.RED  else Color.BLUE);
vol2.SetLineWeight(5);


plot volSeperator = if !curr then Double.NaN else .625;
volSeperator.AssignValueColor(Color.WHITE);
volSeperator.SetLineWeight(2);
#########################################Labels######################33
def stDevLength = 10;
def averageLength = 14;
def averageTypeRVI = AverageType.EXPONENTIAL;

def stDevHi = stDev(h, stDevLength);
def stDevLo = stDev(l, stDevLength);

def avgStDevHiUp = MovingAverage(averageTypeRVI, if h > h[1] then stDevHi else 0, averageLength);
def avgStDevHiDown = MovingAverage(averageTypeRVI, if h < h[1] then stDevHi else 0, averageLength);

def avgStDevLoUp = MovingAverage(averageTypeRVI, if l > l[1] then stDevLo else 0, averageLength);
def avgStDevLoDown = MovingAverage(averageTypeRVI, if l < l[1] then stDevLo else 0, averageLength);

def rviHi = if avgStDevHiUp + avgStDevHiDown == 0 then 50 else 100 * avgStDevHiUp / (avgStDevHiUp + avgStDevHiDown);
def rviLo = if avgStDevLoUp + avgStDevLoDown == 0 then 50 else 100 * avgStDevLoUp / (avgStDevLoUp + avgStDevLoDown);

def RVI = (rviHi + rviLo) / 2;

plot volKC = if !curr then Double.NaN else .25;
volKC.SetPaintingStrategy(PaintingStrategy.points);
volKC.AssignValueColor(if RVI > RVI[1] and RVI > 50 then color.green else if RVI> 50 and RVI <=RVI[1] then color.dark_green else if RVI < 50 and RVI <RVI[1] then color.red else if RVI < 50 and RVI >= RVI[1] then color.dark_red else Color.BLUE);
volKC.SetLineWeight(5);
 

asragov

Member
2019 Donor
VIP
Appreciate it - nice to see it laid out like that - do you have a thought to make a "summary" signal, which takes all of them into account for an overall signal?
 
T

Tostechnical

Guest
Appreciate it - nice to see it laid out like that - do you have a thought to make a "summary" signal, which takes all of them into account for an overall signal?
@asragov Yes I do plan on eventually doing that however I am a bit stuck on implementing the vol indicators into one signal. So any assistance would be much appreciated. Currently I just scan for a change in Impulse signal and look if the others confirm.
 

jaricarr

New member
@BenTen
Hi, tried to setup a scan using the wizard. The 2 indicators are RelativeVolatilityIndex and PriceAndVolumeTrend but it looks like it needs some adjustment done. Although the scan is set to meet all conditions, it only satisfies one of the two criteria for some reason.
The aggregation period is Daily. Please take a look. Thanks

https://drive.google.com/file/d/1shM_xhpb_3dgwHGJMAZCQCxatSD2fNQX/view?usp=sharing
https://drive.google.com/file/d/1xe0GB0MSVEKRUJKYozZ8uxC0PBksIH5V/view?usp=sharing

here is the code-
PriceAndVolumeTrend()."PVT" crosses above 0.5 within 5 bars and RelativeVolatilityIndex("average type" = "WEIGHTED")."RVI" crosses above 30 within 5 bars
 
Last edited:

MerryDay

Administrative
Staff member
Staff
VIP
@coolcat7fl Dashboards are problematic for use in scanners. It is better to follow @jaricarr's example and add each indicator to your scan separately.

@jaricarr Can you provide post a screenshot of chart that meets both criteria but doesn't show up in the scanner, in order for someone to troubleshoot the issue.
Unsure of how to upload screenshots to the forum, Here are directions.
 

jaricarr

New member
@MerryDay @BenTen
Hello, here is one that i found.
Thanks

eEVjABT.png
 

MerryDay

Administrative
Staff member
Staff
VIP
@chinks1980 Dashboards free up real estate. We can take as many indicators as we want and have them take up just one lower study.
They display a summary of the individual indicators. Each indicator can be googled'd to understand them in more depth.
 

Similar threads

Top