Hi,
when I test EA strategy and put (for example random) open_price=9.999 program still open position. Why?
Hello ,
Please take a look at the CTrade standard library documentation. When using the CTrade standard library, the Buy() function is used for opening positions "at market", i.e. using the available ask price.
So, even if you use 0 (instead of 9.999) it will still open positions using the ask price.
Regards,
Malacarne
Hi,
when I test EA strategy and put (for example random) open_price=9.999 program still open position. Why?
It depends of the execution type for the symbol you are using, in general this is fixed by your broker for a given account.
For Instant and Request execution, you need to provide a price. For Exchange and Market execution, the market price is taken into account as explained by Rodrigo Malacarne (and the price you specified doesn't matter).

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
when I test EA strategy and put (for example random) open_price=9.999 program still open position. Why?