L3 Banker Fund Flow Trend Oscillator for ThinkOrSwim

Very intriguing!

What's the primary change in this latest update? Does it have a "Short" signal?
I realize this is a lower study; however, on the original post there appears to be a cyan colored confirmation candle on the top chart. Is that from another study? I am not getting that on my chart.

Thank you
I believe there is an updated version from the author if you scroll through the posts.
 
nwChYWj.png


Author Message:

Background
The large funds or banker fund are often referred to as Whale. Whale can have a significant impact on the price movements in various markets, especially in cryptocurrency . Therefore, how to monitor Whale trends is of great significance both in terms of fundamentals and technical aspects.

Function
L3 Banker Fund Flow Trend Oscillator can give you a model of complete banker fund flow operation in cycles. Although the script is not so complicated, it is comprehensive to disclose the price trend. That is the reason why I list this as Level 3. Each cycle of banker fund flow may have 5 steps in max as entry, increase position, decrease position, exit, and weak rebound for exit.

Key Signal
1. banker fund entry with blue candle
2. banker increase position with green candle
3. banker decrease position with white candle
4. banker fund exit/quit with red candle
5. banker fund weak rebound with pink candle

Pros and Cons
Pros:
1. Model banker fund behavior in complete cycles
2. Overbought and oversold can be directly observed due to oscillator nature
3. the transition points are clear for entry or exit

Cons:
1. Simple modelling, no further complex behaviors can be disclosed
2. trade by trend following the banker fund, it is still under the trend analysis prerequisite

CODE :

CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © blackcat1402
#study("[blackcat] L3 Banker Fund Flow Trend Oscillator", overlay=false)
# Converted and mod by Sam4Cok@Samer800 - 02/2023
declare lower;
#//functions
input BarColor = yes;
input SmoothingLength = 13;
def na = Double.NaN;
def last = isNaN(close[1]);
#xrf(values, length) =>
script xrf {
    input values = close;
    input length = 34;
    def r_val;# = float(na)
    r_val = if length >= 1 then
                fold i = 0 to length +1 with p=values do
             if IsNaN(p) or !IsNaN(values[i]) then values[i] else p else Double.NaN;
    plot out = r_val;
}
#xsa(src,len,wei) =>
script xsa {
    input src = close;
    input len = 5;
    input wei = 1;
    def sumf;# = 0.0
    def ma;# = 0.0
    def out;# = 0.0
    sumf = CompoundValue(1, sumf[1] - src[len] + src , src);
    ma   = if IsNaN(src[len]) then Double.NaN else sumf / len;
    out  = if IsNaN(out[1]) then ma else (src * wei + out[1] * (len - wei)) / len;
    plot return = out;
}
def wmCal = (close - Lowest(low, 27)) / (Highest(high, 27) - Lowest(low, 27)) * 100;

#//set up a simple model of banker fund flow trend  
def fundtrend = (3 * xsa(wmCal, 5, 1) - 2 * xsa(xsa(wmCal, 5, 1), 3, 1) - 50) * 1.032 + 50;
#//define typical price for banker fund
def typ = (2 * close + high + low + open) / 5;
#//lowest low with mid term fib # 34
def lol = Lowest(low, 34);
#//highest high with mid term fib # 34
def hoh = Highest(high, 34);
#//define banker fund flow bull bear line
def bullbear = (typ - lol) / (hoh - lol) * 100;
def bullbearline = ExpAverage(bullbear, SmoothingLength);
#//define banker entry signal
def bankerentry = Crosses(fundtrend, bullbearline, CrossingDirection.ABOVE) and bullbearline < 25;

#//banker increase position with green candle
def UpCandle = fundtrend > bullbearline;
def WeakUp   = fundtrend < (xrf(fundtrend * 0.95, 1));
def DnCandle = fundtrend < bullbearline;
def WeakDn   = fundtrend < bullbearline and fundtrend > (xrf(fundtrend * 0.95, 1));

