Swing Intelligence, powered by k1

Swing Intelligence,
powered by K1

A rule-based reading of market structure, and the research engine that measures it. K1 follows 29 markets every day, records how every signal behaved, and tests each new idea against years of market history before it is allowed to change anything.

More than 3,000 hours went into building the K1 system as a whole, Swing Intelligence and the ITBF top-and-bottom finder included. Built by Keyvan Khodakhah, it now researches every day, and the work continues.

The K1 research loopMarket data feeds Swing Intelligence; ideas are backtested on years of history, checked with seven tests on data they never saw, remembered trade by trade in the scorecard, and the Lab turns weak spots into new ideas, round and round. Only an idea that passes all seven tests and is approved by Keyvan changes Swing Intelligence; anything else goes back to research.THE K1 RESEARCH LOOPRUNS DAILYK1RESEARCH ENGINEMarket dataprices · economy · newsSwing Intelligencesignals · rangesBacktestyears of history · costsSeven-test checkdata it never sawScorecardevery trade rememberedLab researchnew ideas, planned firstPasses all 7 testsApproved by KeyvanSwing Intelligence improvesAnything that fails a test goes back to research. Nothing here is a trading signal.

Figure 1. The K1 research loop, running daily. Nothing reaches Swing Intelligence unless it passes all seven tests and is then approved by its author.

Research and education only. We do not give buy or sell signals, we do not manage anyone's money, and we may hold positions in some markets for our own account. Read the full statement.

The system at a glance

As of 29 November 2026
DevelopmentMore than 3,000 hours to build the K1 system as a whole, Swing Intelligence and ITBF included; its research continues every day
K1 research engine51,000+ lines of Python in 270+ modules
Automated checks490+ tests that every change must pass before it is accepted
ITBF model4,975 lines of Pine Script v6
Markets followed daily29: crypto, gold and silver, US index and sector funds, leading US stocks
Research record96 recorded findings; every test planned in writing before it runs
Standard for a new ideaSeven tests, including holdout data, walk-forward windows and 2,000-run Monte Carlo and bootstrap checks
PublicationMorning notes, afternoon updates and weekly reviews, each with its sources

Swing Intelligence

The indicator and the strategy

Swing Intelligence is a rule-based indicator and strategy for TradingView, written in Pine Script v6. It reads a chart the way a structural analyst does, with one difference: every rule is written down, and every threshold is measured in the market's own volatility rather than in points or percentages.

Volatility-normalised swings
Moves are measured in units of the average true range (ATR, 14 periods, Wilder smoothing). A turn is confirmed only when price reverses by a set multiple of ATR on a closed candle, so one rule set reads Bitcoin on a four-hour chart and gold on a daily chart in the same way.
The range model
The recent trading range is split into a premium area near the top, an equilibrium band in the middle and a discount area near the bottom (Figure 2). Where price sits in its range is the context for every reading.
Market structure
Support and resistance, trendlines, liquidity sweeps, breakouts and changes of character are mapped around each confirmed swing.
Invalidation built in
Every confirmed turn comes with the level that would prove it wrong: beyond the reversal extreme, plus a volatility buffer. Two targets complete the picture.
A strategy twin
The strategy version runs the same engine in TradingView's Strategy Tester, so anyone can test the rules on their own market, timeframe and costs.
The Swing Intelligence range model A price path inside its recent range. The range is split into a premium area near the top, an equilibrium band in the middle and a discount area near the bottom. A turn is confirmed only after price reverses by at least 1.5 times the average true range on a closed candle; the invalidation level sits beyond the reversal extreme. PremiumEquilibrium Discount range high range low turn confirmed:reversal of 1.5 × ATR invalidation, beyond the low swing high
Figure 2. The range model. Zones give context, not instructions: a confirmed turn needs a reversal of at least 1.5 ATR on a closed candle, and its invalidation level sits beyond the turn's extreme. Illustration, not market data.

ITBF

The top-and-bottom finder

