19 lines
578 B
Python
19 lines
578 B
Python
"""Deterministic replay backtester (toy) for MVP."""
|
|
from __future__ import annotations
|
|
|
|
from typing import List
|
|
|
|
from deltaforge_mvp.core import PlanDelta
|
|
|
|
|
|
class Backtester:
|
|
def __init__(self, seed: int = 0):
|
|
self.seed = seed
|
|
|
|
def replay(self, plan: PlanDelta) -> dict:
|
|
# Very small deterministic stub: compute a fake PnL based on number of deltas and a seed
|
|
pnl = 0.0
|
|
for d in plan.deltas:
|
|
pnl += (d.delta * 0.5) # arbitrary scaling for demo
|
|
return {"pnl": pnl, "delta_count": len(plan.deltas), "seed": self.seed}
|