Experts: Multi Pair Closer

 

Multi Pair Closer:

This EA will monitor the net profit of a currency basket and close all positions when the specified profit has been acquired. It does not matter which chart you run the bot on, all pairs that you have chosen to monitor will be monitored.

Inputs example

Author: Matthew Colter

 
Automated-Trading:

Multi Pair Closer:

Author: Matthew Colter

Can you make one with stop loss as well ?

 
Perdagangan Otomatis :

Pasangan Multi Pasangan :

Penulis: Matthew Colter

Maaf, saya tidak begitu faham tentang EA ..

Apakah EA bisa berjalan tanpa vps ... ??!

 
Johannes Jilles van Duijn:

Can you make one with stop loss as well ?

Do you mean that you would want it to close all trades if the net profit was below a certain value?

 
this is great. But i have an issue when multi pair ea closes a few trades, my other ea opens a new trade while multi pair ea is still in process of closing the basket. And then Multi Pair ea closes that new trade.
Can you fix? i was thinking that it created a list of order ticket numbers of trades to close, rather than closing all open trades?
 
Revo Trades:
this is great. But i have an issue when multi pair ea closes a few trades, my other ea opens a new trade while multi pair ea is still in process of closing the basket. And then Multi Pair ea closes that new trade.
Can you fix? i was thinking that it created a list of order ticket numbers of trades to close, rather than closing all open trades?

It closes all of the open trades for each symbol in the list once the profit target is reached. Maybe one symbol has a net loss and another symbol has a net profit, overall the profit is at the target so it closes them all. The issue you're describing is a race condition where orders are opened while the EA is closing all the orders, a list of order numbers would avoid this issue and make the EA slower. The race condition would still exist though, because you could still open an order just before the EA closes all of the orders and I would have no way of knowing that you wouldn't want the newest order closed. I've responded to your chat message with a solution but I'll post it here as well. I could add a setting that tells the EA not to close orders until they're a few minutes old, and the setting would give you the choice of how many minutes old the orders would need to be. This would eliminate any race condition where the EA closes orders that were opened just before and during the process of taking profit. The downside to using this setting would be in cases where you're only opening a single order at a time on multiple symbols and expecting to take a profit quickly, like when trading economic data releases, because maybe the profit would come and go in the amount of time set. I would make it so that setting the "wait minutes" to zero would make the EA behave just as it does now, and that would be the default for the setting. Let me know if this sounds like a solution that would work with the way you're combining experts and I could update this.

 
New draft in progress! Awaiting live test results from @Revo Trades
 

@Revo Trades has tested the updates and they appear to be working. I've submitted the new version and documentation updates to the mods.

New features to watch for:

 
In the image i have added swap and commission to Profit Target
Files:
mod.PNG  11 kb
 
Revo Trades:
In the image i have added swap and commission to Profit Target

Does that help? My broker doesn't have those fees, all I pay is the spread.

 
hello I tried to installed but disappear how work?
Reason: