chart/app
Chris Amow 039e91b4e4 Stop a zero-price tick and a late exchange bar corrupting the store
Two faults, both introduced by the tick feed, both visible as a huge bar that
flattened the price scale.

A LEVEL_ONE_FUTURES update arrived carrying LAST_PRICE: 0. The parser rejected
None, but 0 is not None, so a minute opened at zero — o=0.0 h=7777.25 l=0.0 —
and provisional_higher carried that low into 5m, 15m, 30m, 1h and the daily bar.
Non-positive prices are treated as absent now, so the last real price carries
forward and the update still counts as the trade it is.

Separately, store.put replaced a bar only when it matched the tail. That was
sufficient while one closed bar arrived per minute, but ticks open the next
minute before CHART_FUTURES delivers the previous one, so the exchange's own bar
stopped matching the tail and was silently dropped — leaving the tick-built
approximation, with its partial volume, in place permanently. put now searches
back a bounded number of buckets for the one it belongs to, and refuses to let a
provisional bar overwrite a settled one.

Tests cover all three invariants: a zero price parses as a trade with no price,
a late closed bar replaces its bucket and keeps the exchange's volume, and a
tick cannot overwrite a settled bar.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 17:10:24 -05:00
..
analysis Fix trendline anchors jumping away from where they were drawn 2026-08-10 15:18:40 -05:00
api Add chart comments and turn Lines & levels into Drawings 2026-08-10 15:58:21 -05:00
bars Stop a zero-price tick and a late exchange bar corrupting the store 2026-08-10 17:10:24 -05:00
market Stop a zero-price tick and a late exchange bar corrupting the store 2026-08-10 17:10:24 -05:00
notify Implement M4 confluence alerts 2026-08-09 20:51:32 -05:00
__init__.py Implement M0 Yahoo market data and replay 2026-08-09 20:36:13 -05:00
config.py Update higher timeframes from ticks, and count volume-only trades 2026-08-10 12:07:52 -05:00
runtime.py Update higher timeframes from ticks, and count volume-only trades 2026-08-10 12:07:52 -05:00