- https://www.metatrader4.com/en/trading-platform/help/positions/orders
- Pending Order
Pending order is the client's commitment to the brokerage company to buy or sell a security at a pre-defined price in the future. This type of orders is used for opening of a trade position provided the future quotes reach the pre-defined level. There are four types of pending orders available in the terminal:
- Buy Limit – buy provided the future "ASK" price is equal to the pre-defined value. The current price level is higher than the value of the placed order. Orders of this type are usually placed in anticipation of that the security price, having fallen to a certain level, will increase;
- Buy Stop – buy provided the future "ASK" price is equal to the pre-defined value. The current price level is lower than the value of the placed order. Orders of this type are usually placed in anticipation of that the security price, having reached a certain level, will keep on increasing;
- Sell Limit – sell provided the future "BID" price is equal to the pre-defined value. The current price level is lower than the value of the placed order. Orders of this type are usually placed in anticipation of that the security price, having increased to a certain level, will fall;
- Sell Stop – sell provided the future "BID" price is equal to the pre-defined value. The current price level is higher than the value of the placed order. Orders of this type are usually placed in anticipation of that the
- www.metatrader4.com
- https://www.metatrader4.com/en/trading-platform/help/positions/orders
- Pending Order
Pending order is the client's commitment to the brokerage company to buy or sell a security at a pre-defined price in the future. This type of orders is used for opening of a trade position provided the future quotes reach the pre-defined level. There are four types of pending orders available in the terminal:
- Buy Limit – buy provided the future "ASK" price is equal to the pre-defined value. The current price level is higher than the value of the placed order. Orders of this type are usually placed in anticipation of that the security price, having fallen to a certain level, will increase;
- Buy Stop – buy provided the future "ASK" price is equal to the pre-defined value. The current price level is lower than the value of the placed order. Orders of this type are usually placed in anticipation of that the security price, having reached a certain level, will keep on increasing;
- Sell Limit – sell provided the future "BID" price is equal to the pre-defined value. The current price level is lower than the value of the placed order. Orders of this type are usually placed in anticipation of that the security price, having increased to a certain level, will fall;
- Sell Stop – sell provided the future "BID" price is equal to the pre-defined value. The current price level is higher than the value of the placed order. Orders of this type are usually placed in anticipation of that the
Gurus:
I am not a programmer, but I got an EA made on Freelance from someone (this guy is a good person and a programmer, but seems he has hit a snag on this one).
The EA I have got (essentially a grid trading EA):
- Works perfect on demo account
- Gives error on 2 real accounts (I tested this on two real accounts to be sure of this)
EA was tested on same symbol with similar specifications with same broker. Nothing different.
I also checked with broker and they confirmed there are no restrictions / limitations from their end.
Error log from real account is appended below: error is that server gives bid and ask values as 0.00 on real account.
I would appreciate if one of you can help fixing this. I will really appreciate it.
Thanks
Sulaiman
Do not double post!!
I have deleted your duplicated post.
Do not double post!!
I have deleted your duplicated post.
I am sorry Keith. I did not double post on this thread. It was a different thread. Irrespective, my bad.
I hope I get the help on above from one of the gurus.
Thanks
Gurus:
I am not a programmer, but I got an EA made on Freelance from someone (this guy is a good person and a programmer, but seems he has hit a snag on this one).
The EA I have got (essentially a grid trading EA):
- Works perfect on demo account
- Gives error on 2 real accounts (I tested this on two real accounts to be sure of this)
EA was tested on same symbol with similar specifications with same broker. Nothing different.
I also checked with broker and they confirmed there are no restrictions / limitations from their end.
Error log from real account is appended below: error is that server gives bid and ask values as 0.00 on real account.
I would appreciate if one of you can help fixing this. I will really appreciate it.
Thanks
Sulaiman
If you want to get help, show your code, you don't have to post all of it, just the part where the bid\ask price is requested.
Gurus:
I am not a programmer, but I got an EA made on Freelance from someone (this guy is a good person and a programmer, but seems he has hit a snag on this one).
The EA I have got (essentially a grid trading EA):
- Works perfect on demo account
- Gives error on 2 real accounts (I tested this on two real accounts to be sure of this)
EA was tested on same symbol with similar specifications with same broker. Nothing different.
I also checked with broker and they confirmed there are no restrictions / limitations from their end.
Error log from real account is appended below: error is that server gives bid and ask values as 0.00 on real account.
I would appreciate if one of you can help fixing this. I will really appreciate it.
Thanks
Sulaiman
Trade server return code is 10009, that means the operation was successful!
if(m_trade.Buy(olot,NULL,m_symbol.Ask(),sl,tp,comment)) { if(m_trade.ResultDeal()==0) { Print("#1 Buy -> false. Result Retcode: ",m_trade.ResultRetcode(), ", description of result: ",m_trade.ResultRetcodeDescription()); dnPrintResult(m_trade,m_symbol); } else { lastlvl = m_trade.ResultPrice(); lastlot = m_trade.ResultVolume(); Print("last buy level = ",lastlvl); Print("#2 Buy -> true. Result Retcode: ",m_trade.ResultRetcode(), ", description of result: ",m_trade.ResultRetcodeDescription()); dnPrintResult(m_trade,m_symbol); } }
Highlighted yellow, shows where a wrong check is made, the right way to check if a trade operation was successful in MT5 is shown below
if(m_trade.Buy(olot,NULL,m_symbol.Ask(),sl,tp,comment)) { if(m_trade.ResultRetcode()!=10009) { Print("#1 Buy -> false. Result Retcode: ",m_trade.ResultRetcode(), ", description of result: ",m_trade.ResultRetcodeDescription()); dnPrintResult(m_trade,m_symbol); } else { lastlvl = m_trade.ResultPrice(); lastlot = m_trade.ResultVolume(); Print("last buy level = ",lastlvl); Print("#2 Buy -> true. Result Retcode: ",m_trade.ResultRetcode(), ", description of result: ",m_trade.ResultRetcodeDescription()); dnPrintResult(m_trade,m_symbol); } }
Trade server return code is 10009, that means the operation was successful!
Highlighted yellow, shows where a wrong check is made, the right way to check if a trade operation was successful in MT5 is shown below
Hi,
as you can see that the trade was successful, and the Result RetCode was 10009.
So, even if we use your code, it will not avoid the trade done at 0.00, right?
Please correct me if I am wrong.
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 2020.07.05
How to call indicators in MQL5 - MQL5 Articles 12 March 2010
Trade server return code is 10009, that means the operation was successful!
Highlighted yellow, shows where a wrong check is made, the right way to check if a trade operation was successful in MT5 is shown below
This didn't work. Bid and ask price still return as 0.00. Expert tab file attached.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear Members,
I am trying to write an Expert Advisor with MQL5 that initiates buy limits based on certain EMA values. Here is the code that I have written in OnTick() function.
When I run it it strategy testing with EURUSD on H1 timeline, I get the following error most of the times:
Can you please tell me what I might be doing wrong?
Apologies in advance if this is a very basic question for your precious time, I am new into MQL5 coding and it is hard for me to understand many things. I have read the existing material as much as I can but I still do not understand why I am getting this error. Please help and thank you.