MCDX indicator For ThinkOrSwim

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

I like to use the MCDX indicator in Trading View,
https://www.tradingview.com/script/u2dIgVpN-M2J-Indicator-MCDX/
it very useful to track the smart money flow, but it is not exist in TOS,
check out the code below.

CSS:
#// © Mango2Juice
#// MCDX is an indicator based on mutilple relative strength index (RSI) with different period, then classify into 3 categories - Retailer, Hot Money and Banker
#// Green - Retailer
#// Yellow - Hot money
#// Red - Banker
#// the higher and many reds are more preferable
# study("[M2J] Indicator | MCDX", "MCDX")
# Converted by Sam4Cok@Samer800 - 11/2022
declare lower;
input RSIBaseBanker       = 50; # "Banker Base",           minval = 10)
input RSIPeriodBanker     = 50; # "Banker RSI Period",     minval = 10)
input RSIBaseHotMoney     = 30; # "Hot Money RSI Base",    minval = 10)
input RSIPeriodHotMoney   = 40; # "Hot Money RSI Period",  minval = 10)
input SensitivityBanker   = 1.5;# "Sensitivity Banker",    minval = 0.1, step = 0.1)
input SensitivityHotMoney = 0.7;# "Sensitivity Hot Money", minval = 0.1, step = 0.1)

def na = Double.NaN;
#rsi_function(sensitivity, rsiPeriod, rsiBase) =>
script rsi_function {
input sensitivity = 0;
input rsiPeriod = 14;
input rsiBase = 0;
    def rsi = sensitivity * (rsi(Length=rsiPeriod) - rsiBase);
    def nRSI;
    if rsi > 20 {
        nrsi = 20;
    } else {  
 if rsi < 0 {
        nrsi = 0;
    } else {
        nrsi = rsi;
}}
   plot result = nrsi;
}

def rsi_Banker   = rsi_function(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);

plot "5" = if(isNaN(close),na,5);#, "5" , color.silver,  2, editable = false)
"5".SetDefaultColor(Color.GRAY);
"5".SetLineWeight(2);
plot "10" = if(isNaN(close),na,10);#, "10", color.fuchsia, 2, editable = false)
"10".SetDefaultColor(Color.MAGENTA);
"10".SetLineWeight(2);
plot "15" = if(isNaN(close),na,15);#, "15", color.silver,  2, editable = false)
"15".SetDefaultColor(Color.GRAY);
"15".SetLineWeight(2);

plot Banker = if(isNaN(close),na,rsi_Banker);#,   "Banker",    #ff0000, 6, plot.style_histogram)
Banker.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Banker.SetDefaultColor(CreateColor(255,0,0));

plot HotMoney = if(isNaN(close),na,rsi_HotMoney);#, "Hot Money", #d8c200, 6, plot.style_histogram)
HotMoney.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
HotMoney.SetDefaultColor(CreateColor(216,194,0));

plot Retailer = if(isNaN(close),na,20);# "Retailer",  #005e07, 6, plot.style_histogram)
Retailer.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Retailer.SetDefaultColor(CreateColor(0,94,7));

#--- END Code
 
Last edited by a moderator:
MCDX is an indicator based on mutilple relative strength index (RSI) with different period, then classify into 3 categories - Retailer, Hot Money and Banker
  • Green - Retailer
  • Yellow - Hot money
  • Red - Banker

the higher and many reds are more preferable

the link:https://www.tradingview.com/script/u2dIgVpN-M2J-Indicator-MCDX/
find below

https://usethinkscript.com/threads/mcdx-indicator-for-thinkorswim.12010/#post-111741


CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © Mango2Juice
#// MCDX is an indicator based on mutilple relative strength index (RSI) with different period, then classify into 3 categories - Retailer, Hot Money and Banker
#// Green - Retailer
#// Yellow - Hot money
#// Red - Banker
#// the higher and many reds are more preferable
#study("[M2J] Indicator | MCDX", "MCDX")
# converted by Sam4Cok@Samer800
declare lower;
input rsiBaseBanker       = 50;        # "Banker Base"
input rsiPeriodBanker     = 50;        # "Banker RSI Period"
input rsiBaseHotMoney     = 30;        # "Hot Money RSI Base"
input rsiPeriodHotMoney   = 40;        # "Hot Money RSI Period"
input SensitivityBanker   = 1.5;       # "Sensitivity Banker"
input SensitivityHotMoney = 0.7;       # "Sensitivity Hot Money"

def na = Double.NaN;
def last = isNaN(close);
#-- Color--
DefineGlobalColor("Retail", CreateColor(0,94,7));
DefineGlobalColor("Hot", CreateColor(216,194,0));
DefineGlobalColor("Banker", CreateColor(255,0,0));
#rsi_function(sensitivity, rsiPeriod, rsiBase) =>
script rsi_function {
input sensitivity = 1.5;
input rsiPeriod = 50;
input rsiBase = 50;
    def rsiValue;
    def rsi_ = rsi(Price=close,Length= rsiPeriod);
    def nRSI = sensitivity * (rsi_ - rsiBase);

    if nRSI > 20 {
        rsiValue = 20;
    } else
    if nRSI < 0 {
        rsiValue = 0;
    } else {
        rsiValue = nRSI;
}
    plot out = rsiValue;
}

def rsi_Banker   = rsi_function(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);

plot "5" = if last then na else 5;
plot "10" = if last then na else 10;
plot "15" = if last then na else 15;
"5".SetDefaultColor(Color.WHITE);
"10".SetDefaultColor(Color.MAGENTA);
"15".SetDefaultColor(Color.WHITE);

plot Banker = rsi_Banker;                    # "Banker"
plot HotMoney = rsi_HotMoney;                # "Hot Money"
plot Retailer = if last then na else 20;     # "Retailer"
Retailer.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
HotMoney.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Banker.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);


Retailer.SetDefaultColor(GlobalColor("Retail"));
HotMoney.SetDefaultColor(GlobalColor("Hot"));
Banker.SetDefaultColor(GlobalColor("Banker"));



#-- END of CODE
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
504 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