Error 129 with a basic orderSend function

 

Why do I get error 129 in this code?


RefreshRates();
if(0 < OrderSend(Symbol(),OP_BUY,LotSize,Bid,SlippageAllowed,0,0,NULL,0,0,Green))
{

// do stuff

}

else

{

// do other stuff

}

 

You want to Buy on Bid. Try that:

RefreshRates();
if(0 < OrderSend(Symbol(),OP_BUY,LotSize,Ask,SlippageAllowed,0,0,NULL,0,0,Green))
{

// do stuff

}

else

{

// do other stuff

}
 

Fantastic. Thank you very much.

Reason: