TASC 2026.01 The Reversion Index
"TASC 2026.01 The Reversion Index" by PineCodersTASC, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: TASC 2026.01 The Reversion Index (v1.0), read 2026-11-15T18:30:09.662Z; source language v6.
Licence: Mozilla Public License 2.0 (MPL-2.0) — full text. The source is published with it, modifications included, under the same licence.
TASC 2026.01 The Reversion Index by PineCodersTASC, ported from Pine v6. Pane indicator with 2 plots, 1 level and 1 input.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// (Notice added by FloSignals: the author's source carries none. It was published open-source on 2025-12-16; since 2019-07-26 the platform it was published on has released such a script under MPL-2.0 automatically.)
// TASC Issue: January 2026
// Article: Identifying Peaks And Valleys In Ranging Markets
// The Reversion Index
// Article By: John F. Ehlers
// Language: Pine-compatible v6
// Provided By: PineCoders, for tradingview.com
// ------------------------------------------------------------------------------------------------
// Original author: PineCodersTASC
// Original title: TASC 2026.01 The Reversion Index
// Licence: MPL-2.0 (the notice above was added by FloSignals; the original carries none)
// Pine version: 6
// 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=6
indicator("TASC 2026.01 The Reversion Index", "RI", overlay=false)
//#region Inputs
int length = input.int(20, title="RI Length", tooltip="Normalization Length of Data.")
riSmooth = 8
trSmooth = 4
//#endregion
//#region Functions
// Reversion Index
reversionIndex(int length) =>
float d = close - close[1]
float ds = math.sum(d, length)
float ads = math.sum(math.abs(d), length)
float ratio = ads != 0.0 ? ds / ads : 0.0
ratio
// Super Smoother Filter
superSmoother(float Series, float Period) =>
var float ALPHA = math.pi * math.sqrt(2.0) / Period
var float BETA = math.exp(-ALPHA)
var float COEF2 = -math.pow(BETA, 2)
var float COEF1 = math.cos(ALPHA) * 2.0 * BETA
var float COEF0 = 1.0 - COEF1 - COEF2
float sma2 = math.avg(Series, nz(Series[1], Series))
float smooth = na
smooth := COEF0 * sma2 + COEF1 * nz(smooth[1]) + COEF2 * nz(smooth[2])
//#endregion
//#region Calculations
float ri = reversionIndex(length)
float sm = superSmoother(ri, riSmooth)
float tr = superSmoother(ri, trSmooth)
//#endregion
//#region Display
hline(0)
plot(sm, "Smooth", color.red)
plot(tr, "Trigger", color.blue)
//#endregion
This file is under the Mozilla Public License 2.0; it is a port of the original by PineCodersTASC, 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.