Commit b418caf
committed
Fix stale tick prices for stacked bars
When a bar is delivered from _barstack via _fromstack (commonly the final
bar flushed by _last() in resampled / replayed feeds), the data.tick_*
attributes were not synchronized to the bar's OHLC values. Instead they
retained values from the previous bar, producing a stale-tick effect that
caused broker._try_exec to misprice market orders against the most recent
bar.
This patch adds a self._tick_fill(force=True) call at the end of
_fromstack() so the tick_* attributes always reflect the bar that was
just delivered.1 parent 8a71452 commit b418caf
2 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
655 | 662 | | |
656 | 663 | | |
657 | 664 | | |
| |||
0 commit comments