Fix canonical preset execution for v0.2.3 - #8
Conversation
Committed by Codex.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b74fd54b78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| indicatorOneType: .sma, | ||
| indicatorOneFigure: [50, 0, 0], | ||
| compare: .largerOrEqualTo, | ||
| compare: .smallerOrEqualTo, |
There was a problem hiding this comment.
Make crossover predicates mutually exclusive
When the 50- and 150-period averages are equal, the new entry condition (>=) and this exit condition (<=) are both true. On flat price histories or whenever the averages converge exactly, the state-based backtester can repeatedly enter and then exit positions even though no crossover occurred; the same overlapping pair is introduced in emaCrossoverPreset. Use non-overlapping predicates (or previous/current-value crossing detection) so equality alone cannot trigger both signals.
Useful? React with 👍 / 👎.
Summary
Verification
swift test --filter BacktestingKitPresetRuleTestsswift test(130 tests)swift build -c releasePull request created by Codex. Tracks #7.