Repository navigation
v0.3.20
What's Changed
Changed
- Bybit TradFi: default tick poll interval reduced from 100 ms to 10 ms —
BybitTradeFiPublicConnector.TICK_POLL_INTERVALchanged from0.1to0.01. Eachsymbol_info_tick()call completes in ~15–60 µs over the local MT5 named-pipe IPC, so 100 ms was far more conservative than necessary. Average bid/ask detection latency drops from ~50 ms to ~5 ms with negligible CPU overhead.
Added
-
PublicConnectorConfig.tick_poll_interval— New optionalfloat | Nonefield (defaultNone) that overrides the MT5 tick polling rate when set. The factory passes the value through toBybitTradeFiPublicConnector. Other exchange connectors ignore this field.# Default (10 ms) PublicConnectorConfig(account_type=BybitTradeFiAccountType.DEMO) # Custom (20 ms) PublicConnectorConfig(account_type=BybitTradeFiAccountType.DEMO, tick_poll_interval=0.02)
-
price_typekwarg for Bybit TradFi limit orders —create_order()andcreate_order_ws()now accept an optionalprice_typekwarg ("bid","ask", or"opponent"). When present, the OMS callssymbol_info_tick()at the moment the order is dispatched to MT5 and substitutes the fresh quote for the strategy-supplied price."opponent"resolves to best ask for buy orders and best bid for sell orders. Has no effect on other exchanges.# Cross the spread — price fetched fresh from MT5 at dispatch time self.create_order( symbol="EURUSD.BYBIT_TRADFI", side=OrderSide.BUY, type=OrderType.LIMIT, amount=Decimal("0.1"), price_type="opponent", )
Full Changelog: https://github.com/Quantweb3-com/NexusTrader/blob/main/CHANGELOG.md