Auftrag beendet
Spezifikation
Outline
I just want a simple EA that closes all open trades on a terminal and shows the current input values (for the trigger level and trail) on the chart. There should also be an emergency button to “Close All”.
If either of these trigger the Close All action, Algo trading on the terminal should be switched off.
I use a group of trending EA's that often collectively go into profit, only to watch the profit disappear when the trend retraces, usually hitting stop losses, so the profit becomes a loss.
So, I want to experiment with a trailing stop on the open profit and close all open trades. Trading should then stop and Algo trading should be switched off.
It's like treating the complete portfolio of EA's as a single trade.
The EA should have two functions
1. A profit Trail.
2. An emergency “Close All” button to be used manually.
The Profit Trail
The EA should have inputs for:
Profit to trigger the trailing stop (just an integer).
The trail amount also just an integer.
So, the Input for the trigger amount might be 10 (using the currency of the terminal) so for me this would be £10.
Trail amount input might be 5 (£5)
If the overall profit of the collective trades on the terminal reaches 10 the trail will be triggered. If the profit figure falls back to 5, all trades should be closed and Algo trading switched off. Usually a trailing stop gets hit for an ordinary trade. We live in hope and there should be no upper limit on the profit reached if it just keeps going in the right direction.
There should be a display on the chart, as below
Profit Trigger 10
Trail Profit 5
I tend to use a lot of EAs which may also have multiple trades each. So for instance a single magic number could have more than 10 associated trades.
Over all there could be hundreds of open trades achieving small profits and losses. Hopefully net profit loss for this scenario.
The EA’s all have their own operating hours allowed. So I want to be able to switch on Algo trading on the terminal and the EA’s will then pick up with new trades when their operating hours allow. I don’t want to have to go into each EA and set them back to trading again!
Emergency “Close All”
Clicking the button should close all open trades and switch off Algo trading on the terminal.
Display on Chart
Something very like this (See zipped word requirements for the suggested display)
Commercial requirements
I have looked for something like this on the Metatrader Market but none of the ones that I have tried work properly. Or others have had too much complexity added.
I want delivery of the ex5 file as well as the mq5.
Please be aware that I plan to give this away to friends of mine, if I think that it could add value and if they want it!
Feel free to put your details somewhere on the chart (no larger than font size 16) and in the code.
Feel free to give this away on the Metatrader market but please don’t charge for it. Treat it like a marketing giveaway.
Thanks
Ian Fraser