Strategy vault / Trend following
KijunSen Line With Cross
Kijen Sen Independent Line of Ichimoku Trading System Many traders in the financial markets use Ichimoku components to detect trends, which is why I published this indicator. backtest
Kijen Sen Independent Line of Ichimoku Trading System
Many traders in the financial markets use Ichimoku components to detect trends, which is why I published this indicator.
backtest

Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 26 | Length |
| v_input_2 | true | Show Candle Cross? |
Source Pine Script
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dilan1999
//@version=5
indicator('KijunSen Line With Cross', overlay=true)
n = input(26, 'Length')
h = ta.highest(high, n)
l = ta.lowest(low, n)
value = (h + l) / 2
showCross = input(true, title='Show Candle Cross?')
crossUp = ta.crossover(hl2, value)
crossDown = ta.crossunder(hl2, value)
//Show Cross
plotshape(showCross and crossUp, text='*', style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.white, 0), size=size.small)
plotshape(showCross and crossDown, text='*', style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.small)
//Drawline
plot(value, color=(hl2 > value ? color.lime : color.red), linewidth=2)
if showCross and crossUp
strategy.entry("Enter Long", strategy.long)
else if showCross and crossDown
strategy.entry("Enter Short", strategy.short)
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/KijunSen-Line-With-Cross.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
- Advanced Multi Indicator Multi Dimensional Trend Cross Quantitative StrategyPine Script · Trend following · 3h
- Dual ATR Channel Trend Following StrategyPine Script · Trend following · 15m
- Trend Following Strategy Based on Ichimoku CloudPine Script · Trend following · 1d
- Triple Supertrend Ichimoku Cloud Quantitative Trading StrategyPine Script · Trend following · 1d
- A Strict Trend Following Strategy Based on Ichimoku Kinko HyoPine Script · Trend following · 30m
- ADX Based One Hour TENKAN KIJUN Cross Trend Tracking StrategyPine Script · Trend following · 1h