Reversal Points [CC]
"Reversal Points [CC]" by cheatcountry, MIT. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Reversal Points [CC] (v2.0), read 2026-11-15T18:23:48.905Z; source language v5.
Licence: MIT License (MIT) — full text.
Reversal Points [CC] by cheatcountry, ported from Pine v5. Overlay indicator with drawings, alerts and 15 inputs.
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Reversal Points [CC] script may be freely distributed under the MIT license.
// ------------------------------------------------------------------------------------------------
// Original author: cheatcountry
// Original title: Reversal Points [CC]
// Licence: MIT (the header above is the original notice, kept verbatim)
// Pine version: 5
// Fetched: 2026-11-15
// 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("Reversal Points [CC]", overlay=true, max_labels_count=500)
requestSecurity(string _symbol, string _res, bool _repaints) =>
repIndex = _repaints ? 0 : barstate.isrealtime ? 1 : 0
resIndex = _repaints ? 0 : barstate.isrealtime ? 0 : 1
[h, l, t] = [high[repIndex], low[repIndex], time[repIndex]]
[h[resIndex], l[resIndex], t[resIndex]]
var GRP1 = "General Settings"
string res = input.timeframe(title="Resolution", defval="", group=GRP1)
bool ignoreInsideBars = input.bool(title="Ignore Inside Bars?", defval=false, group=GRP1)
bool rep = input.bool(title="Allow Repainting?", defval=false, group=GRP1)
var string GRP2 = "Short Term Settings"
bool showSTHighs = input.bool(title="Show Short Term Highs?", defval=true, group=GRP2)
color stHighsColor = input.color(color.orange, "Short Term Highs Color", group=GRP2)
bool showSTLows = input.bool(title="Show Short Term Lows?", defval=true, group=GRP2)
color stLowsColor = input.color(color.lime, "Short Term Lows Color", group=GRP2)
var string GRP3 = "Mid Term Settings"
bool showMTHighs = input.bool(title="Show Mid Term Highs?", defval=true, group=GRP3)
color mtHighsColor = input.color(color.red, "Mid Term Highs Color", group=GRP3)
bool showMTLows = input.bool(title="Show Mid Term Lows?", defval=true, group=GRP3)
color mtLowsColor = input.color(color.green, "Mid Term Lows Color", group=GRP3)
var string GRP4 = "Long Term Settings"
bool showLTHighs = input.bool(title="Show Long Term Highs?", defval=true, group=GRP4)
color ltHighsColor = input.color(color.maroon, "Long Term Highs Color", group=GRP4)
bool showLTLows = input.bool(title="Show Long Term Lows?", defval=true, group=GRP4)
color ltLowsColor = input.color(color.olive, "Long Term Lows Color", group=GRP4)
[h, l, t] = requestSecurity(syminfo.ticker, res, rep)
type ReversalPoint
int bar_time
float price
var lowShortRevPoints = array.new<ReversalPoint>()
var highShortRevPoints = array.new<ReversalPoint>()
var lowMediumRevPoints = array.new<ReversalPoint>()
var highMediumRevPoints = array.new<ReversalPoint>()
isReversalPoint(bool isLow, float firstSrc, float midSrc, float lastSrc, bool isInsideBar) =>
bool isReversalPoint = false
if not (isInsideBar and ignoreInsideBars)
if isLow
isReversalPoint := lastSrc > midSrc and midSrc < firstSrc
else
isReversalPoint := lastSrc < midSrc and midSrc > firstSrc
isReversalPoint
plotReversalPoint(bool isLow, ReversalPoint revPoint, color revPointColor, string labelSize, bool createLabel) =>
if createLabel
label.new(revPoint.bar_time, revPoint.price, isLow ? '▲' : '▼', xloc=xloc.bar_time, yloc=isLow ? yloc.belowbar : yloc.abovebar, size=labelSize, color=color(na), textcolor=revPointColor, style=label.style_text_outline)
getReversalPoints(bool isLow, array<ReversalPoint> sourceArray, color plotColor, ReversalPoint newRp, string labelSize, bool createLabel, bool isInsideBar) =>
ReversalPoint result = na
sourceArray.push(newRp)
plotReversalPoint(isLow, newRp, plotColor, labelSize, createLabel)
int arraySize = sourceArray.size()
float midArrayValue = arraySize >= 2 ? sourceArray.get(arraySize - 2).price : na
float firstArrayValue = arraySize >= 3 ? sourceArray.get(arraySize - 3).price : na
if not na(firstArrayValue) and not na(midArrayValue) and isReversalPoint(isLow, firstArrayValue, midArrayValue, newRp.price, isInsideBar)
result := sourceArray.get(arraySize - 2)
result
bool isInsideBar = h < nz(h[1]) and l > nz(l[1])
ReversalPoint shortTermLow = isReversalPoint(true, nz(l[2]), nz(l[1]), l, isInsideBar) ? ReversalPoint.new(nz(t[1]), nz(l[1])) : na
ReversalPoint midTermLow = na
ReversalPoint longTermLow = na
if not na(shortTermLow)
midTermLow := getReversalPoints(true, lowShortRevPoints, stLowsColor, shortTermLow, size.tiny, showSTLows, isInsideBar)
if not na(midTermLow)
longTermLow := getReversalPoints(true, lowMediumRevPoints, mtLowsColor, midTermLow, size.small, showMTLows, isInsideBar)
if not na(longTermLow)
plotReversalPoint(true, longTermLow, ltLowsColor, size.normal, showLTLows)
ReversalPoint shortTermHigh = isReversalPoint(false, nz(h[2]), nz(h[1]), h, isInsideBar) ? ReversalPoint.new(nz(t[1]), nz(h[1])) : na
ReversalPoint midTermHigh = na
ReversalPoint longTermHigh = na
if not na(shortTermHigh)
midTermHigh := getReversalPoints(false, highShortRevPoints, stHighsColor, shortTermHigh, size.tiny, showSTHighs, isInsideBar)
if not na(midTermHigh)
longTermHigh := getReversalPoints(false, highMediumRevPoints, mtHighsColor, midTermHigh, size.small, showMTHighs, isInsideBar)
if not na(longTermHigh)
plotReversalPoint(false, longTermHigh, ltHighsColor, size.normal, showLTHighs)
alertcondition(not na(midTermLow) or not na(longTermLow), "Strong Buy Signal", "Strong Bullish Change Detected")
alertcondition(not na(midTermHigh) or not na(longTermHigh), "Strong Sell Signal", "Strong Bearish Change Detected")
alertcondition(not na(shortTermLow), "Buy Signal", "Bullish Change Detected")
alertcondition(not na(shortTermHigh), "Sell Signal", "Bearish Change Detected")
alertcondition(not na(shortTermLow) or not na(midTermLow) or not na(longTermLow), "All Buy Signals", "Any Bullish Change Detected")
alertcondition(not na(shortTermHigh) or not na(midTermHigh) or not na(longTermHigh), "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.
- v1
Library refresh 2026-11-15
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.