I have the same question.... Can we take 0 as a successful result?
Qoyyuum Kadir:
10009
10009
Forum on trading, automated trading systems and testing trading strategies
Trade Failed Due to retcode: 10009, with comment: Request executed
Vladimir Karputov, 2022.05.05 08:20
In MQL5 I use trading classes. In particular, I normalize Stop Loss and Take Profit with CSymbolInfo::NormalizePrice, and for volume normalization I use the following function:
//+------------------------------------------------------------------+ //| Lot Check | //+------------------------------------------------------------------+ double LotCheck(double lots,CSymbolInfo &symbol) { //--- calculate maximum volume double volume=NormalizeDouble(lots,2); double stepvol=symbol.LotsStep(); if(stepvol>0.0) volume=stepvol*MathFloor(volume/stepvol); //--- double minvol=symbol.LotsMin(); if(volume<minvol) volume=0.0; //--- double maxvol=symbol.LotsMax(); if(volume>maxvol) volume=maxvol; //--- return(volume); }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
As long as the Return Code is not 10009, I can safely assume its an error but looking up on the list of return code here: https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes I couldn't find anything for 0.
Here's a sample of the order check result: