Our system is designed as event stream architecture to simulate a real trading environment. If we based on the "md" object from def on_marketdatafeed(self, md, ab): to collect data, it will always be the original price observed in the market (i.e. without adjustment). For example, if we buy 100 shares at $100 and there is 2:1 stock split on the next day, then the market price will be halved and our position will become 200 shares. It will be exactly the same behavior when we listen to a real-time data stream (eg. HKEx, Bloomberg, etc) and trade in real market.
Issue Identified & Resolved
We checked that the issue you encountered is due to def on_corpAnnouncement(self, ca): missing in the backtest script such that above adjustment didn't handle properly. We applied a system patch and now it can function properly using the same script.