I am developing a strategy that executes simultaneous orders on two different instruments. One of the instruments is ES 12-17 and the other is ES 09-17.
The second expiration ES (12-17) has lower amount of historical data due to lower volumes.
I am executing my orders with the following code:
"
if (Positions[0].MarketPosition == MarketPosition.Flat)
{
EnterShort(0, 1, "Short Alpha");
}
if (Positions[1].MarketPosition == MarketPosition.Flat)
{
EnterLong(1, 1, "Long Beta");
}
"
I however noticed that on some occasions the execution only takes place on the first instrument (ES 09-17). And does not execute on the second instrument.
Not sure if the reason for this is any market data missing, but I tried to add
if (BarsInProgress == 0 & BarsInProgress == 1)
{
[All STRATEGY CODE]
}
but when I added it nothing ever was executed as if the strategy didnt run at all.
When I remove that code, executions are made, but sometimes not simultaneous/symmetrical (e.g. only the ES 09-17 gets executed).
Please help!
Comment