Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-ollama-crontab/llms.txt

Use this file to discover all available pages before exploring further.

The January 2026 backtest ran two identical passes over the same parsed-signal set: one where every signal the parser accepted was executed immediately, and one where each signal first had to survive a veto check from a local Ollama LLM (gpt-oss quantized). The LLM evaluates candle-derived metrics — avgRangePct and momentum24hPct — against hard thresholds embedded in a system prompt, then returns a riskAction: "skip" | "follow" verdict. Both runs share the same entry price, take-profit (TP3), and stop-loss as configured in the strategy; the only difference is whether the LLM gate was active.
The LLM rules are fully deterministic. Given the same historical candle data, the same avgRangePct and momentum24hPct values are computed, and the same riskAction verdict is always produced. There are no stochastic or temperature-dependent components in the risk outline — results are 100 % reproducible from the raw OHLCV cache.

Summary: Baseline vs. Ollama

The headline result is a +16.68 percentage-point improvement in total PnL by vetoing six signals (net −5 trades, because one additional trade was captured only in the Ollama run).
MetricWithout OllamaWith OllamaΔ
Total trades2217−5 trades skipped
Total PnL+52.22%+68.90%+16.68 pp
Winrate68%82%+14 pp
Wins / Losses15 / 714 / 3−4 losing trades
Sharpe Ratio+0.309+0.512+0.203
Profit factor2.736.37+3.64
Expectancy per trade+$2.37+$4.05**+1.68(per1.68** (per 100 stake)

+16.68 pp PnL

Total return jumps from +52.22% to +68.90% over the same January 2026 period.

Winrate: 68% → 82%

Four fewer losing trades dropped the loss count from 7 to 3.

Profit Factor: 2.73 → 6.37

Each dollar risked now returns 6.37ingrossprofitvs.6.37** in gross profit vs. **2.73 without the filter.

Trade Log: Without Ollama (22 Trades)

All 22 signals executed in sequence. Seven ended at the stop-loss.
#SymbolOpened (UTC)Closed (UTC)HeldDirOpenClosePeakDDPNL%Exit
1SOLJan 05 07:13Jan 05 20:0912.9hLONG$135.23$139.10+2.42%−1.72%+2.45%take-profit
2NEARJan 06 08:46Jan 06 11:443.0hLONG$1.77$1.80+1.57%−0.59%+1.64%take-profit
3HYPEJan 06 09:59Jan 06 12:132.2hLONG$26.52$27.04+1.55%−1.41%+1.56%take-profit
4TRXJan 06 10:17Jan 11 00:06109.8hSHORT$0.2915$0.3027−0.32%−4.21%−4.24%stop-loss
5FARTCOINJan 06 10:43Jan 17 23:50277.1hSHORT$0.4401$0.3500+19.34%−7.64%+20.13%take-profit
6NEARJan 06 19:10Jan 06 20:471.6hLONG$1.76$1.80+1.66%−0.71%+1.81%take-profit
7NEARJan 07 13:28Jan 08 06:1516.8hLONG$1.76$1.69−0.38%−4.09%−4.26%stop-loss
8NEARJan 09 15:23Jan 12 13:4570.4hSHORT$1.69$1.66+1.19%−4.93%+1.28%take-profit
9PUMPJan 10 14:13Jan 14 16:1298.0hLONG$0.002381$0.002930+21.10%−5.42%+22.58%take-profit
10TRXJan 12 13:09Jan 15 17:0776.0hSHORT$0.2979$0.3099−0.29%−4.43%−4.45%stop-loss
11BTCJan 13 11:31Jan 13 15:594.5hLONG$92,202.22$93,400.00+0.81%−0.71%+0.90%take-profit
12HYPEJan 13 17:21Jan 13 22:144.9hLONG$24.46$25.19+2.44%−0.40%+2.59%take-profit
13SOLJan 15 13:55Jan 18 23:4681.8hLONG$145.20$139.10−0.14%−4.58%−4.59%stop-loss
14TRXJan 16 17:59Jan 17 14:1520.3hLONG$0.3080$0.3144+1.66%−0.61%+1.66%take-profit
15SOLJan 19 05:26Jan 20 08:0726.7hSHORT$133.50$130.40+1.88%−1.56%+1.93%take-profit
16POLJan 21 17:41Jan 21 19:592.3hLONG$0.1329$0.1376+3.11%−0.40%+3.12%take-profit
17TRXJan 22 09:16Jan 28 08:46143.5hSHORT$0.2999$0.2930+1.89%−4.00%+1.89%take-profit
18SOLJan 22 09:32Jan 25 16:0178.5hLONG$129.90$125.10+0.20%−4.05%−4.08%stop-loss
19POLJan 22 12:26Jan 23 14:0325.6hLONG$0.1340$0.1290+0.15%−4.11%−4.15%stop-loss
20FARTCOINJan 26 16:21Jan 31 14:28118.1hSHORT$0.2824$0.2300+17.97%−11.99%+18.20%take-profit
21SOLJan 28 22:15Jan 29 14:5916.7hLONG$125.46$120.50−0.13%−4.21%−4.34%stop-loss
22TRXJan 30 12:19Jan 31 20:4432.4hSHORT$0.2895$0.2867+1.29%−2.44%+0.58%time-exit

Statistics: Without Ollama

MetricValue
Total trades22
Total PnL+52.22%
Wins / Losses15 / 7
Winrate68%
Mean trade PnL+2.374%
Std dev per trade7.676%
Sharpe Ratio (per-trade)+0.309
Max drawdown (single trade)−4.59%
Profit factor2.73
Expectancy per trade**+2.37(per2.37** (per 100 stake)

Trade Log: With Ollama (17 Trades)

Five signals were vetoed. One additional signal (TRX LONG Jan 15) was captured only in the Ollama run because the LLM’s pass over that candle window surfaced the opportunity. Three stop-losses remain — the LLM cannot eliminate all risk, only improve the odds.
#SymbolOpened (UTC)Closed (UTC)HeldDirOpenClosePeakDDPNL%Exit
1SOLJan 05 07:13Jan 05 20:0912.9hLONG$135.23$139.10+2.42%−1.72%+2.45%take-profit
2NEARJan 06 08:46Jan 06 11:443.0hLONG$1.77$1.80+1.57%−0.59%+1.64%take-profit
3HYPEJan 06 09:59Jan 06 12:132.2hLONG$26.52$27.04+1.55%−1.41%+1.56%take-profit
4FARTCOINJan 06 10:43Jan 17 23:50277.1hSHORT$0.4401$0.3500+19.34%−7.64%+20.13%take-profit
5NEARJan 06 19:10Jan 06 20:471.6hLONG$1.76$1.80+1.66%−0.71%+1.81%take-profit
6NEARJan 09 15:23Jan 12 13:4570.4hSHORT$1.69$1.66+1.19%−4.93%+1.28%take-profit
7PUMPJan 10 14:13Jan 14 16:1298.0hLONG$0.002381$0.002930+21.10%−5.42%+22.58%take-profit
8BTCJan 13 11:31Jan 13 15:594.5hLONG$92,202.22$93,400.00+0.81%−0.71%+0.90%take-profit
9HYPEJan 13 17:21Jan 13 22:144.9hLONG$24.46$25.19+2.44%−0.40%+2.59%take-profit
10TRXJan 15 12:11Jan 15 22:3510.4hLONG$0.3055$0.3124+1.86%−0.49%+1.86%take-profit
11SOLJan 15 13:55Jan 18 23:4681.8hLONG$145.20$139.10−0.14%−4.58%−4.59%stop-loss
12TRXJan 16 17:59Jan 17 14:1520.3hLONG$0.3080$0.3144+1.66%−0.61%+1.66%take-profit
13SOLJan 19 05:26Jan 20 08:0726.7hSHORT$133.50$130.40+1.88%−1.56%+1.93%take-profit
14POLJan 21 17:41Jan 21 19:592.3hLONG$0.1329$0.1376+3.11%−0.40%+3.12%take-profit
15SOLJan 22 09:32Jan 25 16:0178.5hLONG$129.90$125.10+0.20%−4.05%−4.08%stop-loss
16POLJan 22 12:26Jan 23 14:0325.6hLONG$0.1340$0.1290+0.15%−4.11%−4.15%stop-loss
17FARTCOINJan 26 16:21Jan 31 14:28118.1hSHORT$0.2824$0.2300+17.97%−11.99%+18.20%take-profit

Statistics: With Ollama

MetricValue
Total trades17
Total PnL+68.90%
Wins / Losses14 / 3
Winrate82%
Mean trade PnL+4.053%
Std dev per trade7.918%
Sharpe Ratio (per-trade)+0.512
Max drawdown (single trade)−4.59%
Profit factor6.37
Expectancy per trade**+4.05(per4.05** (per 100 stake)

What the LLM Vetoed

The LLM issued 6 veto decisions in total across the January 2026 signal set. The financial impact breaks down as follows.
Four of the six vetoed signals were stop-loss trades. Skipping them avoided a combined −17.29% drawdown.
SignalDatePnL avoided
TRX SHORTJan 06−4.24%
NEAR LONGJan 07−4.26%
TRX SHORTJan 12−4.45%
SOL LONGJan 28−4.34%
Total−17.29%
The two false-positive vetoes (TRX SHORT Jan 22 and Jan 30) were both thin-range SHORT signals on a low-volatility day — precisely the pattern the LLM is calibrated to flag. In live trading the conservative bias is intentional: the cost of skipping a modest winner is far lower than absorbing a full stop-loss on a stop-hunt setup.

How the Filter Works

The veto logic lives in packages/core/src/logic/outline/risk.outline.ts. It is not a learned model — it is a set of empirical threshold rules encoded in the LLM system prompt and validated through a Zod schema.
Two computed metrics drive every decision:
  • avgRangePct — the average high-minus-low candle range as a percentage of mid-price, derived from the most recent 1m and 15m candles at signal time.
  • momentum24hPct — the 24-hour price change expressed as a percentage.
The embedded rules:
Rule 1 (sleeping-coin SHORT veto):
  if direction == "SHORT" and avgRangePct < 0.07%
    → riskAction = "skip"
    rationale: thin candle range indicates a sleeping, illiquid market;
               a short here is likely a stop-hunt setup.

Rule 2 (falling-knife LONG veto):
  if direction == "LONG" and momentum24hPct < -1%
    → riskAction = "skip"
    rationale: entering a long while the asset is in a 24h downtrend
               increases the probability of catching a knife.
Both thresholds are tunable in the system-prompt string without touching or recompiling any packages/ source file.
The LLM response is validated against a Zod schema (RiskOutlineFormat in packages/core/src/contract/RiskOutline.ts) that requires:
// packages/core/src/contract/RiskOutline.ts
export const RiskOutlineFormat = z.object({
  action:      z.enum(["skip", "follow"]),
  sure_level:  z.enum(["low", "low_medium", "medium", "medium_high", "high"]),
  confidence:  z.enum(["reliable", "not_reliable"]),
  description: z.string(),
  reasoning:   z.string(),
});
The raw LLM fields (action, sure_level, confidence) are mapped to the screen-items document fields riskAction, riskSureLevel, and riskConfidence by SignalLogicService. Only when riskAction === "follow" does the strategy open a position.

Build docs developers (and LLMs) love