Benner-Fibonacci Reversal Points [CC]
"Benner-Fibonacci Reversal Points [CC]" by cheatcountry, MIT. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Benner-Fibonacci Reversal Points [CC] (v4.0), read 2026-10-12T15:42:43.027Z; source language v5.
Licence: MIT License (MIT) — full text.
Benner-Fibonacci Reversal Points [CC] by cheatcountry, ported from Pine v5. Overlay indicator with drawings, alerts and 11 inputs.
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Benner-Fibonacci Reversal Points [CC] script may be freely distributed under the MIT license.
// ------------------------------------------------------------------------------------------------
// Original author: cheatcountry
// Original title: Benner-Fibonacci 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("Benner-Fibonacci Reversal Points [CC]", overlay=true, max_labels_count=500, max_bars_back=2500)
requestSecurity(string _symbol, string _res, bool _repaints) =>
repIndex = _repaints ? 0 : barstate.isrealtime ? 1 : 0
resIndex = _repaints ? 0 : barstate.isrealtime ? 0 : 1
[h, l, i] = [high[repIndex], low[repIndex], bar_index[repIndex]]
[h[resIndex], l[resIndex], i[resIndex]]
var GRP1 = "General Settings"
string res = input.timeframe(title="Resolution", defval="", group=GRP1)
bool rep = input.bool(title="Allow Repainting?", defval=false, group=GRP1)
bool isRev = input.bool(title='Reverse the Algorithm?', defval=false, group=GRP1)
color minorPeakColor = input.color(color.red, title='Minor Peak Color', confirm=true, group=GRP1)
color minorValleyColor = input.color(color.lime, title='Minor Valley Color', confirm=true, group=GRP1)
color majorPeakColor = input.color(color.maroon, title='Major Peak Color', confirm=true, group=GRP1)
color majorValleyColor = input.color(color.green, title='Major Valley Color', confirm=true, group=GRP1)
bool showMinorPeaksValleys = input.bool(title='Show Minor Peaks and Valleys?', defval=false, group=GRP1)
bool showMajorPeaksValleys = input.bool(title='Show Major Peaks and Valleys?', defval=true, group=GRP1)
int majorLbLength = input.int(10, title='Major Peaks and Valleys Lookback Length', minval=2, maxval=1000, step=1, group=GRP1)
int minorLbLength = input.int(2, title='Minor Peaks and Valleys Lookback Length', minval=2, maxval=1000, step=1, group=GRP1)
[h, l, i] = requestSecurity(syminfo.tickerid, res, rep)
var array<label> majorLowLabels = array.new_label()
var array<label> majorHighLabels = array.new_label()
var array<label> minorLowLabels = array.new_label()
var array<label> minorHighLabels = array.new_label()
method clearArray(array<label> labelArray) =>
while labelArray.size() > 0
labelArray.pop().delete()
method createNewLabels(bool isMajor, bool isLow, int barIndex, float pivotPrice, color pivotColor) =>
array<label> labelArray = isLow ? (isMajor ? majorLowLabels : minorLowLabels) : isMajor ? majorHighLabels : minorHighLabels
int startLoop = isRev ? (isLow ? 16 : 8) : isLow ? 20 : 10
int endLoop = isRev ? (isLow ? 20 : 10) : isLow ? 16 : 8
int stepLoop = isRev ? (isLow ? 2 : 1) : isLow ? 2 : 1
if pivotPrice
clearArray(labelArray)
label newLabel = label.new(barIndex, pivotPrice, isLow ? '▲' : '▼', xloc=xloc.bar_index, yloc=isLow ? yloc.belowbar : yloc.abovebar, size=size.normal, color=color(na), textcolor=pivotColor, style=label.style_text_outline)
labelArray.push(newLabel)
int startingBackIndex = barIndex
bool movingBack = true
while movingBack
for int n = startLoop to endLoop by stepLoop
if startingBackIndex - n < bar_index - 500
movingBack := false
else
label backLabel = label.new(startingBackIndex - n, pivotPrice, isLow ? '▲' : '▼', xloc=xloc.bar_index, yloc=isLow ? yloc.belowbar : yloc.abovebar, size=size.normal, color=color(na), textcolor=pivotColor, style=label.style_text_outline)
labelArray.push(backLabel)
startingBackIndex := startingBackIndex - n
int startingFwdIndex = barIndex
bool movingFwd = true
while movingFwd
for int n = endLoop to startLoop by stepLoop
if startingFwdIndex + n > bar_index + 500
movingFwd := false
else
label fwdLabel = label.new(startingFwdIndex + n, pivotPrice, isLow ? '▲' : '▼', xloc=xloc.bar_index, yloc=yloc.price, size=size.normal, color=color(na), textcolor=pivotColor, style=label.style_text_outline)
labelArray.push(fwdLabel)
startingFwdIndex := startingFwdIndex + n
float pivotMinorHigh = ta.pivothigh(h, minorLbLength, minorLbLength)
float pivotMinorLow = ta.pivotlow(l, minorLbLength, minorLbLength)
float pivotMajorHigh = ta.pivothigh(h, majorLbLength, majorLbLength)
float pivotMajorLow = ta.pivotlow(l, majorLbLength, majorLbLength)
if showMinorPeaksValleys
createNewLabels(false, false, i, pivotMinorHigh, minorPeakColor)
createNewLabels(false, true, i, pivotMinorLow, minorValleyColor)
if showMajorPeaksValleys
createNewLabels(true, false, i, pivotMajorHigh, majorPeakColor)
createNewLabels(true, true, i, pivotMajorLow, majorValleyColor)
alertcondition(not na(pivotMajorLow), "Strong Buy Signal", "Strong Bullish Change Detected")
alertcondition(not na(pivotMajorHigh), "Strong Sell Signal", "Strong Bearish Change Detected")
alertcondition(not na(pivotMinorLow), "Buy Signal", "Bullish Change Detected")
alertcondition(not na(pivotMinorHigh), "Sell Signal", "Bearish Change Detected")
alertcondition(not na(pivotMajorLow) or not na(pivotMinorLow), "All Buy Signals", "Any Bullish Change Detected")
alertcondition(not na(pivotMajorHigh) or not na(pivotMinorHigh), "All Sell Signals", "Any Bearish Change Detected")
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.