Skip to content
All library documents

Why Five-Minute Bars Can Differ by Timestamp Convention

Article vn.py community

Summary

This forum discussion explains an apparent five-minute discrepancy between bars produced by different charting and trading systems. One participant observes that some platforms label a bar with the time at its end, while the discussed VeighNa bar appears to use the start time. The replies clarify that the bar’s timestamp is the beginning of its interval and that the bar data object does not separately store an end timestamp.

The practical lesson is to distinguish the interval represented by a bar from the timestamp used to label it. Two systems can aggregate equivalent minute data yet display different times because they use different start-versus-end conventions. The thread does not settle whether a user should shift timestamps when writing data to a database; that depends on the convention expected by downstream tools and on whether consistency with another source is required. Blindly adding five minutes could mislabel the interval, so the timestamp convention should be checked and applied consistently across data ingestion, storage, and comparison.

Key ideas

  • A five-minute bar timestamp may identify the interval’s start or its end.
  • The discussed VeighNa bar uses its start time as the timestamp.
  • Different timestamp conventions can make equivalent bars appear five minutes apart.
  • The thread does not prescribe a universal database adjustment; the correct choice depends on downstream conventions.
  • Consistent timestamp handling is necessary when combining or comparing bar data.

Tags

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