Smart Money Interest Index [AlgoAlpha] for ThinkOrSwim

samer800

Moderator - Expert
VIP
Lifetime
OJI6Imw.png

Author Message:

Smart Money Interest Index indicator, designed meticulously by AlgoAlpha to revolutionize the way you trade! 📈🧠 This indicator is engineered to decipher the activities of smart money investors relative to the less informed (dumb money) and dynamically display their dominance in the trading landscape through a sophisticated visual index. 🚀💹

Read More: https://www.tradingview.com/v/oBwmJW5g/

Code:
CSS:
#https://www.tradingview.com/v/oBwmJW5g/
#// This Pine Scriptâ„¢ code is subject to the terms of the Mozilla Public License 2.0
#// © AlgoAlpha
#indicator("Smart Money Interest Index [AlgoAlpha]", "AlgoAlpha - ? Smart Money", explicit_plot_zorder = true)
# Converted by Sam4Cok@Samer800    - 04/2024

declare zerobase;
declare lower;

input colorBars = yes;
input IndexPeriod = 25;          # "Index Period", minval = 1)
input VolumeFlowPeriod = 14;     # "Volume Flow Period", minval = 1)
input NormalizationPeriod = 500; # "Normalization Period", minval = 1)
input HighInteresThreshold = 0.9; #, "High Interes Threshold", minval = 0.01, maxval = 0.99)

def na = Double.NaN;
def last = isNaN(close);
DefineGlobalColor("green", CreateColor(0,255,187));
DefineGlobalColor("red", CreateColor(100, 0, 0));
#// Positive Volume Index
#// the same on pine

Script f_pvi {
input src = close;
input vol = volume;
    def last = isNaN(close);
    def nzSrc  = if(isNaN(src), 0.0, src);
    def nzSrc1 = if(isNaN(src[1]), 0.0, src[1]);
    def nzVol  = if(isNaN(vol), 0.0, vol);
    def nzVol1 = if(isNaN(vol[1]), 0.0, vol[1]);
    def ta_pvi;
    def prevPvi = if (if(isNaN(ta_pvi[1]), 0.0, ta_pvi[1]) == 0.0) then 1.0 else ta_pvi[1];
    if nzSrc == 0.0 or nzSrc1 == 0.0 {
        ta_pvi = prevPvi;
    } else {
        ta_pvi = if nzVol > nzVol1 then prevPvi + ((nzSrc - nzSrc1) / nzSrc1) * prevPvi else prevPvi;
    }
    plot f_pvi  = if last then Double.NaN else if ta_pvi<=0 then 1 else ta_pvi;
}
#// Negative Volume Index
Script f_nvi {
input src = close;
input vol = volume;
    def last = isNaN(close);
    def nzSrc  = if(isNaN(src), 0.0, src);
    def nzSrc1 = if(isNaN(src[1]), 0.0, src[1]);
    def nzVol  = if(isNaN(vol), 0.0, vol);
    def nzVol1 = if(isNaN(vol[1]), 0.0, vol[1]);
    def ta_nvi;
    def prevNvi = if (if(isNaN(ta_nvi[1]), 0.0, ta_nvi[1]) == 0.0) then 1.0 else ta_nvi[1];
    if nzSrc == 0.0 or nzSrc1 == 0.0 {
        ta_nvi = prevNvi;
    } else {
         ta_nvi = if nzVol < nzVol1 then prevNvi + ((nzSrc - nzSrc1) / nzSrc1) * prevNvi else prevNvi;
    }
    plot f_nvi  = if last then Double.NaN else if ta_nvi <=0 then 1 else ta_nvi;
}
def pvi = f_pvi();
def nvi = f_nvi();
def dumb  = pvi - ExpAverage(pvi, 255);
def smart = nvi - ExpAverage(nvi, 255);

def drsi = rsi(Price = dumb,  Length = VolumeFlowPeriod);
def srsi = rsi(Price = smart, Length = VolumeFlowPeriod);
#//ratio shows if smart money is buying from dumb money selling and vice versa
def r = srsi / drsi;
def sums = sum(r, IndexPeriod);
def peak = highest(sums, NormalizationPeriod);
def index = sums / peak;
def bottom = if last then na else 0;
def top = if last then na else Double.POSITIVE_INFINITY;
def thresh = if last then na else HighInteresThreshold;

