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);
| ReplyForward
Add reaction |
this is what it looks like: