Skip to content

Commit 98c6272

Browse files
committed
Fix backtest clock monotonicity with time alerts
- Replace Vec-based accumulator with BinaryHeap for event ordering - Add iterative processing that re-advances clocks after each callback - Rename TimeEventHandlerV2 to TimeEventHandler - Standardize FFI naming conventions - Add tests for monotonicity edge cases - Resolves #3384
1 parent 5915ee1 commit 98c6272

File tree

33 files changed

+1468
-334
lines changed

33 files changed

+1468
-334
lines changed

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Released on TBD (UTC).
1313
### Security
1414

1515
### Fixes
16+
- Fixed backtest clock monotonicity with time alerts (#3384), thanks @draphi
1617
- Fixed order updated panic during reconciliation (#3380), thanks for reporting @santivazq
1718
- Fixed trailing stops default price type (#3379), thanks @KaulSe
1819
- Fixed registering msgbus with OptionExerciseModule (#3383), thanks @davidsblom

crates/backtest/cbindgen.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tab_width = 4
1111
"UnixNanos" = "uint64_t"
1212
"TimedeltaNanos" = "int64_t"
1313
"TimeEvent" = "TimeEvent_t"
14-
"TimeEventHandler" = "TimeEventHandler_t"
14+
"TimeEventHandler_API" = "TimeEventHandler_t"
1515
"UUID4" = "UUID4_t"
1616
"Logger" = "Logger_t"
1717
"TraderId" = "TraderId_t"

crates/backtest/cbindgen_cython.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ header = '"../includes/backtest.h"'
1313

1414
"cpython.object" = ["PyObject"]
1515

16-
"nautilus_trader.core.rust.common" = ["TestClock_API", "LiveClock_API"]
16+
"nautilus_trader.core.rust.common" = [
17+
"TestClock_API",
18+
"LiveClock_API",
19+
"TimeEventHandler_t",
20+
]
1721

1822
"nautilus_trader.core.rust.core" = ["CVec", "UUID4_t"]
1923

@@ -25,7 +29,7 @@ rename_variants = "ScreamingSnakeCase"
2529
"UnixNanos" = "uint64_t"
2630
"TimedeltaNanos" = "int64_t"
2731
"TimeEvent" = "TimeEvent_t"
28-
"TimeEventHandler" = "TimeEventHandler_t"
32+
"TimeEventHandler_API" = "TimeEventHandler_t"
2933
"UUID4" = "UUID4_t"
3034
"Logger" = "Logger_t"
3135
"TestClock" = "TestClock_t"

0 commit comments

Comments
 (0)