I'm having trouble with executing code that enters a position in a secondary bar series while backtesting. The command I am trying to execute is: if the price high of the current bar of the secondary bar series is greater than the variable ORhigh + (the variable Buyticks * the tick size) then enter a long position in the secondary bar series for the the number of contracts represented by the variable Shares.
The code I have is:
if (Highs [1] [0] >= ORhigh + Buyticks * TickSize)
{
count = count + 1;
EnterLong(1,Shares, "BLong");
}
The code has no compilation errors. However, when I back test the strategy no trades are executed.
I am fairly certain that he problem lies with the lines of code mentioned above, because when I substitute with the code below, that does not have any references to a secondary bar series, I see the expected trades take place when back tested.
if (High [0] >= ORhigh + Buyticks * TickSize)
{
count = count + 1;
EnterLong(Shares, "BLong");
}
It seems that my problem is getting the trade to enter a position in a secondary bar series. Please help.
Thanks in advance.
Joe
Comment