Baha'i Reversal Points [CC]
"Baha'i Reversal Points [CC]" by cheatcountry, MIT. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Baha'i Reversal Points [CC] (v1.0), read 2026-10-12T15:41:58.536Z; source language v5.
Licence: MIT License (MIT) — full text.
Baha'i Reversal Points [CC] by cheatcountry, ported from Pine v5. Overlay indicator with 2 marker series, bar/background colouring, alerts and 6 inputs.
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Baha'i Reversal Points [CC] script may be freely distributed under the MIT license.
// ------------------------------------------------------------------------------------------------
// Original author: cheatcountry
// Original title: Baha'i Reversal Points [CC]
// Licence: MIT (the header above is the original notice, kept verbatim)
// Pine version: 5
// Fetched: 2026-10-12
// Ported to FloScript by FloSignals; modifications under MPL-2.0.
// Converter: @flosignals/floscript 0.1.0, strict mode, score 100/100
// ------------------------------------------------------------------------------------------------
//@floscript=1
//@version=5
indicator("Baha'i Reversal Points [CC]", overlay=true)
requestSecurity(string _symbol, string _res, bool _repaints) =>
repIndex = _repaints ? 0 : barstate.isrealtime ? 1 : 0
resIndex = _repaints ? 0 : barstate.isrealtime ? 0 : 1
[h, l, o, c] = [high[repIndex], low[repIndex], open[repIndex], close[repIndex]]
[h[resIndex], l[resIndex], o[resIndex], c[resIndex]]
var GRP1 = "General Settings"
string res = input.timeframe(title="Resolution", defval="", group=GRP1)
int length = input.int(title="Length", defval=19, minval=2, step=1, group=GRP1)
int lbLength = input.int(title="Lookback Length", defval=9, minval=1, step=1, group=GRP1)
float threshold = input.float(title="Threshold Level", defval=1.0, minval=0.01, step=0.01, group=GRP1)
bool rep = input.bool(title="Allow Repainting?", defval=false, group=GRP1)
bool bar = input.bool(title="Allow Bar Color Change?", defval=true, group=GRP1)
[h, l, o, c] = requestSecurity(syminfo.tickerid, res, rep)
float lpSum = math.sum(l < nz(l[lbLength]) ? 1 : 0, length)
float hpSum = math.sum(h > nz(h[lbLength]) ? 1 : 0, length)
float slo = lpSum >= length ? 1 : hpSum >= length ? -1 : 0
int sig = slo > 0 ? (slo > nz(slo[1]) ? 2 : 1) : slo < 0 ? (slo < nz(slo[1]) ? -2 : -1) : 0
alertcondition(ta.crossover(sig, 1), 'Strong Buy Signal', 'Strong Bullish Change Detected')
alertcondition(ta.crossunder(sig, -1), 'Strong Sell Signal', 'Strong Bearish Change Detected')
alertcondition(ta.crossover(sig, 0), 'Buy Signal', 'Bullish Change Detected')
alertcondition(ta.crossunder(sig, 0), 'Sell Signal', 'Bearish Change Detected')
alertcondition(ta.crossover(sig, 1) or ta.crossover(sig, 0), "All Buy Signals", "Any Bullish Change Detected")
alertcondition(ta.crossunder(sig, -1) or ta.crossunder(sig, 0), "All Sell Signals", "Any Bearish Change Detected")
color brpColor = sig > 1 ? color.green : sig > 0 ? color.lime : sig < -1 ? color.maroon : sig < 0 ? color.red : na
barcolor(bar ? brpColor : na)
plotshape(ta.crossover(slo, 0), 'Buy', shape.labelup, location.belowbar, color.new(color.green, 0), text='Buy', textcolor=color.new(color.white, 0))
plotshape(ta.crossunder(slo, 0), 'Sell', shape.labeldown, location.abovebar, color=color.new(color.red, 0), text='Sell', textcolor=color.new(color.white, 0))
This file is under the MIT License; it is a port of the original by cheatcountry, with the original licence header kept and the changes made for FloScript noted in the file.
- v2
Library refresh 2026-10-14
- v1
Library refresh 2026-10-12
Disclaimer. Scripts are written and published by members, or ported by FloSignals from open-source originals, and are their authors' own work and opinion. FloSignals does not review them for correctness and nothing in a script is financial advice or a recommendation to buy or sell anything — read the Risk Disclaimer. Posting here is under the Community Rules; a script that is not the poster's to post can be reported as the Copyright & Takedowns page says.

Comments (0)
No comments yet. Members can leave one.