Download MetaTrader 5

Closing all non profit trades help.

To add comments, please log in or register
Bamtan
14
Bamtan  

Hi,

I've been working on a simple EA that runs on 16 simultaneous currency pairs using 0.01 lots and automatically closing all trade when it hits 5 profit.

It works almost as planned by like many other ea it struggle to close down all the trades in one go.

What i require is a extra piece of coding to close the non profitable trades down first, then close the profitable ones after, not worried about a profitable trade staying open.

Code was originally made on FxPro Quant for mt4 so can probably be simplified. Feel free to copy and use the system, can provide my current pairs but will likely work the same on any low spread pairings.

Also a True/False option for shutting down the EA automatically would be nice but not important.

Thanks in advanced.

Robert Jagger
658
Robert Jagger  
Bamtan:

Hi,

I've been working on a simple EA that runs on 16 simultaneous currency pairs using 0.01 lots and automatically closing all trade when it hits 5 profit.

It works almost as planned by like many other ea it struggle to close down all the trades in one go.

What i require is a extra piece of coding to close the non profitable trades down first, then close the profitable ones after, not worried about a profitable trade staying open.

Code was originally made on FxPro Quant for mt4 so can probably be simplified. Feel free to copy and use the system, can provide my current pairs but will likely work the same on any low spread pairings.

Also a True/False option for shutting down the EA automatically would be nice but not important.

Thanks in advanced.


Hi Bamtan;

Good idea, but I think you can save a lot of time (and coding) with something that has been made already. There is a great FREE trading dashboard (Dashbaord EAX) being developed over on ForexFactory.

The built-in basket management functions should handle you automatic-close problems.  

EAX has many built in indicators - so you can set up and test strategies without any coding. If your strategy cannot be created using using the EAX functions, you can also create a PIN (Plug-In) to tell EAX to open a new trade, then let EAX manage the trades and close the basket. There is a great community of people sharing setups and writing PINS.

https://www.forexfactory.com/showthread.php?t=568595

I hope this helps!

Jagz

Bamtan
14
Bamtan  
Robert Jagger:

Hi Bamtan;

Good idea, but I think you can save a lot of time (and coding) with something that has been made already. There is a great FREE trading dashboard (Dashbaord EAX) being developed over on ForexFactory.

The built-in basket management functions should handle you automatic-close problems.  

EAX has many built in indicators - so you can set up and test strategies without any coding. If your strategy cannot be created using using the EAX functions, you can also create a PIN (Plug-In) to tell EAX to open a new trade, then let EAX manage the trades and close the basket. There is a great community of people sharing setups and writing PINS.

https://www.forexfactory.com/showthread.php?t=568595

I hope this helps!

Jagz


Thank you Robert, will give it ago :)
To add comments, please log in or register