How it works
Evaluation
How a circuit is paper traded over a generation: cost model, stop and lock, fitness, idle penalty and the hold baseline.
The window#
A generation has 60 window quotes per market (about one hour) and 60 warmup quotes before them. Warmup quotes are only used so lookbacks have history. No trading happens in warmup.
| Parameter | Value |
|---|---|
gen_ticks | 60 quotes per market |
warmup | 60 quotes |
pop | 24 circuits |
cost_bps | 5 bps per unit of position change |
dd_weight | 0.5 |
idle_penalty | 0.001 (0.1%) |
These values are in every record under params.
Paper trading, step by step#
Equity starts at 1. For each window quote i, except the last:
- Compute the signal. If it says keep, use the current direction.
- Apply the lock (see below).
- If a position is open, check the stop.
- Move to the target position
direction × size(rounded to 4 decimals). If it differs from the current position, pay the cost and log a trade. - Mark to market: equity grows by
position × (p[i+1] - p[i]) / p[i]. - Update peak equity and max drawdown.
A position chosen at quote i earns the move from i to i+1. At the last quote any open position is closed (reason close) and pays the cost.
Cost model#
cost = 5 bps × |new position - old position|
equity = equity × (1 - |to - from| × 0.0005)5 bps equals the pools' fee tier (0.05%). A flip from long 1 to short 1 is a change of 2 units and costs 10 bps. There is no slippage or gas model. See Paper vs real execution.
Stop and lock#
The stop is measured from the entry price, which is the price of the last position change.
long: adverse = (entry - p[i]) / entry * 10000
short: adverse = (p[i] - entry) / entry * 10000
adverse > stop_bps -> close to flat (reason "stop")After a stop the circuit is locked on that side. While the signal keeps pointing the same way, it stays flat. The lock clears as soon as the signal points anywhere else (flat or the other side). This stops a circuit from re-entering the same losing trade on the next quote.
Each trade is logged with a reason: signal, stop or close.
Fitness#
ret = final equity - 1
maxdd = largest fall from a peak in equity, as a fraction
fitness = ret - 0.5 × maxddAll three are rounded to 8 decimals. Drawdown is tracked after each mark to market, so the final closing cost counts in ret but not in maxdd.
Idle penalty#
A circuit that never trades in the window has no evidence. Its fitness is set to -0.001 (−0.1%) instead of 0. Without this, doing nothing would beat every circuit that took a small loss.
Hold baseline#
For each market the engine also scores holding the base asset through the window:
ret = (p_last / p_first) × (1 - 0.0005) × (1 - 0.0005) - 1
maxdd = largest fall from a peak in price over the window
fitness = ret - 0.5 × maxddp_first is the first window quote and p_last the last. The cost is paid on entry and exit. The baseline is stored in the record under baseline, per market.
Ranking#
Circuits are sorted by fitness, highest first. Ties are broken by id in ascending order. The rank decides who survives and who gets offspring. See Selection & mutation.
Paper only. No funds are traded. $FOUS is not launched. Nothing here is financial advice.