These constructors create ledgr-owned, serializable criterion steps for
ledgr_business_objective(). Each step thresholds already-computed evidence
and returns eligibility evidence only. Steps do not rank, select, promote,
persist, or alter execution or walk-forward identity.
Usage
ledgr_objective_even_trades(max_concentration = 0.3)
ledgr_objective_even_profit(max_concentration = 0.4)
ledgr_objective_stable_region(
min_neighbors = 2L,
metric = "sharpe_ratio",
direction = c("maximize", "minimize"),
parameter_columns = NULL
)
ledgr_objective_max_drawdown(max_drawdown = 0.2)
ledgr_objective_stable_runs(max_streak = 10L)
ledgr_objective_min_trades(n = 30L)
ledgr_objective_positive_trajectory(slope_min = 0)
ledgr_objective_diagnostic_threshold(x, column, threshold, comparison = NULL)Arguments
- max_concentration
Finite scalar in
(0, 1]giving the largest acceptable concentration share.- min_neighbors
Positive whole-number minimum count of supporting Manhattan-distance-1 lattice neighbors.
- metric
Non-empty sweep-summary metric column used by the strict lattice detector.
- direction
Either
"maximize"or"minimize"; values are normalized so larger detector scores are better.- parameter_columns
Optional non-empty character vector naming the candidate parameter axes.
NULLuses all resolved varying parameter columns supplied to the detector.- max_drawdown
Finite scalar in
[0, 1]giving the largest acceptable retained maximum drawdown.- max_streak
Positive whole number giving the largest acceptable consecutive winning or losing run.
- n
Non-negative whole-number minimum closed-trade count.
- slope_min
Finite minimum slope in log-equity units per retained observation.
- x
A
ledgr_dsrorledgr_min_track_recordresult.- column
An admissible candidate-level diagnostic output column.
- threshold
A finite numeric threshold for numeric columns, or one required status string for a
statuscolumn.- comparison
Optional comparison. Numeric defaults are
"at_least"fordsr_probabilityand"at_most"formin_track_record_length; status columns require equality.
Details
ledgr_objective_even_trades() divides the sweep scoring interval into four
equal-duration bins and measures the largest bin's share of closed trades.
ledgr_objective_even_profit() measures the largest single trade's share of
total absolute closed-trade realized P&L. ledgr_objective_stable_runs()
measures the longest consecutive WIN or LOSS run in trade_seq order;
BREAKEVEN rows reset a run.
ledgr_objective_stable_region() implements ledgr's strict-lattice
operationalization of Pardo's broad-plateau idea. It is not a transcription
of a Pardo formula and does not support sparse or unordered parameter spaces.
Lattice-boundary candidates have fewer available neighbors and cannot pass
when min_neighbors exceeds that available count; the detector retains the
available-neighbor count as audit evidence.
ledgr_objective_max_drawdown() accepts ledgr's canonical signed drawdown
metric and exposes its positive loss magnitude as the measured criterion
value before applying max_drawdown.
ledgr_objective_diagnostic_threshold() embeds a hashed snapshot of one
already-computed ledgr_dsr() or ledgr_min_track_record() result. It never
recomputes the diagnostic. Admissible columns are dsr_probability and
status for DSR, and min_track_record_length and status for MinTRL.
Numeric diagnostic thresholds treat Inf and -Inf as determinate boundary
evidence; missing values and NaN fail closed.
References
Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies, Chapter 11. Stable-region adjacency and tolerance are ledgr's documented operationalization, not a Pardo-authored formula.
Examples
ledgr_objective_even_trades(0.30)
#> ledgr objective criterion
#> Criterion: even_trades
#> Evidence: closed_trades
#> Hash: 19a5b751c70d
ledgr_objective_even_profit(0.40)
#> ledgr objective criterion
#> Criterion: even_profit
#> Evidence: closed_trades
#> Hash: 32eb244c8a09
ledgr_objective_stable_region(min_neighbors = 2)
#> ledgr objective criterion
#> Criterion: stable_region
#> Evidence: candidate_metric_lattice
#> Hash: 7752d7a76c9b
ledgr_objective_max_drawdown(0.20)
#> ledgr objective criterion
#> Criterion: max_drawdown
#> Evidence: summary.max_drawdown
#> Hash: 5e4779b48e89
ledgr_objective_stable_runs(10)
#> ledgr objective criterion
#> Criterion: stable_runs
#> Evidence: closed_trades
#> Hash: a92ddb2477a5
ledgr_objective_min_trades(30)
#> ledgr objective criterion
#> Criterion: min_trades
#> Evidence: summary.n_trades
#> Hash: cba89b76721e
ledgr_objective_positive_trajectory(0)
#> ledgr objective criterion
#> Criterion: positive_trajectory
#> Evidence: retained_equity
#> Hash: 69d76f8162e1