Trend Analysis Index [CC]
"Trend Analysis Index [CC]" by cheatcountry, MIT. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Trend Analysis Index [CC] (v1.0), read 2026-10-12T15:46:13.025Z; source language v5.
Licence: MIT License (MIT) — full text.
Trend Analysis Index [CC] by cheatcountry, ported from Pine v5. Pane indicator with 2 plots, bar/background colouring, alerts and 6 inputs.
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Trend Analysis Index [CC] script may be freely distributed under the MIT license.
// ------------------------------------------------------------------------------------------------
// Original author: cheatcountry
// Original title: Trend Analysis Index [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('Trend Analysis Index [CC]', overlay=false)
inp = input(title='Source', defval=close)
res = input.timeframe(title='Resolution', defval='')
rep = input(title='Allow Repainting?', defval=false)
bar = input(title='Allow Bar Color Change?', defval=true)
src = inp[rep ? 0 : barstate.isrealtime ? 1 : 0][rep ? 0 : barstate.isrealtime ? 0 : 1]
length1 = input.int(title='Length1', defval=28, minval=1)
length2 = input.int(title='Length2', defval=5, minval=1)
ma = ta.sma(src, length1)
hMa = ta.highest(ma, length2)
lMa = ta.lowest(ma, length2)
tai = src != 0 ? (hMa - lMa) * 100 / src : 0
taiSig = ta.sma(tai, length1)
fastMa = ta.sma(src, length2)
slowMa = ta.sma(src, length1)
slo = fastMa - slowMa
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')
taiColor = sig > 1 ? color.green : sig > 0 ? color.lime : sig < -1 ? color.maroon : sig < 0 ? color.red : color.white
barcolor(bar ? taiColor : na)
plot(tai, title='TAI', color=taiColor, linewidth=2)
plot(taiSig, title='Signal', color=color.white, linewidth=1)
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.