You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirmed defects in BacktestingKit/Engine/BKPresets.swift:
smaCrossoverPreset and emaCrossoverPreset enter when fast < slow and exit when fast >= slow, inverted for long crossover strategies.
stochasticFastPreset compares Fast %K with another Fast %K series using identical parameters, so entry is always true once populated and exit is always false. It should compare %K with %D.
bollingerPreset enters when lowerBand < close, which is true during ordinary in-band prices. A lower-band mean-reversion entry must test close <= lowerBand (or the operand-equivalent comparison).
customPreset returns a config whose policy is .sma, despite being selected as .customStrategy.
Acceptance criteria:
Align rule directions with the current native AlgoTrade presets and the library’s own direct crossover/Bollinger strategy behavior.
Add focused assertions for every policy preset’s indicator operands and comparisons.
Add behavioral checks showing bullish crossover entry/bearish exit, Fast %K/%D entry and exit reachability, lower-band Bollinger entry selectivity, and custom policy identity.
Keep v2/v3 rule conversion parity.
Separate design decision: policy *Crossover rules currently encode an above/below regime, not an edge-detected crossing event. Decide whether legacy parity or true crossover semantics is required before changing that behavior.
Reopened by Codex: the preset-rule corrections are still uncommitted, and release readiness also requires a V3 regression proving canonical named-preset rules are consumed instead of silently replaced by built-in rules. Scope remains preset correctness plus the minimum engine fix needed for AlgoTrade canonical requests.
Completed by Codex in PR #8 and released as v0.2.3. Named V3 policies now consume supplied canonical rules before legacy fallback; active Bollinger, Fast Stochastic, SMA/EMA crossover, and custom-policy definitions are corrected. Verification passed: focused preset tests, all 130 package tests, release build, and both GitHub CI jobs.
Activity
andywkff commentedon Aug 23, 2026
Implemented all confirmed BKPresets corrections:
Verification:
swift test --filter BacktestingKitPresetRuleTests: 4 passed, 0 failed.swift test: 132 passed, 0 failed.git diff --check: clean.andywkff commentedon Aug 23, 2026
Reopened by Codex: the preset-rule corrections are still uncommitted, and release readiness also requires a V3 regression proving canonical named-preset rules are consumed instead of silently replaced by built-in rules. Scope remains preset correctness plus the minimum engine fix needed for AlgoTrade canonical requests.
andywkff commentedon Aug 23, 2026
Expanded the correctness pass to cover all reported defects.
Current execution checklist:
Implementation and verification are in progress.
andywkff commentedon Aug 23, 2026
Completed by Codex in PR #8 and released as v0.2.3. Named V3 policies now consume supplied canonical rules before legacy fallback; active Bollinger, Fast Stochastic, SMA/EMA crossover, and custom-policy definitions are corrected. Verification passed: focused preset tests, all 130 package tests, release build, and both GitHub CI jobs.
andywkff commentedon Aug 23, 2026
All reported preset defects are implemented and verified.
Key outcomes:
Verification under stable Xcode:
swift test: 145 passed, 0 failed.swift build -c release: passed without warnings.git diff --check: clean.Commit, main convergence, and patch tag publication are the remaining release workflow steps.
andywkff commentedon Aug 23, 2026
Follow-up publication complete.
d3b337cac2ceb4origin/mainandorigin/codex/preserve-pending-exitboth resolve toac2ceb4.v0.2.4resolves toac2ceb4.