trader.evaluation.base module¶
The evaluator interface: the second opinion between a signal and an order.
A strategy says “this looks like a buy”. An evaluator says whether that is worth acting on. Keeping them separate is what lets OllamaEvaluator drop in next slice without touching a strategy — and, because BacktestEvaluator is deterministic, what lets the LLM’s decisions be diffed against a reproducible baseline. Without that baseline there is no way to tell whether the model added judgement or noise.
- class trader.evaluation.base.Evaluator(*args, **kwargs)[source]¶
Bases:
ProtocolDecides whether a signal is worth acting on.
- class trader.evaluation.base.Verdict(approved, reason, evidence=<factory>)[source]¶
Bases:
objectWhether to act on a signal, and the evidence behind that.
evidence holds backtest metrics today and an LLM’s output later, with no interface change — which is the point of it being a dict rather than a fixed set of metric fields.
- Parameters:
approved (bool)
reason (str)
evidence (dict[str, object])
- approved: bool¶
- reason: str¶
- evidence: dict[str, object]¶