Skip to content
All library documents

Using One-Minute Bars to Track Another Contract’s Previous Close

Article vn.py community

Summary

A forum user asks how a strategy trading rebar futures can access the previous daily close of iron ore before the strategy starts, and whether a pre-close field is suitable. The reply recommends using a portfolio strategy module to access data for another contract, then running with one-minute bars and recording iron ore’s latest observed price.

When the bar’s calendar day changes, the strategy can use the last recorded price as the prior day’s close. This is a practical event-driven data-tracking approach for a multi-contract strategy. The discussion is brief and provides no code, testing results, or details about session boundaries, missing bars, or how the feed’s final intraday observation compares with an official settlement or close; those details would need to be handled in implementation.

Key ideas

  • A portfolio strategy module can provide access to data for a contract other than the one being traded.
  • Record the other contract’s latest price as minute bars arrive.
  • Detect a new trading day by monitoring the date in each bar timestamp.
  • Use the last recorded price before the date change as the previous day’s observed close, while accounting for session and data-feed details.

Tags

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