Opening Hedge Trade, Please Help!

 

Is this string preventing a second order from opening?

Total = OrdersTotal();

//Check position
bool IsTrade = False;

for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELLSTOP && OrderSymbol() == Symbol()) {
IsTrade = True;
if(OrderType() == OP_BUYSTOP) {

How do I change it to allow as a second trade? Could someone explain the process?

Please Help!