ea pending order

 

hi,

im editing an ea base on pending order buy stop and sell stop

can someone pls help me with the error occurred which i cant identified. im not so good in coding.

principles of this ea:
1) place buy and sell stop simultaneously for every minute
2) i can set TP and Sl manually

i really appreaciate if someone can help me with this
really need it.

Files:
 

What error ?

 
Alain Verleyen:

What error ?

Obveously he cant identify the problem as he wrote 😉
 
Kenneth Parling:
Obveously he cant identify the problem as he wrote 😉

Good so you help him.

 

how do you count the open orders include the pendingsorder before one is close , I need that value
thanks a lot
I will just only the maximum of  all the open orders that value I need  

  thanks

 
rudiran: how do you count the open orders include the pendingsorder before one is close , I need that value
Just do exactly that. Loop through the orders and count them.
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
          Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
 
whroeder1:
Just do exactly that. Loop through the orders and count them.

I need only the maximum  when one is closed I don't need than the value

 and how do I use them , which give me the value of the counting orders

 I have only once nescensarry that value  when orders are close it is not nessencary

Reason: