TheOneTrade
GitHub
v6.0backtest-kit · open source · MIT

Trading systems that
think before they trade.

An AI-native trading agency for quant teams. We build the runtime — backtest-kit — where LLM reasoning, news-sentiment search and locally-hosted Pine Script run on identical code in backtest, paper and live.

0
look-ahead bias
AsyncLocalStorage
1.08
Sharpe ratio
TRX Jan 2026 case
100%
code parity
backtest = live
signal.pipeline()
haiku-4.5 · streaming
67274670516682867088
LLM reasoning · liquidation_spike_bounce
_ waiting for spike signal…
01 / The structural problem

95% of trading bots run the same five tutorial strategies.
They mostly trade against each other.

Crypto markets aren't first-order chaotic anymore. Thousands of identical RSI / MACD / Bollinger bots execute the same signal in the same 100 ms window — they create the noise they're trying to trade. The only beneficiary is the exchange's fee meter.

1,000 freqtrade bots — identical RSI(14) strategyALL · BUY
RSI(14)
28.4 ↓
BTC
$87,300
per bot / day
−18%
exchange take
+$8,000
round-trips
100/day
  1. 09:00.000RSI dips below 30 on 1,000 identical bots
  2. 09:00.100All BUY simultaneously. Price spikes 0.15%.
  3. 09:00.200RSI now reads 75 — they raised it themselves
  4. 09:00.300All SELL. Round-trip cost: −0.18% / bot.
Predictable stop placement clusters. Public indicator stacks. Tutorial copy-paste. Market makers see the clusters and harvest them.
RSI · 85%MACD · 78%BB · 65%EMA cross · 72%
→ How TheOneTrade exits the game
02 / Methodology

Four engineering decisions
that compound into edge.

Strategy alpha decays. The runtime underneath it doesn't. We invest where most desks under-invest — in the boring infrastructure that makes every iteration faithful, every signal reproducible, every deploy painless.

Look-ahead bias is architecturally impossible

Every data fetch resolves against an AsyncLocalStorage temporal context. Your strategy can't peek at future bars even if you try — the runtime refuses to surface them. Multi-timeframe joins synchronize automatically.

// no timestamp params. context flows.
const c1h  = await getCandles(s, "1h",  100);
const c15m = await getCandles(s, "15m", 100);
const c5m  = await getCandles(s, "5m",  100);
// → all three resolve to the
//   same backtest tick
AsyncLocalStoragePromise.all-safeSame code: backtest/paper/livefetchNews.ts#L136

LLMs that search the news before they trade

Eight specialised agents hit Tavily and the open web for acute event triggers — SEC actions, exchange hacks, presidential statements — within the last 4–12 hours. Vector search retrieves narrative; the LLM decides BUY / SELL / WAIT with cited reasoning.

await search("BTC breaking news ${date}");
await search("SEC CFTC DOJ action ${date}");
await search("Trump statement BTC ${date}");
await search("flash crash reason ${date}");
// → typed signal + reasoning + cited
//   sources, validated by Zod
ReAct loopTavily / Perplexity APIZod-validated outlineforecast.outline.ts#L68

Indicators run where TradingView doesn't

PineTS executes .pine files locally on any data source. Strategies built for BTC on Binance redeploy unchanged to UZSE (Uzbekistan), MSE (Mongolia), DSE (Dhaka) — markets TradingView refuses to list.

npm start -- \
  --pine ./math/feb_2026.pine \
  --timeframe 15m --limit 500 \
  --when "2026-02-28T00:00:00Z" \
  --jsonl
// → dump consumable by any LLM
//   or downstream notebook
PineTS runtime8 emerging exchangesJSONL-nativepackages/pinets

Enterprise architecture, parallel by default

Strategies, risk rules and frame definitions are first-class entities in a typed swarm. The same monorepo runs hundreds of strategies in parallel against shared exchanges and shared risk validators — no copy-paste, no drift.

addStrategySchema({
  strategyName: "liq_spike_bounce",
  interval: "15m",
  riskList: [
    RiskName.TakeProfitDistanceRisk,
    RiskName.StopLossDistanceRisk,
  ],
  getSignal,
});
agent-swarm-kitSelf-enforcing runtimeCrash-safe persistencebacktest-monorepo-parallel
03 / Reasoning, in production

Three calls during April 2026's Iran weeks.
Read the actual reasoning, not a summary.

Output from the live ReAct pipeline — search the news, weigh contradictions, emit one signal with a written justification. Pick a date to see what the agent saw, queried, and decided.

April 8, 2026 · 04:35 UTCid: apr8
01Web searches
$tavily.search("April 8 2026 Bitcoin breaking news")
$tavily.search("April 8 2026 Trump tweet Bitcoin")
$tavily.search("April 8 2026 Bitcoin flash crash")
$tavily.search("Decrypt April 8 2026 Bitcoin ceasefire")
02Reasoning

The acute event driver — Trump's announcement of a two-week ceasefire with Iran (04:30 UTC) — triggered an instant rally to $72,000, liquidation of ~$425M in short positions, and a massive volume spike (>2M BTC/hour). Facts indicate a sharp bullish impulse that should sustain price growth in the coming hours. Optimal move: open a long with a tight stop-loss around $70,000.

· $425M shorts liquidated· volume >2M BTC/h· instant +6% impulse· stop at $70K
03Decision
BUY
CONFIDENCE
91%
04 / Case study · OSINT-grade signal forensics

Liquidity harvesting,
played in reverse.

+8.54%
Portfolio PnL
1.08
Sharpe ratio
8/8
Inverted signals

A Telegram signal channel claims alpha on TRXUSDT. We treat it like an OSINT target — fingerprint the bot, geolocate the manipulation window, then trade the inversion. The seller's edge becomes ours.

Export signals
Pull every public post — entry, multiple TPs, SL, leverage. Tag by symbol and timestamp.
Fingerprint the algo
TP step multipliers always ×1.52 → ×1.74 → ×1.47 → ×1.50. Identical TP/SL ratio (1.34). It's not a human.
Spot the prep
Volume anomalies 15 min before each post. Large candle at 10:00 → SHORT recommendation at 10:15 → another candle at 10:30.
Invert + filter
Inverse the position, gate by 4H range midpoint, exit on first SL — break-even risk, asymmetric reward.
8 SHORT signals · TRXUSDT · Jan 2026σ < 0.014
#EntryTP1TP2TP3TP4
1$0.0712×1.52×1.74×1.47×1.50
2$0.0698×1.52×1.74×1.47×1.50
3$0.0721×1.52×1.74×1.47×1.50
4$0.0688×1.52×1.74×1.47×1.50
5$0.0702×1.52×1.74×1.47×1.50
6$0.0731×1.52×1.74×1.47×1.50
7$0.0695×1.52×1.74×1.47×1.50
8$0.0709×1.52×1.74×1.47×1.50
deterministic algorithm — not human judgement. Public alpha is bait.
15-min window pre-publicationp < 0.001
POST
the channel's wallet positions before the post — then sends retail to take the other side.
0%2%4%6%8%10%#1#2#3#4#5#6#7#8+8.54%

Inverting an algorithm built to harvest retail.

Eight SHORT calls at the bottom of the 4H candle — every one moved against the recommendation within 45 minutes. Net of fees and slippage, the inverted book closed January 2026 at +8.54% with a portfolio Sharpe of 1.08.

Avg peak PnL
+1.44%
Avg drawdown
−0.48%
Win rate
100%
Holding period
< 45 min
05 / Simulator

Pressure-test every strategy
against your own book.

Monte-Carlo across our published backtest distributions. Adjust capital, risk-per-trade and horizon — equity, drawdown and trade count update in real time. Production runs the same code paths against live exchange feeds.

Strategy
Capital$50,000
Risk per trade2.00%
Horizon6 months
monte_carlo.run(seed=7)n=45 trades · 6m
Final equity
$118,928
Total return
+137.9%
Monthly avg
15.54%
Max DD
−4.0%
$45.0k$64.7k$84.4k$104k$124kstart
strategy.winRate = 78%strategy.rr = 1:1.55strategy.sharpe = 1.08· past performance ≠ future returns
06 / What we offer

Five ways to put the runtime
against your problem.

From a single discovery call to multi-year asset mandates. Every engagement runs on the same open-source toolchain — so the strategy you commission today is auditable, reproducible, and yours to keep running.

01 · ENGAGEMENT

Bespoke AI strategy development

We co-design a strategy with your team — market structure analysis, hypothesis formulation, Pine Script implementation, validation runs across calendar-month frames. Delivered as runnable code in your repo, not a slide.

  • ·Monthly recalibration
  • ·Knowledge base accrues
  • ·Code reviewed by a second agent
02 · MANAGED

Discretionary asset management

We run our published strategies on your mandate. Transparent reporting via the backtest-kit UI — every trade has a JSONL audit trail and a written reasoning record.

  • ·Per-trade reasoning logged
  • ·Real-time PnL dashboard
  • ·Min. $250k AUM
03 · ENABLEMENT

Quant team training & consulting

Hands-on workshops for your desk: AsyncLocalStorage temporal patterns, ReAct agent design, Pine Script-to-TypeScript translation, swarm-kit deployment.

  • ·2 / 5-day intensives
  • ·On-site or remote
  • ·Internal handbook included