def SMII = index; # Smart Money Interest Index

def lvl1 = thresh * 3/4;
def lvl2 = thresh / 2;
def lvl3 = thresh / 4;
#-- Cloud and bar color
AddCloud(top, thresh, Color.DARK_ORANGE, Color.DARK_ORANGE, yes);
AddCloud(thresh, SMII, GlobalColor("red")); #, GlobalColor("red"), yes);
AddCloud(lvl1, SMII, GlobalColor("red"));#, GlobalColor("red"), yes);
AddCloud(lvl2, SMII, GlobalColor("red")); #, GlobalColor("red"), yes);
AddCloud(lvl3, SMII, GlobalColor("red")); #, GlobalColor("red"), yes);
AddCloud(SMII, bottom, GlobalColor("green"), GlobalColor("green"), yes);

AssignPriceColor(if !colorBars then Color.CURRENT else if SMII > thresh then Color.CYAN else Color.CURRENT);

#-- END of CODE
 
Is this smart money interest index good for intraday trading? I trade on a 2 minute chart.
If so, what should my settings be? Thank you for your help.
 
Hi,
Thank you very much for sharing this study.
I had been using the condition of (SMII > HighInteresThreshold) to scan for symbols. However, the return was empty.
When I use the above condition to create a study it does show the condition can be met.
Is there a reason why I cannot use the scan to locate smart money in action now?
Thanks
 
Hi, sorry for the noob question, but the title of this post says "for ThinkOrSwim", but then it shows a link to tradingview and show pinescript. What am I missing?
 
OJI6Imw.png

Author Message:

Smart Money Interest Index indicator, designed meticulously by AlgoAlpha to revolutionize the way you trade! 📈🧠 This indicator is engineered to decipher the activities of smart money investors relative to the less informed (dumb money) and dynamically display their dominance in the trading landscape through a sophisticated visual index. 🚀💹

Read More: https://www.tradingview.com/v/oBwmJW5g/

Code:
CSS:
#https://www.tradingview.com/v/oBwmJW5g/
#// This Pine Scriptâ„¢ code is subject to the terms of the Mozilla Public License 2.0
#// © AlgoAlpha
#indicator("Smart Money Interest Index [AlgoAlpha]", "AlgoAlpha - ? Smart Money", explicit_plot_zorder = true)
# Converted by Sam4Cok@Samer800    - 04/2024

declare zerobase;
declare lower;

input colorBars = yes;
input IndexPeriod = 25;          # "Index Period", minval = 1)
input VolumeFlowPeriod = 14;     # "Volume Flow Period", minval = 1)
input NormalizationPeriod = 500; # "Normalization Period", minval = 1)
input HighInteresThreshold = 0.9; #, "High Interes Threshold", minval = 0.01, maxval = 0.99)

def na = Double.NaN;
def last = isNaN(close);
DefineGlobalColor("green", CreateColor(0,255,187));
DefineGlobalColor("red", CreateColor(100, 0, 0));
#// Positive Volume Index
#// the same on pine

Script f_pvi {
input src = close;
input vol = volume;
    def last = isNaN(close);
    def nzSrc  = if(isNaN(src), 0.0, src);
    def nzSrc1 = if(isNaN(src[1]), 0.0, src[1]);
    def nzVol  = if(isNaN(vol), 0.0, vol);
    def nzVol1 = if(isNaN(vol[1]), 0.0, vol[1]);
    def ta_pvi;
    def prevPvi = if (if(isNaN(ta_pvi[1]), 0.0, ta_pvi[1]) == 0.0) then 1.0 else ta_pvi[1];
    if nzSrc == 0.0 or nzSrc1 == 0.0 {
        ta_pvi = prevPvi;
    } else {
        ta_pvi = if nzVol > nzVol1 then prevPvi + ((nzSrc - nzSrc1) / nzSrc1) * prevPvi else prevPvi;
    }
    plot f_pvi  = if last then Double.NaN else if ta_pvi<=0 then 1 else ta_pvi;
}
#// Negative Volume Index
Script f_nvi {
input src = close;
input vol = volume;
    def last = isNaN(close);
    def nzSrc  = if(isNaN(src), 0.0, src);
    def nzSrc1 = if(isNaN(src[1]), 0.0, src[1]);
    def nzVol  = if(isNaN(vol), 0.0, vol);
    def nzVol1 = if(isNaN(vol[1]), 0.0, vol[1]);
    def ta_nvi;
    def prevNvi = if (if(isNaN(ta_nvi[1]), 0.0, ta_nvi[1]) == 0.0) then 1.0 else ta_nvi[1];
    if nzSrc == 0.0 or nzSrc1 == 0.0 {
        ta_nvi = prevNvi;
    } else {
         ta_nvi = if nzVol < nzVol1 then prevNvi + ((nzSrc - nzSrc1) / nzSrc1) * prevNvi else prevNvi;
    }
    plot f_nvi  = if last then Double.NaN else if ta_nvi <=0 then 1 else ta_nvi;
}
def pvi = f_pvi();
def nvi = f_nvi();
def dumb  = pvi - ExpAverage(pvi, 255);
def smart = nvi - ExpAverage(nvi, 255);

