Smart Money Index (SMI) Indicator for ThinkorSwim?

S

spm009

New member
Hi friends! I'm learning to script and wanted to create a script that I think might be useful, however I can't seem to find anywhere for TOS.

It's a SMI aka Smart Money Index (https://en.m.wikipedia.org/wiki/Smart_money_index) popularized by Bloomberg.

I'm not looking for someone to do it for me, although that would be fine too as I could study it and backwards engineer it to learn.

I'm also looking for any indicators similar to an SMI or any TOS scans that might be useful like block trades, dark pools and unusual options. AFAIK thinkorswim should be capable of these things, correct? Look forward to interacting with all of you here!
 
C

chad

New member
Warehouse
Try Robert Payne. He is a master and good reputation in ToS scripts.
 
S

spm009

New member
Try Robert Payne. He is a master and good reputation in ToS scripts.
thanks! Is there a way we can tag members in a post in this forum? My bad for the newbie questions.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
I don’t think this is possible mostly because the data required isn’t being provided by ThinkorSwim. I could be wrong.

@spm009 You can tag someone by placing “@“ in front of the name.
 
H

horserider

Well-known member
VIP
Warehouse
Since the 2000 stock market top, the Smart Money Index has failed to keep pace with the major stock indexes (see Chart 1), while the two components of the Index have come to the forefront as useful indicators of market-direction. At the early 2003 market low, the cumulative change in the DJIA during the first half-hour of trading (we call this the EMC – Early Market Component) has been correctly calling the shots in market direction (see Chart 2), while the LMC, the Late Market Component (final hour change in DJIA), has helped with short term secondary trends.
 
S

spm009

New member
Since the 2000 stock market top, the Smart Money Index has failed to keep pace with the major stock indexes (see Chart 1), while the two components of the Index have come to the forefront as useful indicators of market-direction. At the early 2003 market low, the cumulative change in the DJIA during the first half-hour of trading (we call this the EMC – Early Market Component) has been correctly calling the shots in market direction (see Chart 2), while the LMC, the Late Market Component (final hour change in DJIA), has helped with short term secondary trends.
What would be ideal would be both charted in a single indicator.

The regular SMI (end of day) is still widely used by traders who have access to Bloomberg terminals and banks. See this article for example: https://www.cnbc.com/2019/01/14/the-smart-money-is-buying-this-market-comeback-in-force-classic-indicator-shows.html
 
Last edited:
S

spm009

New member
So it looks like there is a Smart Money Index version available for TradingView. Seems like it's possible for a port over then. https://www.tradingview.com/script/YyNeevML-Smart-Money-Index-SMI-Backtest/
Yes and this looks like the correct formula, its not a crazy indicator to make I think.


Code:
////////////////////////////////////////////////////////////
// Original script by HPotter
// MA50 added by:  Scilentor
// Edit: 7.7.2019
////////////////////////////////////////////////////////////
study(title="Smart Money Index (50)", shorttitle="SMI(50)")
xcloseH1 = security(tickerid, "60", close)
xopenH1 =  security(tickerid, "60", open)
nRes = nz(nRes[1], 1) - (open - close) + (xopenH1 - xcloseH1)
length1 = input(50, "MA_Len")
plot(nRes, color=green, linewidth=2, title="SMI")
plot(sma(nRes,length1), color=yellow, linewidth=1, title="MA50")
Hi @RobertPayne ... I'm learning to code and we would be interested with your help if you can guide us with the SMI indicator in this thread. Ideally would be great if we could have two lines (EMC – Early Market Component & LMC - Late Market Component).
 
Last edited:
D

diazlaz

Active member
VIP
Warehouse
Here you go:




Ruby:
#Smart Money Index (50) - SMI(50)
#
#CREDITS
#https://www.tradingview.com/script/YyNeevML-Smart-Money-Index-SMI-Backtest/
#https://www.tradingview.com/u/HPotter/

#CHANGELOG
#2019.11.02 @diazlaz Initial Port

declare lower;

input AggPeriod = AggregationPeriod.HOUR;
input length1  = 50; #MA_Len

def xcloseH1 = close(period = AggPeriod);
def xopenH1  = open(period = AggPeriod);
def nRes = CompoundValue(1, nRes[1] - (open - close) + (xopenH1 - xcloseH1), 1);


plot pSMI = nRes;
pSMI.AssignValueColor(COLOR.LIME);
pSMI.SetLineWeight(2);

plot pMA50 = Average(nRes, length1);
pMA50.AssignValueColor(COLOR.YELLOW);
 
Last edited by a moderator:
S

spm009

New member
Here you go:




Ruby:
#Smart Money Index (50) - SMI(50)
#
#CREDITS
#https://www.tradingview.com/script/YyNeevML-Smart-Money-Index-SMI-Backtest/
#https://www.tradingview.com/u/HPotter/

#CHANGELOG
#2019.11.02 @diazlaz Initial Port

declare lower;

