Counting total Sell orders at a certain distance from a Buy order
- You are potentially incrementing your count for non-sell orders. Move your test inside the type=sell.
- There is no order position OrdersTotal(). Remove the equals.
- Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic
number filtering on your OrderSelect/Position select 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 programming forum
MagicNumber: "Magic" Identifier of the Order - MQL4 Articles - Use ++X instead of X=X+1.
Hi guys and girls,
I m trying to count how many sell orders i have at a certain distance from a Buy order.
This is the code i got but it gives me wrong results.
Thanks a lot.