Untitled
"TASC 2024.09 Precision Trend Analysis" by PineCodersTASC, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: TASC 2024.09 Precision Trend Analysis (v1.0), read 2026-10-12T15:51:40.108Z; source language v5.
Licence: Mozilla Public License 2.0 (MPL-2.0) — full text. The source is published with it, modifications included, under the same licence.
TASC 2024.09 Precision Trend Analysis by PineCodersTASC, ported from Pine v5. Pane indicator with 2 plots, 2 marker series, 1 level, bar/background colouring and 2 inputs.
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © PineCodersTASC
// TASC Issue: September 2024
// Article: Precision Trend Analysis.
// A New Way To Pinpoint Trend.
// Article By: John F. Ehlers
// Language: Pine-compatible v5
// Provided By: PineCoders, for tradingview.com
// ------------------------------------------------------------------------------------------------
// Original author: PineCodersTASC
// Original title: TASC 2024.09 Precision Trend Analysis
// Licence: MPL-2.0 (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
title = "TASC 2024.09 Precision Trend Analysis"
stitle = "Trend Analysis"
indicator(title, stitle, false)
// --- Inputs ---
int length01 = input.int(250, "Length 1:")
int length02 = input.int(40, "Length 2:")
// --- Functions ---
// Highpass Filter
highPass(float Price, float Period) =>
float a1 = math.exp(-1.414 * math.pi / Period)
float b1 = 2 * a1 * math.cos(1.414 * math.pi / Period)
float c2 = b1
float c3 = -a1 * a1
float c1 = (1 + c2 - c3) / 4
float hp = 0.0
if bar_index >= 4
hp := c1 * (Price - 2 * Price[1] + Price[2]) + c2 * nz(hp[1]) + c3 * nz(hp[2])
hp
// --- Calculations ---
float HP1 = highPass(close, length01)
float HP2 = highPass(close, length02)
float Trend = HP1 - HP2
float ROC = length02 / 6.28 * ta.change(Trend)
bool upROC = ta.crossunder(ROC, 0) and Trend < 0
bool dwROC = ta.crossover(ROC, 0) and Trend > 0
// --- Visuals ---
color colTrend = Trend > 0 ? #4daf4a : #e41a1c
plot(Trend, "Trend Indicator", colTrend, 2)
plot(ROC, "ROC", #377eb8, 2, plot.style_histogram)
hline(0.0, "Zero Point")
plotshape(upROC ? ROC : na, "Peak", shape.triangledown, location.absolute, #e41a1c, size=size.tiny)
plotshape(dwROC ? ROC : na, "Valley", shape.triangleup, location.absolute, #4daf4a, size=size.tiny)
barcolor(colTrend, editable=true)
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.
- 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.