Trying (and failing) to create a simple EA...appealing to all FXDreema gurus!
-
@line Thanks!!!! That's exactly what I was looking for. Although it done run more profitably for me with the x> condition. What mods did you make (if you don't mind me asking) that produced that test report you did have up here, and what time period did you you backtest over?
Thanks again!
-
I removed the test report which was run on open prices which is not a good way to test, I then ran on tick and it produced 1.37pf with 200 pips ( I think) in 4-6 months on e/u. I changed the profit/loss and actually inverted the buy to a sell. I will have to run later since I am going to bed atm. I also used a marti but only at 1.5 with a limit of max lot size at .50 (starting lot size is .10, I think you had .20 at starting lot size).
As a side note, I run at .10 since it is easier to convert to actual pips (.10 = 1 pip).
-
@line Thanks for that! I also inverted conditions from buy to sell (with the exception of switching the EMA component for market entry condition from 20 to 5). Trailing stop loss 15 Pips on Open with 15 Pip Step (just the same as for the Buy EA). Ran the EA on EUR/GBP and it produces some expected closes, but also some really weird ones:
Incorrect S/L Mod and stopped out (should have been a profitable trade):

Open S/L hit no reason (should have been a break-even):

2 S/L stopped trades for no reason:

Any idea why this could be happening? Is it just inaccurate testing by MT4?
Thanks again for all your input.
-
Can you please share your last version?
-
-
-
Try this, I ran this on 1H tick Eur/Usd from 4/18/18 to 6/4/18 . Keep in mind I did not spend a lot of time going through all of this.

-
@line Thanks, but that is not what I am looking for . On my buy conditions you have programmed to sell! I have the BUY element of my strategy done and it works profitably on certain currency pairs, 15 minute charts, during London/Euro market hours.
What I want now is to do with the same for short trades. I want the a SELL to execute on the following conditions:
- Previous candle close is a bear candle
- Previous candle close below EMA5
- Previous candle close: MACD Main is below 0.00 line
- Previous candle close: MACD Main is below MACD Signal line
Upon all the above, Sell trade open with 15 pip stop loss, trailing so that for every 15 pips price goes down during trade, stop loss moves down by 15 pips.
I cannot understand why the EA I shared with Andorra does not properly fulfil this strategy and stops out trades (as per screenshots).
-
@sirboyce Oh great! Now when I backtested my BUY EA on GBP/USD it delivers a loss...testing on exactly the same currency pair, over the exact same period, timeframe etc. etc. etc. as I did yesterday when it delivered a really nice profit. WTF!!!!
How can you possibly reliably test these EA's????????
This project https://fxdreema.com/shared/iP90As69e (incorporating both buys and sells conditions) worked great on EUR/USD and delivered profit...right up to the last but one trade when the stop loss on the buy did not trail up again for a 15 pip win (and ended up break-even):

Also noticed this occasion where should have been a profitable buy but no trade:

Running exactly the same EA on GBP/USD...and the whole test f**ks up because a sell open has no stop loss at all so the test runs on thinking that the trade is open all the way to the end (and of course no further sell trade is executed):

Losing the will to live here!
-
Honestly, I see no apparent reason for your EA not no work correctly. Maybe you couls share the whole project and then check other conditions not included in your partial one may be hundering the whole program. Otherwise, what is the quality of your tick data?
-
@sirboyce Spread looks very high. Maybe that's the reason why some trades close late?!?
-
@trader-philipps I think that's the least of the problems with this testing

-
@sirboyce But it would explain different results if you choose current spread for testing
-
@trader-philipps OK, so what would you recommend changing the spread to on all tests? I am more concerned about incorrect stops, lack of any stop loss being applied upon trade open, trades not being opened on the conditions I have built into the EA etc.
-
@sirboyce Well, for MT4 EAs I use TDS2 for testing. There you can specify variable spreads, but they keep consistent if you configure it like that. So you can run your EA on exactly same conditions several times.
But I don't want to advertise here. There are probably other apps around that do a similar or better job.However, the trade without SL, was that a sell trade? If so, than you should rethink the trailing logic. If spread is 4 pips, you have to make those 4 pips first in order to kick in trailing (as you specified open price). And on the other trades, there you have 5 pips spread which is 1/3 of your trailing step target. I think it's good to test with that high spread as you can see the flaws in the logic (not by fxdreema or MT4) better.
-
In case you have not, run on tick, set spread to something besides "current". If this does not work then you try to isolate. Probably the best to isolate is to run separate eas, one for buys and the other for sells. It does not look like there is errors but could be a bug issue.
If the separation does not work, then I take apart the conditions by detach then running each condition by itself.
-
@line I tried all of the above. The problem appears to be pretty much all to do with the Sell trailing stop loss aspect of the EA not firing as I should for no reason I can work out
-
@trader-philipps Thanks. I set the test to a 5 spread, and the GBP/USD test still messes up because of the SELL trade not having a S/L (that is one without the SL you mentioned).
Looking at my EA project, and based upon a spread of 4-5 pips, could you suggest how to calibrate the stop loss parameters to compensate?
-
@sirboyce FYI, these are the test reports over period 2nd - 28th September 2019 (spread set to 5, 0.2 lot size)
EUR/USD

EUR/GBP

USD/CHF

Appreciate your comments.
-
Hi. I'm just dropping here without knowing all the details of the project, but in general I have found out that backtests with some 50 trades contain zero information on actual profitability. You should test longer periods to get more reliable results. My rule of thumb is at least 200 trades per test.
In my opinion, mt5 has a far better environment for developing and backtesting, but unfortunately that is too big a transition for most people..