I have written an EA to open two order for each magic number ...
after opening the orders in every tick the Ea will check if the total profit or loss of two orders.. if they reach the target profit/loss the orders will close and open two new order.
I send the checkorder() function I wrote in my code.
My EA opens orders but it never close the orders after profit or loss is reached.
Could you please check the code and find the logic error/s.
Please EDIT your post and use the SRC button when you post code.
Please use the SRC button when posting code. I have done it for you this time.
To be honest, your code is not easy to read.
This is my very first code in mql4.
could you please correct me by assuming that there is only two orders for each magic number.
And the name of the order is int ticket1,ticket2
Note OrderClosePrice() works for both Buys and Sells
I have this warning for OrderSelect function in 4-2-4 section:
return value of 'OrderSelect' should be checked last.mq4 200 8
Yes I checked and now I reduced the code to:
I See one warning:
return value of 'OrderClose' should be checked last.mq4 198 8 (in section 4-2-4)
By the way in code I opened orders like this:
I found the error.
Just added a minus sign before stoploss