You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am using this? Couple that with "if(OpenOrdersThisPair(Symbol())>0)" above, that should keep the EA's separated from each pair?
Ah! What if I compared compared the OrderCloseTime() and the OrderOpenTime()!?
Surely this would be the BEST way of doing what I want? That way I can add as many OrderClose functions as I want? After-all, I could simply select the trade in the history that had the same OrderOpenTime() as the current "OP_BUY", but if the OrderCloseTime() > OrderOpenTime(), then this would stop the OrderClose(), closing halves out continuously!?!
Someone please tell me that I have got something to work with here :( haha.
Forgive me, but I don't understand how that is true? I am making sure the OrderSymbol()==pair? So the relevant EA that is attached to EURUSD, would pick up it is the orderselect on EURUSD?
You OrderSelect() first . . . then you check . .
if(OrderSymbol()==pair) total++;
. . . an that is fine for that function, if the symbols don't match you don't increment the count . . . but it still means that the last Order you selected was not for the symbol you are working on.
You need an additional loop and find a valid order then exit the loop . . . then you have the correct Order Selected.
I'm confused, I've forward tested my EA on 16 different pairs, simultaneously this week and it has never selected the wrong one :s? Am I missing something?
DomGilberto:
I thought that too - It says I need OrderSelect() before using OrderType, but it works? I only ever have one order open at any given time...
I can't think of how to use OrderOpenTime() to my advantage and stop CloseHalfOrder being called every time...
EA part closes order, EA needs to know which order not to part close again, so get OrderOpenTime() before you part close. Code EA not to partclose orders on that currency pair with that same OrderOpenTime() again.
EA part closes order, EA needs to know which order not to part close again, so get OrderOpenTime() before you part close. Code EA not to partclose orders on that currency pair with that same OrderOpenTime() again.
Yea I'm starting to get there now - I assume I need to compare with trades that have closed in history on the same OrderSymbol()?
The problem I have though; I am trying to partial close the same "OP_BUY" or "OP_SELL" up to 4 times at different prices... I think the question I should be asking is, can I get a way, where by I have a rule that ALL partial closes (of any lots and price on ONE given trade) will only partially close ONCE at their predefined "OrderClose()" parameters set...
This way I am looking at doing it now with comparing the OrderOpenTime() will essentially only work once, and will restrict any other type of OrderClose() function from happening at all... I am wanting to find a way where I can have one rule applied to 4 OrderClose() functions... (if that makes sense?)
I know people are suggesting open 4 orders, but without going too deep, it's less efficient for me doing it that way.