Loken (v4) Bullish Smart Money for ThinkOrSwim

samer800

Moderator - Expert
VIP
Lifetime

check above video to know how to use the indicator.

CODE:

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
declare lower;
declare zerobase;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(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);

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
 
I like this one! I like those dots so I thought I would create a UPPER indicator that includes the dots. Changed the color of them...

Code:
# 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
declare upper;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(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 hbAvg = ((hot * 10) + (hotma * 35) + (hotsignal * 15) + (bankma * 35) + (banksignal * 5)) / 100;
def hbma = vwma(hbAvg, 2);

def HBMA2 = hbma; # "Trend Tracker"
#HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);

#//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.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
upSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
dnSig.SetDefaultColor(Color.magenta);
upSig.SetDefaultColor(Color.cyan);
upSig.SetLineWeight(5);
dnSig.SetLineWeight(5);
 
I like this one! I like those dots so I thought I would create a UPPER indicator that includes the dots. Changed the color of them...

Code:
# 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
declare upper;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(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 hbAvg = ((hot * 10) + (hotma * 35) + (hotsignal * 15) + (bankma * 35) + (banksignal * 5)) / 100;
def hbma = vwma(hbAvg, 2);

def HBMA2 = hbma; # "Trend Tracker"
#HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);

#//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.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
upSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
dnSig.SetDefaultColor(Color.magenta);
upSig.SetDefaultColor(Color.cyan);
upSig.SetLineWeight(5);
dnSig.SetLineWeight(5);
very nice @chewie76 , can you add the red and green part of the indicator, just like you did with the dot? i noticed the green and red area are very good. just the same way you added the dot.thank you in advance
 
very nice @chewie76 , can you add the red and green part of the indicator, just like you did with the dot? i noticed the green and red area are very good. just the same way you added the dot.thank you in advance
I think this is close. Not exactly right, but close.
Code:
# 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
declare upper;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);
def hot  = close;
#def hot1  = rsi_HotMoney;
def bank = close;
#def bank1 = 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 hotma1  = 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"
plot line0 = hot;
plot line1 = hotline;
line0.assignvalueColor(if hotline > hotline2 then color.green else color.red);
line1.assignvalueColor(if hotline > hotline2 then color.green else color.red);
#//
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);

def HBMA2 = hbma; # "Trend Tracker"
#HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);

#//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.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
upSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
dnSig.SetDefaultColor(Color.magenta);
upSig.SetDefaultColor(Color.cyan);
upSig.SetLineWeight(5);
dnSig.SetLineWeight(5);
 
I think this is close. Not exactly right, but close.
Code:
# 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
declare upper;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);
def hot  = close;
#def hot1  = rsi_HotMoney;
def bank = close;
#def bank1 = 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 hotma1  = 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"
plot line0 = hot;
plot line1 = hotline;
line0.assignvalueColor(if hotline > hotline2 then color.green else color.red);
line1.assignvalueColor(if hotline > hotline2 then color.green else color.red);
#//
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);

def HBMA2 = hbma; # "Trend Tracker"
#HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);

#//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.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
upSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
dnSig.SetDefaultColor(Color.magenta);
upSig.SetDefaultColor(Color.cyan);
upSig.SetLineWeight(5);
dnSig.SetLineWeight(5);
@chewie76 thank you some much! let me bother you for one more thing, i really like this trading system, can you add a price color, for example when the bottom Red and Green indicator, if is turn it green paint the color green and if is short pain the candles red, just using the cloud red and green indicator. thank yo very much.
 
@chewie76 thank you some much! let me bother you for one more thing, i really like this trading system, can you add a price color, for example when the bottom Red and Green indicator, if is turn it green paint the color green and if is short pain the candles red, just using the cloud red and green indicator. thank yo very much.
Add this code to the bottom of the Lower indicator.
Code:
input Barcolor = yes;
AssignPriceColor(if Barcolor and hotline > hotline2 then color.green else color.red);
 
Add this code to the bottom of the Lower indicator.
Code:
input Barcolor = yes;
AssignPriceColor(if Barcolor and hotline > hotline2 then color.green else color.red);
I changed your hint for my use since I am not to stay in colored bars all the time and when setting to "no" it colored everything with red:


input PaintBar = no;
AssignPriceColor(if PaintBar and hotline > hotline2 then color.green else if PaintBar and hotline < hotline2 then color.red else color.CURRENT);
 
Neat indicator, I'm trying to scan for the pump histogram bars within the lower indicator and something not right? Any help much appreciated:)
 
Is this suitable for intraday trading such as the 5 minute or 15, it is it only relevant for higher like daily?
I originally created it for the 15m, it's better used for intraday imo
The concept of "Banker" is more relevant the higher the time-frame since it's only likely to be big buyer, if you use it on a lower time-frame just don't expect any bar to mean institutional activity, but the indicator could be used on seconds time-frames
 

check above video to know how to use the indicator.

CODE:

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
declare lower;
declare zerobase;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(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);

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

Is there a way to get following on the chart? This is from the code.

AddCloud(hotline , hotline2, Color.DARK_GREEN, Color.DARK_RED);
AddCloud(bankline, bankline2, Color.VIOLET, Color.DARK_ORANGE);
AddCloud(hot, hotline, Color.GREEN, Color.RED);
 
on the lower indicator, Is there a way to get an arrow up or down on the upper chart when HBMA2 crosses h1.
Thats the line that changes colors from blue to purple as they cross each other.
 
I like this one! I like those dots so I thought I would create a UPPER indicator that includes the dots. Changed the color of them...

Code:
# 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
declare upper;

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);
DefineGlobalColor("nor", CreateColor(132, 175, 201));
#vwma(source, length)
script VWMA {
    input src = close;
    input len = 15;
    def 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 sensitivity = 1;
    input rsiPeriod = 50;
    input rsiBase = 1;
    def nRSI = RSI(Price = close, 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(SensitivityBanker,   RSIPeriodBanker,   RSIBaseBanker);
def rsi_HotMoney = rsi_function(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 hbAvg = ((hot * 10) + (hotma * 35) + (hotsignal * 15) + (bankma * 35) + (banksignal * 5)) / 100;
def hbma = vwma(hbAvg, 2);

def HBMA2 = hbma; # "Trend Tracker"
#HBMA2.AssignValueColor(if hbma > threshold then Color.CYAN else Color.MAGENTA);

#//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.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
upSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
dnSig.SetDefaultColor(Color.magenta);
upSig.SetDefaultColor(Color.cyan);
upSig.SetLineWeight(5);
dnSig.SetLineWeight(5);
@chewie76 - is there a way to scan for the green dots? I tried using both the originally posted indicator and your upper looking for "upsig" but both times it gives me a thinkorswim error. If this is too complex I wonderif there is at least a surrogate that could be used? thanks
 
@chewie76 - is there a way to scan for the green dots? I tried using both the originally posted indicator and your upper looking for "upsig" but both times it gives me a thinkorswim error. If this is too complex I wonderif there is at least a surrogate that could be used? thanks
I get the same error. Not sure.
 

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