
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
Hi AED,
Some people like to make things a lot more difficult than they need to be. The problem with your original code was that you were using the wrong methods. You should have been using CTrade::BuyLimit and CTrade::SellLimit instead. If I were you I wouldn't muck about with the low-level functions as others suggest and instead use the standard library classes as they were intended to be used. Here is a working example you can run on history data with the debugger.
Docs: https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuylimit