// check if the account position is flat.
private bool isAccountPositionFlat()
{
int accountLength = getInstrumentName().Length;
lock (myAccount.Positions)
{
foreach (Position position in myAccount.Positions)
{
if (getInstrumentName() == position.Instrument.ToString )
{
return false;
}
}
}
return true;
}
Comment