I have a strategy that runs on daily bars, and I'm add()'ing a 1 minute bar series in Initialize() so I can book a trade using intrabar granularity.
I check to see if my condition is hit using the 1 minute bar (BarsInProgress != 0) and I look 2 minutes before the close of the daily bar (determined using Bars.Session.NextEndTime). If my condition is met, I book the trade using the secondary bar (EnterLong(1,numberOfContracts, longName1)).
When I run my strategy on a chart (or backtest), the date and time of the trade shown on the Executions tab for all of the historical trades shows the correct date and time of the trade (1 minute before the end time for the daily bar in the current day).
However on the chart, the trade is always shown on the bar for the next day, even though the trade was executed during the bar for the current day.
Is there any way to make the trade show on the correct bar on the chart ?
Bob A.

Comment