Write strategies.
Test thousands in seconds.

TrainBard compiles Pine Script through a custom engine and runs it against historical crypto data at scale.

ohlcv · 7,344 candles
67241
67389
66812
67102
2841
67450
66998
67215
66780
67122
66540
66891
3102
66920
66410
66755
67890
68102
67650
67940
4521
68200
67800
68050
68340
68510
68100
68280
2190
68400
68020
68310
67500
67820
67200
67650
3890
67700
67100
67580
69010
69245
68800
69100
5102
69300
68750
69080
index · timestamps · volume
04-01
04-01
04-01
04-01
04-02
04-02
04-02
04-02
1.2M
0.8M
2.1M
1.5M
0.9M
1.8M
2.4M
1.1M
04-03
04-03
04-03
04-03
04-04
04-04
04-04
04-04
3.0M
1.4M
0.7M
1.9M
2.2M
1.6M
0.5M
1.3M
04-05
04-05
04-05
04-05
04-06
04-06
04-06
04-06
1.7M
2.8M
0.6M
1.0M
4.1M
2.0M
1.2M
0.9M
strategy · pine script
//@version=5
strategy("MA Cross", overlay=true)
fast = input.int(9, "Fast")
slow = input.int(21, "Slow")
if ta.crossover(ta.ema(close,fast), ta.ema(close,slow))
  strategy.entry("L", strategy.long)
parameter sweep · 19,521 combinations
backtesting · batch 1–9,760
backtesting · batch 9,761–19,521
ranking · evaluation
sorting 19,521 results by return...
rank 1: fast=56 slow=62+52.11%
rank 2: fast=56 slow=61+46.67%
rank 3: fast=57 slow=60+46.52%
...19,518 more
buy&hold: -8.15%
▸ best result · +52.11%

Pine Script Compiler

Write strategies in Pine Script — the same language used on TradingView — and run them directly in TrainBard. Our custom-built compiler translates your logic into a high-speed runtime.

Supports indicators, strategy entries/exits
ta.ema, ta.sma, ta.rsi, ta.crossover
Variable declarations, conditionals, loops
Expanding coverage — not all features live yet

Mass Backtesting Engine

Test parameter combinations at scale. Our engine processes tens of thousands of backtest permutations in seconds against historical crypto market data.

~19,500 backtests in under 10 seconds
BTC, ETH, SOL + major pairs
1m, 5m, 15m, 1h, 4h, 1d candles
Full trade log + equity curves

19,521 backtests, one strategy

Moving Average Cross on BTC/USDT, 1h candles, Apr 2025 – Feb 2026. Every fast/slow length combination tested. Here's what surfaced.

Best Return
+52.1%
fast 56 / slow 62
Combinations
19,521
parameter sweep
Buy & Hold
-8.2%
same period
Best Win Rate
54.5%
fast 57 / slow 60
Equity Curves — Top 25 vs. Buy & Hold
Best Top 25 Buy & Hold
+60% +30% 0% -15%
Apr 2025 Jun Aug Oct Dec Feb 2026
Rank Fast Slow Return Win Rate Trades Max DD Final Value
1 56 62 +52.11% 52.73% 220 $1,839 $15,211
2 56 61 +46.67% 50.39% 258 $2,179 $14,667
3 57 60 +46.52% 54.55% 330 $1,789 $14,652
4 57 59 +46.26% 53.69% 406 $2,330 $14,626
5 58 62 +46.17% 52.24% 268 $1,420 $14,617
6 57 61 +46.05% 52.90% 276 $1,679 $14,605
7 55 62 +46.04% 51.43% 210 $1,837 $14,604
8 56 63 +45.09% 52.38% 210 $1,891 $14,509
9 56 60 +44.53% 51.82% 274 $2,194 $14,453
10 53 62 +44.32% 48.08% 208 $2,372 $14,432
11 55 64 +44.23% 51.65% 182 $2,325 $14,423
12 22 21 +44.21% 59.45% 943 $3,203 $14,421
13 56 64 +43.61% 52.04% 196 $1,965 $14,361
14 50 65 +43.13% 48.00% 150 $2,213 $14,313
15 55 61 +42.99% 51.69% 236 $2,230 $14,299
16 23 20 +42.93% 58.36% 563 $3,083 $14,293
17 57 58 +42.53% 54.51% 554 $2,524 $14,253
18 58 60 +42.52% 51.01% 396 $1,694 $14,252
19 42 67 +42.43% 43.75% 129 $1,733 $14,243
20 41 67 +42.24% 45.90% 123 $1,674 $14,224
21 55 63 +41.92% 50.50% 202 $2,028 $14,192
22 58 63 +41.82% 51.91% 262 $1,454 $14,182
23 43 66 +41.65% 44.78% 134 $1,860 $14,165
24 58 61 +41.53% 51.53% 326 $1,524 $14,153
25 24 20 +41.46% 60.41% 491 $2,866 $14,146

What you write

Standard Pine Script — paste from TradingView or write from scratch.

// @version=5
strategy("EMA Crossover", overlay=true)

// Parameters
fastLen = input.int(9, "Fast EMA")
slowLen = input.int(21, "Slow EMA")

// Indicators
fastEMA = ta.ema(close, fastLen)
slowEMA = ta.ema(close, slowLen)

// Entry logic
if ta.crossover(fastEMA, slowEMA)
    strategy.entry("Long", strategy.long)

if ta.crossunder(fastEMA, slowEMA)
    strategy.close("Long")

Start backtesting

TrainBard is in early access.

request access