The idea
This long-only system treats Know Sure Thing (KST) as the main momentum switch. KST stacks four smoothed ROC legs with rising weights, then compares that sum with its own signal line. A crossover only matters when price is also above the Alligator jaw and the long-term filter MA.
An optional Choppiness Index blocks entries when the market looks too entangled—on by default. At signal time the script locks ATR-based stop and take-profit distances, then exits when high or low tags those levels. It is Pine Script v6 strategy() code with use_bar_magnifier enabled.

Indicators
- KST: four smaroc(ROC length, SMA length) legs weighted 1/2/3/4; the signal is an SMA of KST with length siglen (default 9).
- Default ROC/SMA pairs: 10/10, 15/10, 20/10, 30/15.
- Alligator jaw: smma(hl2,13) shifted 8; entries require close above the jaw.
- Filter MA: SMA/EMA/WMA/HMA/RMA/ALMA/Least Squares/VWMA; default is Least Squares MA (linear regression) length 200.
- Choppiness Index: length 14 and threshold 50 by default; when enabled, CI must stay below the threshold.
- ATR(14): when a long signal fires with no open trade, store stop as low − 1.5×ATR and take-profit as close + 3.5×ATR.
Entry rules
- Long only; pyramiding = 1.
- longSignal: KST crosses above its signal line, close is above the filter MA and the jaw, and the Choppiness condition passes.
- strategy.entry also requires time inside the Trade Start/Stop window.
- Default size is 60% of equity, with 0.1% commission and slippage set to 5.
- calc_on_every_tick = false; use_bar_magnifier = true only affects Strategy Tester fill granularity.
Exits and position sizing
- When high ≥ atrTakeProfit or low ≤ atrStopLoss, strategy.close(..., immediately = true) flattens entry1 at once.
- Stop and take-profit levels refresh only on a signal while flat; they stay fixed for the open trade.
- There is no trailing stop; reward uses the ATR take-profit multiple and risk uses the ATR stop multiple.
- Bot alert placeholders remain in the source; Coinpred does not fill sourceUuid / secretToken for you.
Inputs (source defaults)
| Input | Default | Purpose |
|---|---|---|
| ATR Stop Loss | 1.5 | Stop distance = multiple × ATR(14) |
| ATR Take Profit | 3.5 | Take-profit distance = multiple × ATR(14) |
| Filter MA Type / Length | Least Squares MA / 200 | Long-term trend filter |
| Enable Choppiness / Threshold / Length | true / 50 / 14 | Chop filter switch and parameters |
| KST ROC Lengths | 10 / 15 / 20 / 30 | Four ROC lookbacks |
| KST SMA Lengths | 10 / 10 / 10 / 15 | Smoothing for each ROC leg |
| KST Signal Line Length | 9 | SMA length of the KST signal |
| Trade Start / Stop Date | 2023-01-01 / 2025-05-01 | Allowed trading window |
| default_qty_value | 60 | 60% of equity per entry |
Things to know before using it
- It is long-only; there is no short branch.
- The default Trade Stop Date is 2025-05-01—extend it before testing after that date, or no new entries will fire.
- Default sizing at 60% of equity is aggressive; lower it to match the drawdown you can tolerate.
- Exits compare the bar’s high/low with locked levels and close immediately; gaps can widen the real fill versus the ideal price.
- The author chart is BTCUSDT on 1 hour. Backtest other intervals or markets on their own and consider retuning the filter MA length.
Installing it on TradingView
- Download the .pine file from Coinpred (active membership required, see below), or check the original page for the latest version.
- Open the Pine Editor on TradingView, create a blank script, paste the full source and save.
- Click Add to chart; start with BTCUSDT 1-hour so you can compare with the author image.
- Extend Trade Stop Date, then tune ATR multiples, filter MA type and the Choppiness threshold as needed.
- Study signals and fills in the Strategy Tester before setting alerts. Past results do not guarantee future returns.
About backtest figures
Source, license and version
- Author: Skyrexio. Original title: KST Strategy [Skyrexio]. Version 1.0 (pine-facade).
- License: Mozilla Public License 2.0 (MPL 2.0). Coinpred provides the full, unmodified source.
- Original page: https://www.tradingview.com/script/Pv1GvUVs-KST-Strategy-Skyrexio/
- Pine version: v6; script type: strategy().
- Images come from the author’s publication page, are not covered by the MPL, and are captioned “Author chart”.
- Downloads are subject to Coinpred membership terms. If you modify the source file, the modified file must remain under MPL 2.0.