'\end_of_program' - unbalanced left parenthesis

 

When I add parenthesis I get another error. Can any coder help? I am new and trying to understand this language.

//Load the lot size from the last size..

if(OrderProfit() < 0)

{

if(OrderLots() == lotSize1)

{

gCalc = 2;

return(lotSize2);

}if(OrderLots() == lotSize2)

{

gCalc = 3;

return(lotSize3);

}if(OrderLots() == lotSize3)

{

gCalc = 4;

return(lotSize4);

}if(OrderLots() == lotSize4)

{

gCalc = 5;

return(lotSize5);

}if(OrderLots() == lotSize5)

{

gCalc = 6;

return(lotSize6);

}if(OrderLots() == lotSize6)

{

gCalc = 1;

return(lotSize1);

}

} else {

gCalc = 1;

return(lotSize1);

}

gCalc = 1;

return(lotSize1);

}

int getLastTicket()

{

int oTotal = OrdersHistoryTotal();

int myTicket = -1;

int lastOpenTime = -1;

bool ret;

for(int i = 0; i < oTotal; i++)

{

if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) == false)

{

Print("Access to history failed with error (",GetLastError(),")");

return(-1);

}

if(OrderMagicNumber() == MagicNumber &&

OrderOpenTime() > lastOpenTime)

{

lastOpenTime = OrderOpenTime();

myTicket = OrderTicket();

}

}

return(myTicket);

}

i2trader

 

check your parenthesis "}" count. They do not match!