MT5 CTrade - PositionOpen issue - page 2

 
very helpful. Thank you friends. I guess this is beneficial to us.
 
nicholi shen:

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

Thanks Nicholi.
Reason: