bool res=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderTakeProfit(),0,Blue);You are not changing anything so the Modify will fail
When the first EA recognises the conditions to close an order, you could use GlobalVariableSet and name it with the ticket number, (number will need to be changed to a string).
Then the 2nd EA can use GlobalVariableCheck to see if the GV exists for each open order
If so, after successfully closing the order, delete the GV
Hi GumRai
Thinking about this again, I would still like to know how to run the OrderModify() function anyway.
How would you change the above code to get the OrderModify() to run? (I don't mind doing the change to a ticket number, instead of arrow colour, but still seem to have problems with my code as posted above).
Any advise, or improved lines of code would be much appreciated.
Hi GumRai
Thinking about this again, I would still like to know how to run the OrderModify() function anyway.
How would you change the above code to get the OrderModify() to run? (I don't mind doing the change to a ticket number, instead of arrow colour, but still seem to have problems with my code as posted above).
Any advise, or improved lines of code would be much appreciated.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Here is what I want to do, but I just cannot seem to get it right :
I have 2 EA's, both trading one symbol - for reasons that are not really important, I want the first EA to identify the condition at which an open trade on the symbol should close, but I want the actual close to be undertaken by the second EA. To do this, I need the 2nd EA to be able to recognize the trade set-up created by the 1st EA. I have considered that ONE way to do this would be to OrderModify() the open order as soon the trade set-up is recognized by the 1st EA and then to find the changed order using OrderSelect() on the 2nd EA - if anyone has a better idea, I would be happy to hear it! My thinking though, was to simply create a "flag" on the OrderModify() that is then easy to OrderSelect(). I don't normally use arrows on my Orders, so I thought that I could simply modify the Order from one with no arrows (CLR_NONE) to one with Blue arrows, which I guess would then be easy to filter with OrderSelect(). Here's the OderModify() code, but it doesn't seem to work :
I get the following error : "Error in OrderModify. Error = 1."
If anyone is able to help with this, or even suggest a completely different way of tackling the challenge, I would greatly appreciate it.