Skip to content
All library documents

Using Broker-Provided One-Minute Bars for Moving Averages

Article vn.py community

Summary

A user asks how to calculate and continuously update a moving average from completed one-minute bars pushed by the Xuntouyan real-time market-data interface in vn.py. They want to use the provider’s already aggregated bars instead of creating bars with vn.py’s own BarGenerator, and ask whether a setting or direct parameter can enable this in a strategy.

The response says this requires modifying the xt_gateway to subscribe to the bar data and forwarding those bars through the event engine to the strategy layer. The user replies that this sounds complex and expresses a preference for a direct configuration option. The exchange outlines the integration path but provides no code, implementation details, or working example. It does not explain how to calculate the moving average, handle bar updates, or confirm that the proposed modification was completed, so it is a brief integration pointer rather than a full procedure.

Key ideas

  • The user wants to calculate a moving average from provider-supplied one-minute bars.
  • The requested workflow would avoid constructing bars with vn.py’s BarGenerator.
  • The reply recommends adding bar subscriptions in xt_gateway and forwarding events to strategies.
  • The discussion gives no code or verification that the integration works.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.