| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
|
|
LinkBack | Thread Tools |
|
|
|||
|
|||
|
EA question
Hi all !
I have a quite simple question (I think...) Suppose I have a EA that opens several trades - all with sepecific TP. Now, I want that this EA will close all the other open trades, once one of the open trades will hit it's TP. I want that this will happend also if the EA was stopped from some reason and then restart again (So keeping internal variable that save the last-open-trades is no good solution...) How can I do that ? 10X ! |
|
|
||||
|
||||
|
Quote:
OrderOpenPrice - OrderClosePrice() for long or OrderClosePrice() - OrderOpenPrice for short If the result will be > than 0 then it was positive trade ![]() That check will work if u close trades ONLY BY TP. But if u want to check exactly if your takeprofit level was hit at that order u should do it like this: 1) get OrderTakeprofit() level from history (eg. last trade) 2) get Order open and close time 3) check in that period if the High price (eg by highest high function) was >= or Low (with lowest low) was <= than your profit target. Quite simple isn't it ? Enjoy!
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
| Bookmarks |
| Thread Tools | |
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question About EAs | mikejody | Tools and utilities | 2 | 05-25-2007 11:59 PM |
| question | evgeni1980 | Questions | 4 | 11-27-2006 01:32 PM |
| Another question, sorry. | demag | Questions | 0 | 02-13-2006 06:34 PM |