Download MetaTrader 5

"No Price" when sending order using Ordersend()

To add comments, please log in or register
Search in documentation is available via MetaTrader 5. Search and learn!
chjsing
24
chjsing 2013.07.15 11:09 

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 

Alain Verleyen
Moderator
30745
Alain Verleyen 2013.07.15 12:26  
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 ?
chjsing
24
chjsing 2013.07.15 16:06  

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
Alain Verleyen
Moderator
30745
Alain Verleyen 2013.07.15 16:38  
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.

chjsing
24
chjsing 2013.07.16 05:30  
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);

Alain Verleyen
Moderator
30745
Alain Verleyen 2013.07.16 09:17  
chjsing:

Try to modify this line :

MqlTradeRequest request1 = {0};
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.07.16 11:18  
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 !
chjsing
24
chjsing 2013.07.16 14:41  
thanks guy, will try the code.
To add comments, please log in or register