def drsi = rsi(Price = dumb,  Length = VolumeFlowPeriod);
def srsi = rsi(Price = smart, Length = VolumeFlowPeriod);
#//ratio shows if smart money is buying from dumb money selling and vice versa
def r = srsi / drsi;
def sums = sum(r, IndexPeriod);
def peak = highest(sums, NormalizationPeriod);
def index = sums / peak;
def bottom = if last then na else 0;
def top = if last then na else Double.POSITIVE_INFINITY;
def thresh = if last then na else HighInteresThreshold;

def SMII = index; # Smart Money Interest Index

def lvl1 = thresh * 3/4;
def lvl2 = thresh / 2;
def lvl3 = thresh / 4;
#-- Cloud and bar color
AddCloud(top, thresh, Color.DARK_ORANGE, Color.DARK_ORANGE, yes);
AddCloud(thresh, SMII, GlobalColor("red")); #, GlobalColor("red"), yes);
AddCloud(lvl1, SMII, GlobalColor("red"));#, GlobalColor("red"), yes);
AddCloud(lvl2, SMII, GlobalColor("red")); #, GlobalColor("red"), yes);
AddCloud(lvl3, SMII, GlobalColor("red")); #, GlobalColor("red"), yes);
AddCloud(SMII, bottom, GlobalColor("green"), GlobalColor("green"), yes);

AssignPriceColor(if !colorBars then Color.CURRENT else if SMII > thresh then Color.CYAN else Color.CURRENT);

#-- END of CODE


Great indicator. Thank you for the conversion. Any way of making this a scanner for stocks that are above 0.9 on the daily/4hr?
 
Is this smart money interest index good for intraday trading? I trade on a 2 minute chart.
If so, what should my settings be? Thank you for your help.
I wouldn't rely on the signals from this indicator solely, you'll need something else for confirmation. I used it today on a 5 minute chart and the signals weren't very good so I recommend to not take trades blindly with this and to always know where the stock is and where it is potentially headed.
 
Hi,
Thank you very much for sharing this study.
I had been using the condition of (SMII > HighInteresThreshold) to scan for symbols. However, the return was empty.
When I use the above condition to create a study it does show the condition can be met.
Is there a reason why I cannot use the scan to locate smart money in action now?
Thanks
Great indicator. Thank you for the conversion. Any way of making this a scanner for stocks that are above 0.9 on the daily/4hr?
can you provide a scan for when the smart players get in ?

@rkwchu is correct. Unfortunately, for whatever reason, after much testing, this script does not return any results in scanner.


Hi, sorry for the noob question, but the title of this post says "for ThinkOrSwim", but then it shows a link to tradingview and show pinescript. What am I missing?

The thinkscript code can be found: https://usethinkscript.com/threads/...-algoalpha-for-thinkorswim.18494/#post-140675
 
Samer I like the concept of the code but its best to add aggregation period to the code to best measure smart and dumb money periods and introduce them to scanners and watchlists. In this example when added to a watchlist, it shows as smart money buying is active yet unknown the period based on how it acts across all types of time series data. In this example, 2 hour candle smart money is not the same 30 day versus 2 years and many other combinations that are possible when introducing it when trading. Try to update the code to specify time aggregation in force to best find positive signals on watchlists/scan

545318
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
213 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top