Loken (v4) Bullish Smart Money for ThinkOrSwim

great indicator can it be put into MTF version?

@samer800 is it possible to have this as an mtf version thanks
 
Last edited by a moderator:
great indicator can it be put into MTF version?

@samer800 is it possible to have this as an mtf version thanks
check the below

CSS:
# https://www.tradingview.com/v/DlWtErRh/
#// © LOKEN94
#// Custom version based of [M2J] Indicator | MCDX
#study("LOKEN ? (v4) BULLISH MCDX v2.2", "?",precision=2)
# Converted by Sam4Cok@Samer800    - 09/2023
# Updated by Sam4Cok@Samer800    - 11/2023 - added MTF option
declare lower;
#declare zerobase;
input timeframe = {Default "Chart", "Custom"};
input customTimeframe = AggregationPeriod.FIFTEEN_MIN;
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"
input threshold = 8.5;

def na = Double.NaN;
def last = isNaN(Close);
def chart = timeframe==timeframe."Chart";
def c = if chart then close else close(Period = customTimeframe);
def v = if chart then volume else volume(Period = customTimeframe);

DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    input v_ = volume;
    def v = if isNaN(v_) then 1 else v_;
    def srcV = src * v;
    def VWMA = Average(srcV, len) / Average(v, len);
    plot result = VWMA;
}
#rsi_function(sensitivity, rsiPeriod, rsiBase) =>
script rsi_function {
    input src = close;
    input sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = src, Length = rsiPeriod);
    def rsi_ = sensitivity * (nRSI - rsiBase);
    def rsi = if rsi_ > 20 then 20 else
              if rsi_ < 0 then 0 else rsi_;
    plot out = rsi;
}

def rsi_Banker   = rsi_function(c, SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(c, SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);
def hot  = rsi_HotMoney;
def bank = rsi_Banker;
def hotMoney = hot;#, "Hot Money"

def hotma2   = WildersAverage(hot, 2);
def bankma2  = Average(bank, 2);
def hotma7   = WildersAverage(hot, 7);
def bankma7  = ExpAverage(bank, 7);
def hotma31  = WildersAverage(hot, 31);
def bankma31 = ExpAverage(bank, 31);

def hotma  = ExpAverage(((hotma2 * 34) + (hotma7 * 33) + (hotma31 * 33)) / 100, 2);
def bankma = Average(((bankma2 * 70) + (bankma7 * 20) + (bankma31 * 10)) / 100, 2);
def hotsignal  = WildersAverage(hotma, 2);
def banksignal = WildersAverage(bankma, 4);

def hotline = hotma; # "Hot Money MA"
def bankline = bankma;# "Banker MA"
def hotline2 = hotsignal;# "Hot Money MA2"
def bankline2 = banksignal; # "Banker MA2"
#//
AddCloud(hotline , hotline2, Color.DARK_GREEN, Color.DARK_RED);
AddCloud(bankline, bankline2, Color.VIOLET, Color.DARK_ORANGE);
AddCloud(hot, hotline, Color.GREEN, Color.RED);

#//
def hbAvg = ((hot*10)+(hotma*35)+(hotsignal*15)+(bankma*35)+(banksignal* 5))/ 100;
def hbma = vwma(hbAvg, 2, v);

plot HBMA2 = hbma; # "Trend Tracker"
HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);
plot h1 = if last then na else threshold;#, "Bullish Confirmation Line"
h1.SetDefaultColor(Color.GRAY);
h1.SetStyle(Curve.SHORT_DASH);

#//Crossing signals

def downtrendsignal = Crosses(hotma, hotsignal, CrossingDirection.BELOW);
def uptrendsignal = Crosses(hotma, hotsignal, CrossingDirection.ABOVE);
  

plot dnSig = if downtrendsignal then hbma else na;# "Downtrend signal"
plot upSig = if uptrendsignal  then hbma else na; # "Uprend signal"
dnSig.SetStyle(Curve.POINTS);
upSig.SetStyle(Curve.POINTS);
dnSig.SetDefaultColor(Color.RED);
upSig.SetDefaultColor(Color.GREEN);

def dnCond = Bank<Bank[1] and Bank<Bank[2] and Bank[1]<Bank[2] and Bank<Bank[3] and Bank<Bank[4] and Bank[3]<Bank[4] and Bank[6]>8.5 and Bank<10;

plot Dump = if Bank<Bank[1]/1.75 then Bank else na;#, "Dump Candles"
plot DnCandle = if dnCond then Bank else na;#, "Down Candles"
plot PumpCandle = if Bank>hbma then Bank else na;# "Pump Candles"
plot Retest = if banksignal>bankma and Bank>0 then Bank else na; # "Retest Candles"

