I believe i found an error in the sampleintrabarbacktest.cs file.
When the OnBarUpdate() is called from the primary bar series (5min series in this example), do the following */
if (BarsInProgress == 1)
{
// When the fast EMA crosses above the slow EMA, enter long on the secondary (1min) bar series
if (CrossAbove(EMA(Closes[0], Fast), EMA(Closes[0], Slow), 1))
{
/* The entry condition is triggered on the primary bar series, but the order is sent and filled on the
secondary bar series. The way the (ORDER) bar series is determined is by the first parameter: 0 = primary bars,
1 = secondary bars, 2 = tertiary bars, etc. */
EnterLong(0, 1, "Long: 1min");<--------this should read EnterLong(1,1,"Long: 1min"); As You want to send the order to the 1 min bars, which is BIP==1, the primary bar is BIP==0 @ 5 min in this sample.
}
// When the fast EMA crosses below the slow EMA, enter short on the secondary (1min) bar series
else if (CrossBelow(EMA(Closes[0], Fast), EMA(Closes[0], Slow), 1))
{
/* The entry condition is triggered on the primary bar series, but the order is sent and filled on the
secondary bar series. The way the bar series is determined is by the first parameter: 0 = primary bars,
1 = secondary bars, 2 = tertiary bars, etc. */
EnterShort(0, 1, "Short: 1min"); --- Same here
}
}
When working with a system like this its hard to configure an indicator to visually indicate the entry point. If you Select the indicator data feed to be 15 min and then try to plot to a secondary data feed of 1 minutes it will just plot the close price of the last 15 bar, 15 times. Once per 1 min bar- This is expected.
However if you change the input series for the same indicator to 1 min and then try to plot the 15 min value every minute(such that it would print the 1 min increments of the 15 min bar as its built) this does not work - The Chart will only plot the 15 min price every 15 min bar. Well I have tried about every combination of BIP and input series and i cant get the strategy entrance time to match the indicator crossover point.
To make a long story short i need to be able to visually check the strategy execution time to the indicator(I know i have to check the execution time as it will appear on the primary bars rather than secondary, this is ok) that the condition took place when i have a strategy entering on a bar other than the primary feed.

Comment