Kinetic Slippage Index (KSI)
"Kinetic Slippage Index (KSI)" by HPotter, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Kinetic Slippage Index (KSI) (v2.0), read 2026-10-12T15:46:57.554Z; 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.
Kinetic Slippage Index (KSI) by HPotter, ported from Pine v6. Pane indicator with 2 plots, 2 levels, alerts and 4 inputs.
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HPotter
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.01 28/06/2026
// The indicator evaluates the "efficiency" of price movement relative to the volume expended.
// It helps identify hidden unloading opportunities for major players and trend exhaustion points.
//
// Logic: Measures the ratio of the squared true range (ATR)
//
// Signals:
// KSI spikes upward: Price is soaring on low volume (market emptiness, reversal is imminent).
// KSI drops to zero: Huge volume is not moving the price (order density, trapped flat).
// ------------------------------------------------------------------------------------------------
// Original author: HPotter
// Original title: Kinetic Slippage Index (KSI)
// Licence: MPL-2.0 (the header above is the original notice, kept verbatim)
// Pine version: 6
// 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=6
indicator("Kinetic Slippage Index (KSI)", shorttitle="KSI", overlay=false, timeframe="", timeframe_gaps=true, precision=6)
//Inputs
int atrLength = input.int(14, title="ATR / Range Period", minval=1)
int volEmaLength = input.int(20, title="Volume EMA Period", minval=1)
int sigLength = input.int(9, title="Signal Line Period", minval=1)
float sigSpike = input.float(0, title="Spike Signal Level", minval=0)
//Calculate
float trueRange = ta.tr(true)
float emaVolume = ta.ema(volume, volEmaLength)
float ksiRaw = emaVolume > 0 ? math.pow(trueRange, 2) / (volume * emaVolume) : 0
float ksi = ksiRaw * 1000000
float signal = ta.ema(ksi, sigLength)
//Hist coloring
color histColor = ksi > signal ? color.new(color.green, 30) : color.new(color.red, 30)
//Draw
plot(ksi, title="KSI Histogram", color=histColor, style=plot.style_histogram, linewidth=2)
plot(signal, title="Signal Line", color=color.orange, linewidth=1)
hline(0, "Zero Line", color=color.gray, linestyle=hline.style_dashed)
hline(sigSpike, "Spike Line", color=color.orange, linestyle=hline.style_dashed)
//Alerts
bool isSpike = ta.crossover(ksi, sigSpike)
alertcondition(isSpike, title="KSI Anomalous Spike", message="KSI Alert! Anomalous volume/range divergence detected on {{exchange}}:{{ticker}}, TF: {{interval}}. Potential trend exhaustion or false breakout.")
This file is under the Mozilla Public License 2.0; it is a port of the original by HPotter, 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.