# Plot the new Chart
#//banker fund entry with yellow candle
AddChart(high = if bankerentry then 100 else na, low = 0 , open = 100,  close = 0,
         type = ChartType.CANDLE, growcolor =  CreateColor(26, 70, 85));

AddChart(high = if UpCandle then bullbearline else na , low = fundtrend , open = fundtrend,  close =  bullbearline,
         type = ChartType.CANDLE, growcolor =  CreateColor(7,205,15));

AddChart(high = if WeakUp then bullbearline else na , low = fundtrend , open = fundtrend,  close = bullbearline,
         type = ChartType.CANDLE, growcolor =  CreateColor(188,245,188));

AddChart(high = if DnCandle then bullbearline else na , low = fundtrend , open = bullbearline,  close =   fundtrend,
         type = ChartType.CANDLE, growcolor =  Color.RED);

AddChart(high = if WeakDn then bullbearline else na , low = fundtrend , open = bullbearline,  close =   fundtrend,
         type = ChartType.CANDLE, growcolor =  Color.PINK);

#/overbought and oversold threshold lines
def h1 = if last then na else 80;
def h2 = if last then na else 20;
def h3 = 10;
def h4 = 90;
plot h5 = if last then na else 50;
h5.SetDefaultColor(Color.DARK_GRAY);

AddCloud(h2, h3, CreateColor(157,157,0));#color=color.yellow,transp=70)
AddCloud(h4, h1, CreateColor(157,0 ,157));#=color.fuchsia,transp=70)

AssignPriceColor(if !BarColor then Color.CURRENT else
                 if bankerentry then Color.CYAN else
                 if WeakDn then Color.DARK_RED else
                 if DnCandle then Color.RED else
                 if WeakUp then Color.DARK_GREEN else
                 if UpCandle then Color.GREEN else Color.CURRENT);



#---- END CODE
Excellent work Samer800! Greatly appreciate all your work! Anyway you can have this indicator work on the mobile version?
 
Excellent work Samer800! Greatly appreciate all your work! Anyway you can have this indicator work on the mobile version?
No, this indicator cannot be utilized as a mobile version because the formatting outputs: AddChart() and AssignPriceColor() are not supported.
 
How is it possible to change the color of the blue lines at the oscillator? I mean the vertical lines when it is a signal, i want to change from blue to solid yellow. Thanks!
Screenshot 2023-12-04 204619.png
 
How is it possible to change the color of the blue lines at the oscillator? I mean the vertical lines when it is a signal, i want to change from blue to solid yellow. Thanks!
View attachment 20352
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © blackcat1402
#study("[blackcat] L3 Banker Fund Flow Trend Oscillator", overlay=false)
# Converted and mod by Sam4Cok@Samer800 - 02/2023
declare lower;
#//functions
input BarColor = yes;
input SmoothingLength = 13;
def na = Double.NaN;
def last = isNaN(close[1]);
#xrf(values, length) =>
script xrf {
input values = close;
input length = 34;
def r_val;# = float(na)
r_val = if length >= 1 then
fold i = 0 to length +1 with p=values do
if IsNaN(p) or !IsNaN(values) then values else p else Double.NaN;
plot out = r_val;
}
#xsa(src,len,wei) =>
script xsa {
input src = close;
input len = 5;
input wei = 1;
def sumf;# = 0.0
def ma;# = 0.0
def out;# = 0.0
sumf = CompoundValue(1, sumf[1] - src[len] + src , src);
ma = if IsNaN(src[len]) then Double.NaN else sumf / len;
out = if IsNaN(out[1]) then ma else (src * wei + out[1] * (len - wei)) / len;
plot return = out;
}
def wmCal = (close - Lowest(low, 27)) / (Highest(high, 27) - Lowest(low, 27)) * 100;

#//set up a simple model of banker fund flow trend
def fundtrend = (3 * xsa(wmCal, 5, 1) - 2 * xsa(xsa(wmCal, 5, 1), 3, 1) - 50) * 1.032 + 50;
#//define typical price for banker fund
def typ = (2 * close + high + low + open) / 5;
#//lowest low with mid term fib # 34
def lol = Lowest(low, 34);
#//highest high with mid term fib # 34
def hoh = Highest(high, 34);
#//define banker fund flow bull bear line
def bullbear = (typ - lol) / (hoh - lol) * 100;
def bullbearline = ExpAverage(bullbear, SmoothingLength);
#//define banker entry signal
def bankerentry = Crosses(fundtrend, bullbearline, CrossingDirection.ABOVE) and bullbearline < 25;

