Alphavo Back

Validation

IS

In-sample testing

Why

A score on the research sample may only mean the parameters fitted that stretch of history. Parameter choice and scoring both sit on the discovery-sample book. Cash and the profit factor are calculated there first.

Formula

This book

The discovery sample is booked on its own, with starting equity of 10000. The next fill is not sized from the cash that remains. Fees, 1× slippage, and funding all enter the cash. A fill that crosses the wall (entry before the wall, exit after it) is not counted.

Cash of one fill

Long cash = (exit price − entry price) × quantity × contract multiplier − fee cash − funding cash
Short cash = (entry price − exit price) × quantity × contract multiplier − fee cash − funding cash

Slippage is applied to the price before it is substituted. A long buys higher and sells lower. A short sells lower and buys higher.

Slippage fraction s = slippage basis points / 10000
The baseline is 1×, 10 basis points, s = 0.001

Long entry price = quote × (1 + s)
Long exit price = quote × (1 − s)

Fee cash = notional × rate / 100
Taker rate 0.05, maker rate 0.02. 0.05 means 0.05 percentage points. Charged once on entry and once on exit.

Funding cash = notional × 0.0001 × bars held / bars per 8 hours
0.0001 is a decimal, equal to 0.01% per 8 hours. For a long this cash is an expense. For a short this cash is income.

Profit factor

PF = (sum of cash on winning fills) / (sum of the absolute cash on losing fills)

When there are no losing fills and there are winning fills, PF is recorded as 99. It is not the average winning fill divided by the average losing fill.

Percent and Sharpe

r = this fill's cash / equity before this fill
Reported percent = r × 100

SR = mean(r) / std(r)

std is the sample standard deviation. The denominator is the number of fills minus 1. It is not annualized. T is the number of fills. The in-sample gate reads cash and PF. Sharpe is left for the later multiple-testing correction.

Pass

Fills ≥ 20
PF ≥ 1
No liquidation

All three must hold. Compounding does not enter this gate. Fewer than 20 fills, a profit factor below 1, or a liquidation: not passed.