input AggPeriod = AggregationPeriod.HOUR;
input length1  = 50; #MA_Len

def xcloseH1 = close(period = AggPeriod);
def xopenH1  = open(period = AggPeriod);
def nRes = CompoundValue(1, nRes[1] - (open - close) + (xopenH1 - xcloseH1), 1);


plot pSMI = nRes;
pSMI.AssignValueColor(COLOR.LIME);
pSMI.SetLineWeight(2);

plot pMA50 = Average(nRes, length1);
pMA50.AssignValueColor(COLOR.YELLOW);
You are so awesome haha! Was this hard to make? I want to learn to do this on my own.

Edit: I just plugged it in and not getting anything for some reason ... hmmm?
Ah, ok it doesn't seem to work on longer time frames.

Here's some info on the Bloomberg version:



The Bloomberg Smart Money Flow Index is calculated by taking the action of the Dow in two time periods: the first 30 minutes and the close. The first 30 minutes represent emotional buying, driven by greed and fear of the crowd based on good and bad news. There is also a lot of buying on market orders and short covering at the opening. Smart money waits until the end and they very often test the market before by shorting heavily just to see how the market reacts. Then they move in the big way. These heavy hitters also have the best possible information available to them and they do have the edge on all the other market participants. To replicate this index, just start at any given day, subtract the price of the Dow at 10 AM from the previous day's close and add today's closing price. Whenever the Dow makes a high which is not confirmed by the SMFI there is trouble ahead.
What would be ideal would perhaps be to add both versions in one indicator (EMC – Early Market Component & LMC - Late Market Component) like @horserider mentioned :)
 
Last edited:
H

horserider

Well-known member
VIP
Warehouse
OK need some explanation. How is this following the SMI formula.
The basic formula for SMI is:
Today's SMI reading = yesterday's SMI – opening gain or loss + last hour change
For example, the SMI closed yesterday at 10000. During the first 30 minutes of today's trading, the Dow Jones has gained a total of 100 points. During the final hour, the Dow Jones has lost 80 points. So, today's SMI is 10000 – 100 + -80 = 9820.

Looks like a good translation of the TV study but how does that one follow the formula?
Where is yesterday's SMI considered?
What about first 30 min ? And last hour?

If someone can explain please.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@horserider I still strongly believe that this still isn't the true Smart Money Index as it does not follow the original formula (I don't even know if the formula on the Wikipedia page is even it). Somebody on TradingView also pointed this out as well.

Nothing wrong with the conversion (thanks @diazlaz for your work), but that's not the SMI indicator that @spm009 is requesting.

Edit: Here is another version of SMI for Ninja Trader.
 
D

diazlaz

Active member
VIP
Warehouse
@horserider I still strongly believe that this still isn't the true Smart Money Index as it does not follow the original formula (I don't even know if the formula on the Wikipedia page is even it). Somebody on TradingView also pointed this out as well.

Nothing wrong with the conversion (thanks @diazlaz for your work), but that's not the SMI indicator that @spm009 is requesting.

Edit: Here is another version of SMI for Ninja Trader.
thanks everyone, I coded it up from a formula prospective it looked interesting and didn't take a lot of cycles. I quickly eye the c# on ninja version, it looks close, similar formula structure, however I didn't go deep into it.

if anyone finds edge on it please let us know ;)
 
S

spm009

New member
I'm going to try look into these, but my coding experience is kind of weak because I'm a newbie... Hopefully we can tweak these can make it into a great indicator
 
S

spm009

New member
Since the 2000 stock market top, the Smart Money Index has failed to keep pace with the major stock indexes (see Chart 1), while the two components of the Index have come to the forefront as useful indicators of market-direction. At the early 2003 market low, the cumulative change in the DJIA during the first half-hour of trading (we call this the EMC – Early Market Component) has been correctly calling the shots in market direction (see Chart 2), while the LMC, the Late Market Component (final hour change in DJIA), has helped with short term secondary trends.
@horserider How do you think we can incorporate LMC and EMC into this study? Seems like we're almost there.
 
H

horserider

Well-known member
VIP
Warehouse
@spm009 Sorry no idea. My thought is the indicator here and on TV is not the SMI.
Maybe this weekend I can look at it.
 
S

spm009

New member
@diazlaz So I think I gave the wrong link previously... this seems to be the correct link for the SMI study on TV. The one you worked off of seems to be a backtest. https://www.tradingview.com/script/PQEvcezt-Smart-Money-Index-SMI/

For some reason the study seems to be inverted when graphed, but most cases I've seen it, it runs parallel with SPX or DJI, but I have seen a few where it's inverted. I'm going to include some photos for reference:





My coding skills are limited, but I examined the TV code and the Ninja code and they seem similar. I think we are on the right track here.

The best version of this indicator would include EMC (dumb money) and LMC (smart money) like @horserider mentioned to compare along with a DJI or SPX graph superimposed to compare.
 

Top