L3 Banker Fund Flow Trend Oscillator for ThinkOrSwim

I might give that a try, i.e., remove the “lower” designation and see if I can get just the dots to plot. Maybe the divergence indicator too.
Try this ;

#// 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
# L3 Banker Fund Flow Trend Oscillator Price Chart

#declare lower;
input BarColor = yes;
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 * c + h + l + o) / 5;
default:
c = close;
h = high;
l = low;
o = open;
cchol = (2 * c + h + l + o) / 5;
}

def hilo = SourceType == SourceType."High/Low";

script xrf {
input values = close;
input length = 34;
def r_val = fold i = 0 to length + 1 with p = values do
if IsNaN(p) or !IsNaN(values) then values else p;
plot out = if length >= 1 then r_val else Double.NaN;
}

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;
def fundtrend = (3 * xsa(wmCal, 5, 1) - 2 * xsa(xsa(wmCal, 5, 1), 3, 1) - 50) * 1.032 + 50;

def lol = Lowest(if hilo then l else cchol, 34);
def hoh = Highest(if hilo then h else cchol, 34);
def bullbear = (cchol - lol) / (hoh - lol) * 100;
def bullbearline = ExpAverage(bullbear, SmoothingLength);

def bankerentry = Crosses(fundtrend, bullbearline, CrossingDirection.ABOVE) and bullbearline < 25;
def bankerExit = Crosses(fundtrend, bullbearline, CrossingDirection.BELOW) and bullbearline > 75;

# Price chart signals
plot EntryDot = if bankerentry then low - TickSize() * 5 else na;
EntryDot.SetPaintingStrategy(PaintingStrategy.POINTS);
EntryDot.SetDefaultColor(Color.CYAN);
EntryDot.SetLineWeight(3);

plot ExitDot = if bankerExit then high + TickSize() * 5 else na;
ExitDot.SetPaintingStrategy(PaintingStrategy.POINTS);
ExitDot.SetDefaultColor(Color.MAGENTA);
ExitDot.SetLineWeight(3);

# Optional bar coloring
AssignPriceColor(if !BarColor then Color.CURRENT else
if bankerentry then Color.CYAN else
if bankerExit then Color.MAGENTA else
Color.CURRENT);






ACg8ocL2U2F-mpfJqceP7vYdrvXw5oaFk8yDgFgwiLM_6m7UYXenYjxk=s80-p
ReplyForward

Add reaction

this is what it looks like:
 

Attachments

  • screenshot0424.png
    screenshot0424.png
    45.2 KB · Views: 30
Thank you, cando. I appreciate it, that looks good. What I was really looking for though is the red/green/white dots at overbought and oversold areas that @chewie76 added on post #23. I'd like to get those up above and below the candles in the price area of the chart.

https://usethinkscript.com/threads/...-oscillator-for-thinkorswim.14522/post-142397
I see ,what you mean ,but i do not think is possible to do it the way is intended ,you would get a dot under the candles which does not help much as an oscillator can be OB or OS for some time before actually turning down or up so you would get a dot for as long as is OB or OS.but if thats what you want just add this to the bottom of the code i posted earlier

plot OB = if fundtrend > 90 and fundtrend < 100 then high + (fundtrend - 90) * TickSize() else na;
plot OBX = if fundtrend > 100 then high + (fundtrend - 90) * TickSize() * 1.5 else na;
OB.SetDefaultColor(Color.DARK_RED);
OBX.SetDefaultColor(Color.WHITE);
OB.SetPaintingStrategy(PaintingStrategy.POINTS);
OBX.SetPaintingStrategy(PaintingStrategy.POINTS);

plot OS = if fundtrend < 10 and fundtrend > 0 then low - (10 - fundtrend) * TickSize() else na;
plot OSX = if fundtrend < 0 then low - (10 - fundtrend) * TickSize() * 1.5 else na;
OS.SetDefaultColor(Color.DARK_GREEN);
OSX.SetDefaultColor(Color.WHITE);
OS.SetPaintingStrategy(PaintingStrategy.POINTS);
OSX.SetPaintingStrategy(PaintingStrategy.POINTS);
 

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