Trabajo finalizado
Tarea técnica
Here are the requirements for my MT4 EA:
I have an EA and the mql code for it, made by someone else, which I like, but would like to have my own EA created based on this EA.
I like the way it trades, but there are a couple of existing issues I have with it:
1. The EA is profitable, but it makes many trades for little gain, and I find that about 1/3 of my profits go to the broker in commission. I would like to see if you can reduce the number of losing trades if possible.
2. You can specify the number of Martingale levels the EA will open and also the multiplier, but I find this can quite easily open a large number of trades and hit margin call if you do not have enough funds. I would like to modify the way this works.
This EA trades quite frequently and if it opens a trade that goes in the wrong direction, it will then open another trade at double the size of the previous trade. It will keep opening and doubling the size of the previous trade till it reaches the 10th level of trades (these are all changeable in the parameters).
The changes I would like to make are as follows:
1. I would like the EA to keep opening a specified number (as set in parameters) of Martingale levels as above, but instead of hitting the next Martingale level, I want the EA to open a reversal trade. This reversal trade will go against the direction of all the existing Martingale trades and will open a trade with the lot size equal to the sum of all the negative Martingale trades multiplied by say 1.5 for example (this can be set in parameters). This reversal trade will have a SL of say 5 pips and also a trailing SL. This strategy basically decides that it will go with the market, not against it, in the hope that the this reversal trade will close in positive and cover all the losses of the losing Martingale trades.
Example:
Trade number Direction Lot Size
1st Buy 0.01
2nd Buy 0.02
3rd Buy 0.04
4th Buy 0.08
5th Buy 0.16
6th Buy 0.32
7th (Reversal trade) Sell 0.945 (this is the sum of trades 1 – 6, multiplied by 1.5)
So, instead of opening a 7th Martingale trade, it will open a new (Reversal) trade in the opposite direction of all previous trades with a TP and SL.
The level of the trailing SL is to be calculated that if all open trades (both positive and negative) are closed, there will be a profit (yet to be determined). At the same time, close the 6th trade.
· If reversal trade reaches TP, then close all trades and start over again
· If reversal trade reaches SL, then reversal trade will close. Keep all 5 Martingale level trades open as is. If the price continues to drop further, let the EA open the 6th Martingale trade as planned and let the EA continue as normal, where it may open another reversal trade if need be.
That's it for now!