#//banker increase position with green candle
def UpCandle = fundtrend > bullbearline;
def WeakUp = fundtrend < (xrf(fundtrend * 0.95, 1));
def DnCandle = fundtrend < bullbearline;
def WeakDn = fundtrend < bullbearline and fundtrend > (xrf(fundtrend * 0.95, 1));

# Plot the new Chart
#//banker fund entry with yellow candle
AddChart(high = if bankerentry then 100 else na, low = 0 , open = 100, close = 0,
type = ChartType.CANDLE, growcolor = CreateColor(254,254,31));

AddChart(high = if UpCandle then bullbearline else na , low = fundtrend , open = fundtrend, close = bullbearline,
type = ChartType.CANDLE, growcolor = CreateColor(7,205,15));

AddChart(high = if WeakUp then bullbearline else na , low = fundtrend , open = fundtrend, close = bullbearline,
type = ChartType.CANDLE, growcolor = CreateColor(188,245,188));

AddChart(high = if DnCandle then bullbearline else na , low = fundtrend , open = bullbearline, close = fundtrend,
type = ChartType.CANDLE, growcolor = Color.RED);

AddChart(high = if WeakDn then bullbearline else na , low = fundtrend , open = bullbearline, close = fundtrend,
type = ChartType.CANDLE, growcolor = Color.PINK);

#/overbought and oversold threshold lines
def h1 = if last then na else 80;
def h2 = if last then na else 20;
def h3 = 10;
def h4 = 90;
plot h5 = if last then na else 50;
h5.SetDefaultColor(Color.DARK_GRAY);

AddCloud(h2, h3, CreateColor(157,157,0));#color=color.yellow,transp=70)
AddCloud(h4, h1, CreateColor(157,0 ,157));#=color.fuchsia,transp=70)

AssignPriceColor(if !BarColor then Color.CURRENT else
if bankerentry then Color.CYAN else
if WeakDn then Color.DARK_RED else
if DnCandle then Color.RED else
if WeakUp then Color.DARK_GREEN else
if UpCandle then Color.GREEN else Color.CURRENT);



#---- END CODE
 
I tired to download the bank fund indicator I don't see anything in bottom window just the candle I am doing wrong ?
thanks
 
@samer800 Is it possible to get an MTF version of this indicator? Thank you so much for all you are doing!
check the below:

CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © blackcat1402
#study("[blackcat] L3 Banker Fund Flow Trend Oscillator", overlay=false)
# Converted and mod by Sam4Cok@Samer800 - 02/2023
# Update - added option for MTF - 02/2024
declare lower;
#//functions
input BarColor = no;
input timeframe = {default "Chart", "Custom"};
input customTimeframe = AggregationPeriod.FIVE_MIN;
input SmoothingLength = 13;
input SourceType = {default "High/Low", "CCHOL"};
def na = Double.NaN;
def last = IsNaN(close);
def tf = customTimeframe;
def c;
def h;
def l;
def o;
def cchol;
switch (timeframe) {
case "Custom" :
    c = close(Period = tf);
    h = high(Period = tf);
    l = low(Period = tf);
    o = open(Period = tf);
    cchol = (2 * close(Period = tf) + high(Period = tf) + low(Period = tf) + open(Period = tf)) / 5;
default :
    c = close;
    h = high;
    l = low;
    o = open;
    cchol = (2 * close + high + low + open) / 5;
}
#//define typical price for banker fund
#def cchol = (2 * c + h + l + o) / 5;
def hilo = SourceType == SourceType."High/Low";
#xrf(values, length) =>
script xrf {
    input values = close;
    input length = 34;
    def r_val;# = float(na)
    r_val = fold i = 0 to length + 1 with p=values do
            if IsNaN(p) or !IsNaN(values[i]) then values[i] else p;
    plot out = if length >= 1 then r_val else Double.NaN;
}
#xsa(src,len,wei) =>
script xsa {
    input src = close;
    input len = 5;
    input wei = 1;
    def sumf = CompoundValue(1, sumf[1] - src[len] + src , src);
    def ma   = if IsNaN(src[len]) then Double.NaN else sumf / len;
    def out  = if IsNaN(out[1]) then ma else (src * wei + out[1] * (len - wei)) / len;
    plot return = out;
}
def hh = Highest(h, 27);
def ll = Lowest(l, 27);
def wmCal = (c - ll) / (hh - ll) * 100;

