Skip to content
All library documents

Maintaining Daily Bars in a VeighNa Live Double-Moving-Average Strategy

Article vn.py community

Summary

This community post asks how to adapt VeighNa’s double moving-average example for daily bars in live trading and backtesting. The author describes sending ticks to a BarGenerator configured for daily aggregation, binding a daily callback, and loading historical daily data into an ArrayManager. The strategy calculates fast and slow simple moving averages and trades crossovers, while the ordinary minute-bar callback’s ArrayManager updates are commented out.

The post’s main lesson is a reported mismatch: the author observes that the default on_bar path receives one-minute bars, so updating the same ArrayManager there fills it with minute data rather than daily data. They are trying to use on_day_bar for daily updates but report that their implementation does not run. The code illustrates the intended structure, but the post contains no response or verified correction. It therefore documents a practical configuration question rather than establishing a working solution; the precise callback and data-loading behavior still need confirmation against the framework version in use.

Key ideas

  • The author wants an ArrayManager to hold daily bars for a moving-average crossover strategy.
  • The post reports that the standard bar callback receives one-minute bars in the described setup.
  • The proposed strategy routes daily aggregation and historical daily loading to a daily-bar callback.
  • The code is an unresolved question and does not demonstrate a confirmed working configuration.

Tags

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