04 · INFRASTRUCTURE

Emerging-market exchange integration

Markets TradingView refuses to list — UZSE (Uzbekistan), MSE (Mongolia), DSE (Dhaka), GSE (Ghana). We build the scrape, candle synthesis and data pipeline. You get clean OHLCV and a working backtest.

  • ·8 exchanges in production
  • ·MongoDB or your warehouse
  • ·OHLCV synthesized from raw trades
05 · PLATFORM

backtest-kit enterprise license & support

Commercial license, priority issue handling, custom risk validators, SLA-backed deployments. For desks that need the OSS but can't operate it solo.

  • ·MIT core + commercial addons
  • ·Direct line to maintainers
  • ·Self-hosted or our cloud
07 / Open source · Engineering stack

Everything we build is auditable.
The runtime is MIT.

We don't sell a black box. The toolchain that powers our strategies is published on GitHub, structured as a monorepo for parallel execution. Fork it, audit it, run it on your laptop.

github.com/tripolskypetr/backtest-kitv6.0.0 · MIT
backtest-kit/
├─@backtest-kit/cliScaffold · dump · backtest · paper · live
├─@backtest-kit/pinetsLocal Pine Script interpreter
├─@backtest-kit/graphReactive source/output graph
├─@backtest-kit/uiTrade lifecycle inspector
├─agent-swarm-kitReAct + tool-calling runtime
├─functools-kitCache · str · AsyncLocalStorage
└─ollamaLocal LLM bindings
$npx -y @backtest-kit/cli--initcopy ⌘C

Self-enforcing runtime

Look-ahead bias, missing stop-loss, invalid risk-reward — all caught by Zod validators and AsyncLocalStorage guards before a signal leaves the boundary.

Parallel monorepo execution

Hundreds of strategies share one exchange handle, one risk validator pool, one queue. Read the architecture →

JSONL-native logs

Every tick, every reasoning chain, every risk rejection — appended as JSON Lines. Claude Code reads them natively; jq them in a second.

We run Pine Script on exchanges TradingView won't list.

PineTS + custom scrapers
UZSE
Uzbekistan
live
MSE
Mongolia
live
DSE
Dhaka, Bangladesh
live
GSE
Ghana
live
SGBV
Algeria
beta
BSE
Botswana
beta
ESE
Eswatini
queued
MERJ
Seychelles
queued
08 / Research log

Long-form thinking
behind every strategy.

NOTE · 018 min

How I made look-ahead bias architecturally impossible

AsyncLocalStorage as a temporal context propagated through every async boundary. Strategies physically cannot peek at future data.

· Architecture
NOTE · 0210 min

Second-order chaos: bots playing themselves at a loss

Why 1,000 identical RSI bots lose 18% / day to each other — and what to use instead of canned indicator stacks.

· Market structure
NOTE · 0312 min

How AI got hands for stock trading

Claude Code finally has a TradingView replacement — local Pine Script, JSONL logs, an agent skill that survives context resets.

· Tooling
NOTE · 0411 min

Why the price drops in a single candle

Gamma convexity, jump diffusion, and the 2-and-20 incentive structure behind liquidation cascades.

· Options · Risk
NOTE · 0514 min

AI workflow for liquidation cascade criteria

Claude's /loop command, calendar-month strategy files, and an acceptance contract that prevents brute-force iteration.

· Workflow
NOTE · 0613 min

News sentiment AI analysis blueprint

Why TauricResearch and node-ccxt-backtest both fail — and what changes when the agent searches before it decides.

· ReAct · LLM
NOTE · 079 min

AI news sentiment as a trading signal

Vector search over near-zero-score results. Why a 24-hour window beats a 4-hour one for finding regime change.

· Sentiment
NOTE · 0810 min

AI liquidity harvesting machine

Inverting a Telegram signal channel's TRXUSDT calls. Sharpe 1.08, PnL +8.54%, 8/8 inversions correct.

· OSINT · Featured
NOTE · 0911 min

Running Pine Script on exchanges without TradingView

UZSE, MSE, DSE — eight regional exchanges with no TradingView listing. Scrape, synthesize candles, run Pine.

· Emerging markets
NOTE · 107 min

Why your broker froze your deposit

Where +20%/month DCA returns actually come from — and what brokers hide on the dashboard while you wait for them.

· DCA · Risk
09 / Get started

Read the source.
Then talk to engineering.

npx -y @backtest-kit/cli --init scaffolds a working strategy in 30 seconds. When you're ready for a custom mandate, we're at tripolskypetr@gmail.com.

Read the source on GitHubEmail engineering →