edgekit takes a trading idea from raw bars to a validated, sized, deployable strategy — with a prime directive baked in: assume every edge is fake until proven otherwise.
import edgekit as ek
# load -> backtest -> PROVE -> (size -> ship, only if it survives)
bars = ek.data.load_bars("US100_M1.csv")
rth = bars[ek.data.rth_mask(bars.index)] # Nasdaq cash session
trades = ek.strategy.ORB(or_bars=30, target_r=2.0).backtest(rth)
stats = ek.trade_stats(trades.r, dates=trades.date) # PF 0.71 · EV -0.21R
p = ek.validation.mcpt(trades.r.sum(), null_stat, n=1000)
print("REAL EDGE" if p < 0.01 else "rejected") # -> rejected: dead after costs

Indicators are returned unlagged; you lag explicitly. Property tests perturb future bars and assert the past never moves — the look-ahead class of bug fails CI.
Shuffle bar order to kill the trend, re-run, build a null. p < 0.01 = real edge. A no-edge strategy correctly scores non-significant — the test refuses to bless noise.
Strategies emit trades priced in units of their own risk. Dollars come once, later, from a single sizing scalar — never baked into the signal.
Simulate FTMO / CryptoFundTrader / BrightFunded evaluations — pass-rate and days-to-pass by Monte-Carlo, sized to the exact drawdown rules.
Triple-barrier labels, purged walk-forward, then serialize trees to pure-Python/C# inference that matches sklearn within 1e-6 — no sklearn at runtime.
One call renders a themed HTML report with equity curve, Monte-Carlo fan, and monthly heatmap — every image base64-inlined, zero external requests.
The viz module renders publication-quality charts in light or dark, and tear_sheet() assembles them into one self-contained HTML report. A few of them:












A complete, math-grounded course — from what a market is, through the probability and statistics that decide whether an edge is real, to building, testing, simulating, and shipping strategies. Every idea is made concrete with edgekit.
One clean, tested package — replacing ~280 copy-pasted research scripts. Core is numpy + pandas; matplotlib, scikit-learn and friends are lazy extras.
coreR-multiple + OHLC contract, lag(), Signal/Trade, RNGdataload, fetch, resample, RTH sessions, integrity, cache, splitsindicatorsatr, adx, donchian, hawkes, rsi, hedge, half-lifetimeseriesreturns, vol, ACF/PACF, variance-ratio, Hurst, featuresenginerun_bar_loop + Strategy protocol, run_backtestcostsCostModel (fraction & pips), cost_stressmetricstrade_stats, equity_stats, sharpe/sortino/pf/marriskVaR, CVaR, Cornish-Fisher, drawdown, tail ratiosizingrisk_parity, hrp, vol_target, cppi, dd_throttleoptimizemean-variance, efficient frontier, ERC, Ledoit-WolffactorsOLS (t-stats, R²), CAPM alpha/beta, factor exposuresvalidationthe gauntlet — permutation, PBO, DSR, walk-forwardstrategyBaseStrategy + templates: ORB, SmaCrossportfoliobook combination, allocation sweep, correlationchallengeprop-firm simulator, pass-rate, days-to-passoptionsBlack-Scholes price + Greeks, implied volvizmatplotlib charts + themesreportself-contained HTML reportsmlfeatures, triple-barrier, purged WF, tree exportTen minutes to your first causally-validated result, permutation p-value and all.