#//set up a simple model of banker fund flow trend   
def fundtrend = (3 * xsa(wmCal, 5, 1) - 2 * xsa(xsa(wmCal, 5, 1), 3, 1) - 50) * 1.032 + 50;

#//lowest low with mid term fib # 34
def lol = Lowest(if hilo then l else cchol, 34);
#//highest high with mid term fib # 34
def hoh = Highest(if hilo then h else cchol, 34);
#//define banker fund flow bull bear line
def bullbear = (cchol - lol) / (hoh - lol) * 100;
def bullbearline = ExpAverage(bullbear, SmoothingLength);
#//define banker entry signal
def bankerentry = Crosses(fundtrend, bullbearline, CrossingDirection.ABOVE) and bullbearline < 25;
def bankerExit = Crosses(fundtrend, bullbearline, CrossingDirection.BELOW) and bullbearline > 75;

#//banker increase position with green candle
def UpCandle = if last then na else fundtrend > bullbearline;
def WeakUp   = if last then na else fundtrend < (xrf(fundtrend * 0.95, 1));
def DnCandle = if last then na else fundtrend < bullbearline;
def WeakDn   = if last then na else fundtrend < bullbearline and fundtrend > (xrf(fundtrend * 0.95, 1));

# Plot the new Chart
#//banker fund entry with yellow candle
plot SigUp = if bankerentry and !bankerentry[1] then 15 else 0;
plot SigDn = if bankerExit and !bankerExit[1] then 85 else 100;
SigUp.SetDefaultColor(Color.YELLOW);
SigDn.SetDefaultColor(Color.MAGENTA);

AddChart(high = if UpCandle then bullbearline else na , low = fundtrend , open = fundtrend,  close =  bullbearline,
         type = ChartType.CANDLE, growcolor =  CreateColor(7, 205, 15));

AddChart(high = if WeakUp then bullbearline else na , low = fundtrend , open = fundtrend,  close = bullbearline,
         type = ChartType.CANDLE, growcolor =  Color.LIGHT_GREEN); #CreateColor(188, 245, 188));

AddChart(high = if DnCandle then bullbearline else na , low = fundtrend , open = bullbearline,  close =   fundtrend,
         type = ChartType.CANDLE, growcolor =  Color.RED);

AddChart(high = if WeakDn then bullbearline else na , low = fundtrend , open = bullbearline,  close =   fundtrend,
         type = ChartType.CANDLE, growcolor =  Color.PINK);

#/overbought and oversold threshold lines
def h1 = if last then na else 80;
def h2 = if last then na else 20;
def h3 = 10;
def h4 = 90;
plot h5 = if last then na else 50;
h5.SetDefaultColor(Color.DARK_GRAY);

AddCloud(h2, h3, CreateColor(157, 157, 0));#color=color.yellow,transp=70)
AddCloud(h4, h1, CreateColor(157, 0 , 157));#=color.fuchsia,transp=70)

AssignPriceColor(if !BarColor then Color.CURRENT else
                 if bankerentry then Color.CYAN else
                 if bankerExit then Color.MAGENTA else
                 if WeakDn then Color.DARK_RED else
                 if DnCandle then Color.RED else
                 if WeakUp then Color.DARK_GREEN else
                 if UpCandle then Color.GREEN else Color.CURRENT);



#---- END CODE
 

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