"No Price" when sending order using Ordersend()

 

Hi

anyone can help me on this 'no price" error(err code = 10021) when i send my order using Ordersend().

when this "no price" error occur, do i need to delete the old order and resend a new ordersend() or i just wait for it to fill up by the system ?

thanks 

 
chjsing:

Hi

anyone can help me on this 'no price" error(err code = 10021) when i send my order using Ordersend().

when this "no price" error occur, do i need to delete the old order and resend a new ordersend() or i just wait for it to fill up by the system ?

thanks 

What price did you used ? What is your code ?
 

my code is like below: 

MqlTradeResult result1;
MqlTradeRequest request1;

request1.action=TRADE_ACTION_DEAL;  
request1.magic=Magic;  
request1.symbol=Pair;            // symbol
request1.volume=NormalizeDouble(lot,2);
request1.sl=0;                       // Stop Loss is not specified
 request1.tp=0;                    // Take Profit is not specified  
request1.type=ORDER_TYPE_BUY; // order type
request1.type_filling = ORDER_FILLING_RETURN;
request1.comment = "test";
request1.deviation = Point()*20;

OrderSend(request1,result1);
Print("RetCode 1:",result1.retcode," /err:",GetLastError()," /id:",result1.order);

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
chjsing:

my code is like below: 

...

Where is the price ? Is your broker use Market Execution for this symbol ?

Please use SRC button when you post code.

 
angevoyageur:

Where is the price ? Is your broker use Market Execution for this symbol ?

Please use SRC button when you post code.

chjsing:

my code is like below: 

MqlTradeResult result1;
MqlTradeRequest request1;

request1.action=TRADE_ACTION_DEAL;  
request1.magic=Magic;  
request1.symbol=Pair;            // symbol
request1.volume=NormalizeDouble(lot,2);
request1.sl=0;                       // Stop Loss is not specified
 request1.tp=0;                    // Take Profit is not specified  
request1.type=ORDER_TYPE_BUY; // order type
request1.type_filling = ORDER_FILLING_RETURN;
request1.comment = "test";
request1.deviation = Point()*20;

OrderSend(request1,result1);
Print("RetCode 1:",result1.retcode," /err:",GetLastError()," /id:",result1.order);

Yes, My broker is Alpari and the order was set as Market Execution.
the error description in the journal was : "failed exchange sell 0.20 EURUSD at market[No prices]


my code is like below: 

MqlTradeResult result1;
MqlTradeRequest request1;

request1.action=TRADE_ACTION_DEAL;  
request1.magic=Magic;  
request1.symbol=Pair;            // symbol
request1.volume=NormalizeDouble(lot,2);
request1.sl=0;                       // Stop Loss is not specified
 request1.tp=0;                    // Take Profit is not specified  
request1.type=ORDER_TYPE_BUY; // order type
 request1.type_filling = ORDER_FILLING_RETURN;
request1.comment = "test";
 request1.deviation = Point()*20;


OrderSend(request1,result1);
 Print("RetCode 1:",result1.retcode," /err:",GetLastError()," /id:",result1.order);

 
chjsing:

Try to modify this line :

MqlTradeRequest request1 = {0};
 
chjsing:

Yes, My broker is Alpari and the order was set as Market Execution.
the error description in the journal was : "failed exchange sell 0.20 EURUSD at market[No prices]
Read this:  https://www.mql5.com/en/forum/11354/460866#comment_460866
How open order in mql5 ?
How open order in mql5 ?
  • www.mql5.com
I don't understand documentation for open order buy stop or just buy !
 
thanks guy, will try the code.
Reason: