Skip to content
All library documents

Diagnosing Daily Bar Dates and Prices in VeighNa Portfolio Bar Generation

Article vn.py community

Summary

This forum exchange discusses discrepancies in daily bars built from intraday data using VeighNa's PortfolioBarGenerator. A user reports that bars formed with a presumed close near the end of the session show the previous day's date and that live synthesized prices differ from values seen after reinitialization. The replies explain that VeighNa timestamps bars by their start time, which can matter for instruments with overnight sessions because ticks may arrive on the prior calendar day.

The discussion also identifies a possible update bug: daily-bar refresh logic changed price, volume, and turnover without updating the timestamp. It recommends inspecting the stored starting bar and logging the relevant generator behavior. This is a focused troubleshooting exchange, not a full implementation guide; it provides no source code, systematic test procedure, or evidence that the diagnosis resolves every reported discrepancy.

Key ideas

  • VeighNa uses the bar start time as the K-line timestamp, so the displayed date may precede the session close date.
  • Overnight trading can cause ticks for a trading session to arrive on the previous calendar day.
  • A daily-bar update that changes prices and volumes but leaves the timestamp untouched can preserve a stale date.
  • The suggested debugging steps are to inspect the initial stored bar and log the generator's behavior.

Tags

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