- Nothing wrong with the code you posted. Oops, I missed the missing equals.
if (OrdersTotal () != 0){
Unnecessary. If it's zero the for loop does nothing.buy_order_exists = 1;
Don't use int and zero/one when you mean bool and true/false.- no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
for (int i = OrdersTotal()-1; i > 0; i--)
change to
for (int i = OrdersTotal()-1; i >= 0; i--)
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
I want to check if total orders are not zero, then,
if buy order exists, I want to set the variable "buy_order_exists" to "1"
if sell order exists, I want to set the variable "sell_order_exists" to "1"
But my code doesn't update the variables when the orders are exist.