if(BarsInProgress == 2);
{
if(Position.MarketPosition != MarketPosition.Flat)
{
if(Positions[0].GetProfitLoss(Close[0], PerformanceUnit.Currency) + Positions[1].GetProfitLoss(Closes[1][0], PerformanceUnit.Currency) >= TopProfit
|| Positions[0].GetProfitLoss(Close[0], PerformanceUnit.Currency) + Positions[1].GetProfitLoss(Closes[1][0], PerformanceUnit.Currency) <= -TopStop)
{
ExitLong(0, Positions[0].Quantity, "Es Combined", "EsLE");
ExitShort(0, Positions[0].Quantity, "Es Combined", "EsSE");
ExitLong(1, Positions[1].Quantity, " Zn Combined", "ZnLE");
ExitShort(1, Positions[1].Quantity, "Zn Combined", "ZnSE");
}
}
}
1) How do I get this working with multiple instruments?
2) Would it be better to do this check in BarsInProgress 1 and 2 instead? I thought about this but wondered if it my send double the exit orders if they both triggered at the same time leading to unwanted positions.

Comment