Bug in CExpertMoney::CheckOpenShort?

 

In the below code, if no price is specified the code will use the market ask price.

Surely this should be the bid if we're going short?

double CExpertMoney::CheckOpenShort(double price, double sl)
{
    if(m_symbol == NULL)
    {
        return(0.0);
    }
    //---
    double lot;
    if(price == 0.0)
    {
        lot = m_account.MaxLotCheck(m_symbol.Name(), ORDER_TYPE_SELL, m_symbol.Ask(), m_percent); // <--- Here, should it not be m_symbol.Bid() ?
    }
    else
    {
        lot = m_account.MaxLotCheck(m_symbol.Name(), ORDER_TYPE_SELL, price, m_percent);
    }
    if(lot < m_symbol.LotsMin())
    {
        return(0.0);
    }
    //---
    return(m_symbol.LotsMin());
}
 
lori:

In the below code, if no price is specified the code will use the market ask price.

Surely this should be the bid if we're going short?

Yes it is a bug, it should Bid - not Ask. I hope one of the admins reply.

Good one lori 

Get in touch with developers using Service Desk!
Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
 

How does one bring this to the attention of the guys at MetaQuotes?

How many people are using this for their trading with a bug in it, and still, almost a month later, nothing has been done about it once I've brought it up?

 
lori:

How does one bring this to the attention of the guys at MetaQuotes?

How many people are using this for their trading with a bug in it, and still, almost a month later, nothing has been done about it once I've brought it up?

I know, and its makes me wonder :D. I saw the announcement for build 722, but it did not mention about this !

I will write to service desk with the screenshot of CExpertMoney::CheckOpenShort and CheckOpenLong, see what they say ... on Monday :(

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Symbol Properties - Documentation on MQL5
 
phi.nuts:

I know, and its makes me wonder :D. I saw the announcement for build 722, but it did not mention about this !

I will write to service desk with the screenshot of CExpertMoney::CheckOpenShort and CheckOpenLong, see what they say ... on Monday :(

MQ says bug is fixed, wait for the next build.

BTW, I think we can fix that ourselves :D. 

 

Yeah, I have fixed it in my code when I found it - I posted this to be of help for others

Reason: