Skip to content

sim report edge table: profit factor (R) prints inf / 0.000 for an empty side #1000

Closed

Description

@eaitbrahim

Found in the review of PR #998 (#988), round 1.

keel/sim/report.py::_r_cell renders the edge table's Profit factor (R) as inf when the R sample has no losing trade and as 0.000 when every trade in it is a scratch (0/0). Since #986 and #998, keel insights summary, the Rules page and keel rules backtest word these cases as n/a (no losses yet) and n/a (no wins or losses yet). An all-losses 0 stays a measured number on every surface.

_r_cell's docstring says the inf is deliberate ("inf for a profit factor with no losing R"). This field is in R, not money, so it was left out of #998's scope. The owner should decide whether the simulate report should adopt the shared wording. If it does, the sides must be decided by counting the R sample's trades (n_wins_r / n_losses_r), not by reading a zero.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions