Skip to content

v0.3.20

Choose a tag to compare

@Quantweb3-Scott Quantweb3-Scott released this 02 Apr 13:09
· 30 commits to main since this release

What's Changed

Changed

  • Bybit TradFi: default tick poll interval reduced from 100 ms to 10 ms — BybitTradeFiPublicConnector.TICK_POLL_INTERVAL changed from 0.1 to 0.01. Each symbol_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 optional float | None field (default None) that overrides the MT5 tick polling rate when set. The factory passes the value through to BybitTradeFiPublicConnector. 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_type kwarg for Bybit TradFi limit orders — create_order() and create_order_ws() now accept an optional price_type kwarg ("bid", "ask", or "opponent"). When present, the OMS calls symbol_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