Code 138 -Requote Error Please help.

 

I just finished getting this program together but the only error i get is code 138 "Requote" when trying to execute an order, buy or sell. I dont get this code when running on FXCM platform, but some other platforms i get this code poping up once awhile.

Below is the logic of my buy order when PSfn_BuyOrder() is called up in my program. Sell order is similar:

void PSfn_BuyOrder()
{
Ticket=0;

while(true)
{
if (true)
{

RefreshRates();
string TradeComment=" EA "+FXCMProjectNumber+ " | MG#: " + MagicNumber;
Ticket=OrderSend(Symbol(),OP_BUY,Lts,NormalizeDouble(Ask, DigitPricing),0,0,0,TradeComment,MagicNumber,0,Blue);
if (Ticket > 0)
{
Alert ("Opened order Buy ",Ticket);
Total++;
return; // Exit start()
}

if (Fun_Error(GetLastError())==1)
continue;
return;
}
break;
}
return;
}

 
dkosecki:

I just finished getting this program together but the only error i get is code 138 "Requote" when trying to execute an order, buy or sell. I dont get this code when running on FXCM platform, but some other platforms i get this code poping up once awhile.

Below is the logic of my buy order when PSfn_BuyOrder() is called up in my program. Sell order is similar:

void PSfn_BuyOrder()
{
Ticket=0;

while(true)
{
if (true)
{

RefreshRates();
string TradeComment=" EA "+FXCMProjectNumber+ " | MG#: " + MagicNumber;
Ticket=OrderSend(Symbol(),OP_BUY,Lts,NormalizeDouble(Ask, DigitPricing),0,0,0,TradeComment,MagicNumber,0,Blue);
if (Ticket > 0)
{
Alert ("Opened order Buy ",Ticket);
Total++;
return; // Exit start()
}

if (Fun_Error(GetLastError())==1)
continue;
return;
}
break;
}
return;
}

Is the deviation (slippage) set to 0?
 

just fixed it, this works:

void PSfn_BuyOrder()
{
Ticket=0;

while(Ticket==0)
{


RefreshRates();
string TradeComment=" EA "+FXCMProjectNumber+ " | MG#: " + MagicNumber;
Ticket=OrderSend(Symbol(),OP_BUY,Lts,NormalizeDouble(Ask, DigitPricing),0,0,0,TradeComment,MagicNumber,0,Blue);
if (Ticket > 0)
{
Alert ("Opened order Buy ",Ticket);
Total++;
return; // Exit start()
}

if (Fun_Error(GetLastError())==1)
{
continue;
}


}
return;
}

Reason: