KST Strategy
Pine Script strategy by 镜花水月,.
The original spec has no written description. Read the source below.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 10 | ROC1 |
| v_input_2 | 15 | ROC2 |
| v_input_3 | 20 | ROC3 |
| v_input_4 | 30 | ROC4 |
| v_input_5 | 9 | SMA1 |
Source Pine Script
/*backtest
start: 2022-11-28 00:00:00
end: 2023-12-04 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("KSTStrategy", overlay = false, pyramiding=1, default_qty_type= strategy.percent_of_equity, default_qty_value = 100,commission_type=strategy.commission.percent,commission_value=0.07)
ROC1 = input(10)
ROC2 = input(15)
ROC3 = input(20)
ROC4 = input(30)
SMA1 = input(9)
ROCma1 = sma(roc(close, ROC1), 10)
ROCma2 = sma(roc(close, ROC2), 10)
ROCma3 = sma(roc(close, ROC3), 10)
ROCma4 = sma(roc(close, ROC4), 15)
hline(0)
KST = ROCma1 + ROCma2 * 2 + ROCma3 * 3 + ROCma4 * 4
signal = sma(KST, SMA1)
plot(KST, color=color.green)
plot(signal, color=color.red)
if ta.crossover(KST,signal) //and KST >= 0 //and signal >=0
strategy.entry("L",strategy.long)
if ta.crossunder(KST,signal) //and KST <= 0 //and signal <=0
strategy.entry("S",strategy.short)Published by 镜花水月, on the FMZ strategy square · last modified 2023-12-26. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/KST-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Angle Attack Follow Line IndicatorPine Script · Other · 15m
- Customizable Backtest Start Time StrategyPine Script · Other · 2d
- Gann High LowPine Script · Other · 4h
- MACD StrategyPine Script · Other
- Monthly Performance PnL Calendar StrategyPine Script · Other · 1d
- QQE MOD SSL Hybrid Waddah Attar ExplosionPine Script · Other · 4h