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.
 

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
322 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