ITBF is a hybrid model of 4,975 lines of Pine Script that grades the quality of a trend and looks for the conditions that mark tops and bottoms. It was built the way K1 tests ideas: each component was measured on its own, and the ones that did not improve the results were switched off.

Trend regime
An EMA 50 and 100 ribbon, qualified by ADX and directional movement, Kaufman's efficiency ratio, the ribbon's separation in ATR units, its slope, and a limit on how often it flips. A regime is confirmed only after consecutive closes and held until the opposite confirmation, which removes most whipsaws.
Higher-timeframe agreement
A four-hour trend is checked against the weekly candle, a daily trend against the monthly one.
No-trade state
A chop detector built from weak ADX, low efficiency, a squeezed ribbon and frequent flips.
Exits and protection
A failed-breakout exit, a time stop for trades that make no progress, a partial target and a pivot trail.
Risk overlay
A two-stage overlay that reacts to soft closes and to the distance from the trend's peak, with hysteresis on the way back.
Ablation tested
A structure engine (pivot pools, third-touch trendlines, channels), liquidity sweeps and springs, Wyckoff signs of strength and weakness, candle patterns and oscillator scores were all built and measured. Only what added value stays switched on.

K1

The research engine

K1 is the system behind Swing Intelligence. It gathers the data, runs the rules, keeps the records, does the testing and writes the daily analysis. It is written in Python and runs every day on its own server.

Data
Prices from exchanges, brokers and TradingView, and economic statistics from official sources, checked for gaps and late candles before anything uses them.
Engine
A Python implementation of the Swing Intelligence strategy, matched trade for trade against TradingView, with commission, slippage and price ticks modelled.
Observation
29 markets followed on paper every day. Each closed candle is logged with its events (rejections, engulfing candles, sweeps of prior highs and lows, momentum and volume conditions) and with what followed over the next 3, 6 and 12 candles.
Trade memory
Every trade is stored with its maximum adverse and favourable excursion in units of risk, the time it was held, and the market's state at entry: trend side, slope and volatility band.
Scorecard
Recent results are compared with a bootstrap band built from history, so drift shows early. A weak spot is reported only when it is statistically separate from the market's average in both halves of the data.
Strategy Lab
One pre-registered test a day from a queue of methods and new ideas. Results are recorded whether the idea passes or fails.
Publication
Morning notes before the London open, afternoon updates and weekly reviews, each with its sources listed.

How an idea is tested

The seven tests

No idea reaches Swing Intelligence on the strength of a good-looking backtest. The plan is written and published before the test runs, and a candidate has to beat the current rules on all seven tests.

  1. Design period. Better return per unit of drawdown than the current rules on the first 70% of the history, with at least 20 trades affected.
  2. Holdout. The same result on the last 30%: data that was never used to choose anything.
  3. Walk-forward. Better in at least four of six consecutive windows, so the edge is not one good period.
  4. Double costs. Still better, and still profitable, with commission and slippage doubled.
  5. Parameter neighbours. At least 75% of the nearby settings still beat the current rules, so the result is not one lucky setting.
  6. Monte Carlo. The order of trades reshuffled 2,000 times; the 95th-percentile drawdown must stay within set limits.
  7. Not luck. A bootstrap of the average result per trade: no more than 5% of 2,000 resamples may fall at or below zero.

Beside every result, K1 reports how much capital was actually in use and the return on that capital. Ideas that fail go back to research, and the failure is recorded as carefully as a success.

An idea that passes all seven tests still changes nothing until Keyvan Khodakhah has seen the full results and approved it.

Important

Swing Intelligence and K1 are research and education. Nothing on this site or on markets.khodakhah.net is financial advice or a recommendation to buy or sell any investment.

  • We do not give buy or sell signals or trade recommendations, and we do not run a signal service. What Swing Intelligence draws on a chart is an aid for your own analysis; every decision stays yours.
  • We do not manage, hold or invest anyone else's money.
  • We may hold positions in some of the markets we write about, for our own account.
  • Markets can fall as well as rise, and you can lose money. Backtests and past results describe the past and do not promise future results.