Trabalho concluído
Termos de Referência
Hi all!
Please can you make an expert advisor that uses two EMA's, MACD and the MACD histogram bars to enter and exit trades that also uses an existing EA I have had made that I will attach once we are in discussion of the work
The Previous EA is based on a martingale strategy and 7 “rules” based on when to reset the lot size. The EA I will attach enters a buy trade then a sell trade, a buy and then a sell etc and if one of these trades loses the next trade has double the lot size to recoup for the last. I have 7 rules that disctate when the lot size will return to the original default set by me to the losses do not become too high.
This new EA will be a combination of the two. The first EA used 7 rules and took trades in the order of buy, sell, buy, sell etc at a set take profit and stop loss (I usually used 1 pip)
For this new EA the "back end" or the entry side of the strategy is being taken away and is replaced by the below please
For the new EA the 7 rules will be kept, the lot size will be increased on every losing trade however the buy, sell, buy, sell structure will be replaced by the below strategy:
As soon as the old EA would exit a trade it would enter a new one straight away dependent on a spread filter. Please remove this part of the old EA (keeping the spread filter please!) and replace the entry criteria for a trade with the below trading strategy:
https://docs.google.com/document/d/1c4omsOFTjoIbwyvJ7DSMRTq95BpxDTJH0VZnP2EM8i4/edit?usp=sharing
So I can't attach PDF's in this chat the file type isn't supported so use that link and download as PDF. File -> Download -> Download as PDF
https://docs.google.com/document/d/1VU7n2K7kwnx80KKTmrCF66pjFu9tD-MHdLhDHNoNqUk/edit?usp=sharing
This is a link to my actual trading plan which is much shorted and easier to follow - use in google docs or download as PDF, your choice :)
https://www.youtube.com/watch?v=9o6BG-dCgco&ab_channel=TradePro
Also, I don't think you'll need this but the other developer really struggled...
This video is very close to my strategy. My strategy is a modified version of the one in the video. My entry using the histogram comes sooner than his and I also don't exit at a 2-1 reward risk, I exit after a 2-1 is achieved on a change in the histogram bars
https://www.youtube.com/watch?v=oQQ-VCJYc6M&t=0s&ab_channel=TradePro
Another video, guy but more examples :)
Please note I don't have an existing MACD divergence indicator. As it may be hard to find an accurate one you may need to make one from scratch and add it in. I currently trade this strategy all manually using Trading view
The strategy was made and tested using the 5 minute timeframe and works as follows:
When the 5 minute 150 EMA (blue) (15 minute 50 EMA) is above the 5 minute 600 EMA (yellow) (1H 50 EMA) the EA will look for long trades only (based on MACD divergence)
When the 5 minute 150 EMA (blue) (15 minute 50 EMA) is below the 5 minute 600 EMA (yellow) (1H 50 EMA) the EA will look for short trades only (based on MACD divergence)
Entry:
When entering long we must see MACD divergence to the upside as seen below (apologies if you already know what this is, I’d rather give too much information than too little, sure you’ll agree)
As price moves down the MACD line (not the signal line) moves up between the same two points in time.
The two points in price go from the open/close price not the highs/lows of the wicks. The higher high going short or the lower low going long cannot be exactly equal and must differ by 1 pip. Please can you add a filter where I get to decide how much in pips the highs and lows must be for entry. I will likely keep this at one pip.
Price can be anywhere relative to the two EMA’s, above them, between them or below them, doesn’t matter.
The same is said for short trades:
As price moves up, the MACD line moves down between the same two points (Entry is at the red arrow pointing down and the exit at the red arrow pointing up)
Entry:
When entering a trade:
The MACD line cannot touch the histogram 0 line between it’s “two points” - the MACD line cannot go negative on short trades or positive on long trades before entry.
Between the two points the MACD red and green histogram bars must change colour twice before entry can happen
For short trades the histogram lines must go: positive value, negative value, positive value, entry
For long trades the histogram lines must go: negative value, positive value, negative value, entry
For long trades the MACD line must be below the MACD 0 line
For short trades the MACD line must be above the MACD 0 line
Once we have the EMA’s in the right direction, MACD divergence and the above histogram set up, our entry comes in the first change in the histogram bar in our desired direction.
(Short entry on red arrows pointing down)
If we’re entering short the histogram bar must already be above the 0 line (positive) and entry comes in the first drop in value whether still positive but just less than the previous bar or it goes negative.
If we’re entering long the histogram bar must be below the 0 line (negative) and entry comes in the first rise in value whether still negative or it goes fully positive
(Entry is on the red arrow pointing up)
Stop loss -
The stop is placed 1.5 pips (15 points/ticks) above or below the most recent high or low depending on whether you’re going long or short. (please add the option to let me decide the stop loss value)
The stop loss cannot exceed 10 pips.
Any trade above a 10 pip SL cannot be taken (please also add an option that lets me decide when a trade won’t be taken based on the stop loss size. I found trades with a stop loss larger than 10 pips to be unprofitable)
Take profit/trade management:
As soon as the trade is twice as far from the entry price as the stop loss is in pips then the EA will exit the trade on the first change in the histogram bar in the opposite direction of our trade. So as soon as the trade is at a 2:1 reward risk then management comes in and makes an exit as soon as the histogram bars moves in the opposite direction.
Entry short on the green vertical line and exit made on the red arrow pointing up when the histogram bar increased in value after the trade reached a 2:1 Reward Risk ratio.
As seen above. If a trade has a 5 pip stop loss for example, as soon as the trade is 10 pips in profit then the trade will be closed as soon as the first histogram bar against our trade direction happens.
If a trade reaches this point and the histogram bar is already against our direction then it can exit straight away at 2:1 rather than waiting
No entry:
Any trade taken before 07:00 and after 21:00. Please add in a time clause as I found the strategy to be most profitable opening trades after 0700 GMT 0 and not opening after 21:00 GMT 0
The EA cannot take a second entry on the same MACD move. If the EA takes one entry and get stopped out the EA cannot take another trade until the MACD line touches the 0 line again and “resets'' the play.
As seen below there are multiple trades that occurred on the same MACD divergence and all 3 lost. So if the MACD line has not touched zero between the last trade and tradewe’re taking now then we cannot enter until it does.
A trade with a 10 pip SL or larger won’t be entered (again please add the option to let me adjust this)