Nik Stoch
Stochastics Oscillator with settings of 5,3,3 Levels : 15, 85, 30, 70 backtest
Stochastics Oscillator with settings of 5,3,3 Levels : 15, 85, 30, 70
backtest

Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_int_1 | 14 | lookback_period |
| v_input_int_2 | 3 | m1 |
| v_input_int_3 | 3 | m2 |
| v_input_int_4 | 5 | lookback_period1 |
| v_input_int_5 | 3 | m3 |
| v_input_int_6 | 3 | m4 |
Source Pine Script
/*backtest
start: 2022-04-09 00:00:00
end: 2022-05-08 23:59:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
indicator('Nik Stoch')
lookback_period = input.int(14, minval=1)
m1 = input.int(3, minval=1)
m2 = input.int(3, minval=1)
k = ta.sma(ta.stoch(close, high, low, lookback_period), m1)
d = ta.sma(k, m2)
//plot(k)
//plot(d, color=color.red)
h0 = hline(15)
h1 = hline(85)
h2 = hline(50)
h3 = hline(30)
h4 = hline(70)
fill(h0, h1, color=color.new(color.purple, 95))
/////stoch fast
lookback_period1 = input.int(5, minval=1)
m3 = input.int(3, minval=1)
m4 = input.int(3, minval=1)
k1 = ta.sma(ta.stoch(close, high, low, lookback_period1), m3)
d1 = ta.sma(k1, m4)
plot(k1, color=color.new(color.aqua, 0))
plot(d1, color=color.new(color.red, 0))
if k1[1] < d1[1] and k1 > d1
strategy.entry("Enter Short", strategy.short)
else if k1[1] > d1[1] and k1 < d1
strategy.entry("Enter Long", strategy.long)
Published by ChaoZhang on the FMZ strategy square · last modified 2022-05-10. 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/Nik-Stoch.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
- RedK Volume Accelerated Directional Energy RatioPine Script · Other · 1h
- SSL Hybrid STOCH RSIPine Script · Other · 15m
- Alert alertcondition or strategy alertsPine Script · Other · 4h
- RedK Dual VADER with Energy BarsPine Script · Other · 45m
- VuManChu Cipher B Divergences StrategyPine Script · Other · 2h
- Dynamic Stop Loss Alert TradingView StrategyPine Script · Other · 3h