Dump.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Retest.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
PumpCandle.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
DnCandle.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Dump.SetDefaultColor(Color.RED);
Retest.SetDefaultColor(Color.DARK_RED);
PumpCandle.SetDefaultColor(Color.GREEN);
DnCandle.SetDefaultColor(Color.DARK_GRAY);

plot Banker = bank;#,   "Banker"
Banker.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Banker.AssignValueColor(if bank > 0 then GlobalColor("nor") else Color.DARK_GRAY);



#-- END of CODE
 
This is the best indicator on this entire forum IMHO. The more you look at it, the more you realize it's revealing to you...

I still think this is one of the best indicators on this forum. I've been looking at it for weeks now. I noticed a few opportunities it presents and I'll share a simple on here. Whenever the HBMA line is below a certain point, if you see the red cloud that's typically above it dip below it, it's presenting you with a possible scalp opportunity.

As seen in the image I've attached.

I still love this indicator. It works really well with "discretion trading", but I haven't yet been able to quantify why I'm able to make such good decisions with it in a rules based system for back-testing purposes.
 

Attachments

  • image (7).png
    image (7).png
    27.3 KB · Views: 927
Last edited by a moderator:
check the below

CSS:
# https://www.tradingview.com/v/DlWtErRh/
#// © LOKEN94
#// Custom version based of [M2J] Indicator | MCDX
#study("LOKEN ? (v4) BULLISH MCDX v2.2", "?",precision=2)
# Converted by Sam4Cok@Samer800    - 09/2023
# Updated by Sam4Cok@Samer800    - 11/2023 - added MTF option
declare lower;
#declare zerobase;
input timeframe = {Default "Chart", "Custom"};
input customTimeframe = AggregationPeriod.FIFTEEN_MIN;
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"
input threshold = 8.5;

def na = Double.NaN;
def last = isNaN(Close);
def chart = timeframe==timeframe."Chart";
def c = if chart then close else close(Period = customTimeframe);
def v = if chart then volume else volume(Period = customTimeframe);

DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    input v_ = volume;
    def v = if isNaN(v_) then 1 else v_;
    def srcV = src * v;
    def VWMA = Average(srcV, len) / Average(v, len);
    plot result = VWMA;
}
#rsi_function(sensitivity, rsiPeriod, rsiBase) =>
script rsi_function {
    input src = close;
    input sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = src, Length = rsiPeriod);
    def rsi_ = sensitivity * (nRSI - rsiBase);
    def rsi = if rsi_ > 20 then 20 else
              if rsi_ < 0 then 0 else rsi_;
    plot out = rsi;
}

def rsi_Banker   = rsi_function(c, SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(c, SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);
def hot  = rsi_HotMoney;
def bank = rsi_Banker;
def hotMoney = hot;#, "Hot Money"

def hotma2   = WildersAverage(hot, 2);
def bankma2  = Average(bank, 2);
def hotma7   = WildersAverage(hot, 7);
def bankma7  = ExpAverage(bank, 7);
def hotma31  = WildersAverage(hot, 31);
def bankma31 = ExpAverage(bank, 31);

def hotma  = ExpAverage(((hotma2 * 34) + (hotma7 * 33) + (hotma31 * 33)) / 100, 2);
def bankma = Average(((bankma2 * 70) + (bankma7 * 20) + (bankma31 * 10)) / 100, 2);
def hotsignal  = WildersAverage(hotma, 2);
def banksignal = WildersAverage(bankma, 4);

def hotline = hotma; # "Hot Money MA"
def bankline = bankma;# "Banker MA"
def hotline2 = hotsignal;# "Hot Money MA2"
def bankline2 = banksignal; # "Banker MA2"
#//
AddCloud(hotline , hotline2, Color.DARK_GREEN, Color.DARK_RED);
AddCloud(bankline, bankline2, Color.VIOLET, Color.DARK_ORANGE);
AddCloud(hot, hotline, Color.GREEN, Color.RED);

#//
def hbAvg = ((hot*10)+(hotma*35)+(hotsignal*15)+(bankma*35)+(banksignal* 5))/ 100;
def hbma = vwma(hbAvg, 2, v);

plot HBMA2 = hbma; # "Trend Tracker"
HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);
plot h1 = if last then na else threshold;#, "Bullish Confirmation Line"
h1.SetDefaultColor(Color.GRAY);
h1.SetStyle(Curve.SHORT_DASH);

