The code you have shared in post #24 is:
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
if (longSignal)
{
entryOrder = EnterLongLimit(bIPindex, true, 1, limitEntry, entryName);
This is why when backtesting without intra-bar granularity (CalculateOnBarClose is always True when backtesting) order fills always appear on the bar after the trigger bar.
If the order is filling on the 9:46:55 bar and was submitted with the code you have suggested after the primary bar has closed, then this was triggered from the 9:46:52 bar and was filled with the prices of the tick data from 9:46:52 to 9:46:55 as this was submitted with a 1 as the BarsInProgress parameter in the entry method call overload. The order execution appears to be at 9:46:55 so right near the end of the 9:46:52 bar.
I am interested to see the tick data during this time.
Your post does not include any code for a print so I cannot confirm this print is in the same action block as the entry order.
So far, this is the only code shared that I am aware. (Let me know if I am overlooking one of your posts)
Comment