I have 2 questions.
1-How can I check the last order ,closed with takeprofit or closed manually ? if closed with take profit, for example do something .
2-for every new order , ea check the other open orders ,if difference between ASK price and any order open price is higher than certain amount , then open position.for example the price of opening the previous orders, at least 20 pips, will differ from the current price(ASK or BID).
Thanks a lot.
For 1, Checkout this ENUM_ORDER_REASON
for 2, i dont understand the question
thanks, but I think ENUM_ORDER_REASON is for mql5 .not for mql4.
about 2nd question : for example we have 5 open orders with these open prices: 1.13810 , 1.13750, 1.14200,1.13520,131000
now for open new order(buy or sell) , check the above prices, if current price is at least 20 pips differ from above prices, then open new order.
sorry for english.
You didn't state that you are using mql4.
I will move this topic to the mql4 section.
Do not double post.
I have deleted your other topic.