#//Crossing signals

def downtrendsignal = Crosses(hotma, hotsignal, CrossingDirection.BELOW);
def uptrendsignal = Crosses(hotma, hotsignal, CrossingDirection.ABOVE);
 

plot dnSig = if downtrendsignal then hbma else na;# "Downtrend signal"
plot upSig = if uptrendsignal  then hbma else na; # "Uprend signal"
dnSig.SetStyle(Curve.POINTS);
upSig.SetStyle(Curve.POINTS);
dnSig.SetDefaultColor(Color.RED);
upSig.SetDefaultColor(Color.GREEN);

def dnCond = Bank<Bank[1] and Bank<Bank[2] and Bank[1]<Bank[2] and Bank<Bank[3] and Bank<Bank[4] and Bank[3]<Bank[4] and Bank[6]>8.5 and Bank<10;

plot Dump = if Bank<Bank[1]/1.75 then Bank else na;#, "Dump Candles"
plot DnCandle = if dnCond then Bank else na;#, "Down Candles"
plot PumpCandle = if Bank>hbma then Bank else na;# "Pump Candles"
plot Retest = if banksignal>bankma and Bank>0 then Bank else na; # "Retest Candles"

Dump.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Retest.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
PumpCandle.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
DnCandle.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Dump.SetDefaultColor(Color.RED);
Retest.SetDefaultColor(Color.DARK_RED);
PumpCandle.SetDefaultColor(Color.GREEN);
DnCandle.SetDefaultColor(Color.DARK_GRAY);

plot Banker = bank;#,   "Banker"
Banker.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Banker.AssignValueColor(if bank > 0 then GlobalColor("nor") else Color.DARK_GRAY);



#-- END of CODE
Hi @samer800

For some reason the green wave is chopped, any way we can fix it? Thanks!

I think it's more of a visual fix and not a logical/model fix that i'm searching if anyone could help here. Thanks!
 

Attachments

  • Screenshot 2024-03-26 at 12.19.49 PM.png
    Screenshot 2024-03-26 at 12.19.49 PM.png
    20.8 KB · Views: 445
Hi @samer800

For some reason the green wave is chopped, any way we can fix it? Thanks!

The formation of the cloud is correct based on the calculations.
It does not require fixing.
If you are asking for some sort of smoothing. That would add to the complexity of the script which wouldn't makes sense, if you are only looking for a visual fix.
 
Last edited by a moderator:
@LOKEN94 could you please kindly share a Bearish equivalent of this script?
@LOKEN94 is the TRADINGVIEW author of this script.
Unfortunately, he does NOT provide ThinkOrSwim scripts.

If you are looking for a Tradingview script, please contact him on Tradingview.
If you are looking for a Bearish ThinkOrSwim version of this script; sorry there is not one.
 
This is the best indicator on this entire forum IMHO. The more you look at it, the more you realize it's revealing to you...

I still think this is one of the best indicators on this forum. I've been looking at it for weeks now. I noticed a few opportunities it presents and I'll share a simple on here. Whenever the HBMA line is below a certain point, if you see the red cloud that's typically above it dip below it, it's presenting you with a possible scalp opportunity.

As seen in the image I've attached.

I still love this indicator. It works really well with "discretion trading", but I haven't yet been able to quantify why I'm able to make such good decisions with it in a rules based system for back-testing purposes.
Have you noticed anything specific when it comes to bearish scalps? If so, do share.
 
Have you noticed anything specific when it comes to bearish scalps? If so, do share.
Did you know that by clicking on a member's name, you can easily check when they were last seen on the uTS forum? It's a great way to keep track of who's been around recently, and who hasn't. Speaking of which, it looks like @Bingy has not been around in a while. :(
 
Can you give more info on how to set up the banker >5 & <5?
I cannot get it working either. Always got exception. Could someone help @chewie76 ? I tried many different combinations, such as:
plot test = Bank > 5 and Bank[1] < 5.
seems Bank is used, but never defined. I changed Bank to rsi_banker, not working either. Very strange. not sure why the original script (not scanner) works.
 
Last edited:
I cannot get it working either. Always got exception. Could someone help @chewie76 ? I tried many different combinations, such as:
plot test = Bank > 5 and Bank[1] < 5.
seems Bank is used, but never defined. I changed Bank to rsi_banker, not working either. Very strange. not sure why the original script (not scanner) works.
I get an "unexpected error" anytime I try this. Not sure why, but doesn't look like I can scan for Banker > 5.
 

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