I have a strategy which open 2 trades when a condition is true like the code below.
================================================== ============
if(mycondition==true)
{
if(BarsInProgress==1 && Positions[1].MarketPosition != MarketPosition.Long)
{
EnterLong(NbContratA, "B1");
EntryPriceA=Close[0];
}
if(BarsInProgress==2 && Positions[2].MarketPosition != MarketPosition.Short)
{
EnterShort(NbContratB, "S1");
EntryPriceB=Close[0];
}
}
================================================== ===========
This code works but the orders for the 2 stocks aren't passed at the same hour.
The strategy turns on a 10 minutes chart, and I had 10 minutes or 20 minutes of difference between the time where the stock A buy and the stock B sell.
Could you explain the problem please?
Thank's a lot for your answer.
Comment