Experimenting with making my own EA -- need advice troubleshooting!

Hi!

So I’m quite new to Forex trading in general but have some experience from trading cryptos in the past, and have a bit of experience coding – thought it’d be fun to play around with MQL4 and try coding my own EA and see what kind of back-testing results I can achieve. Mainly as a way to keep my “coding skills” honed and also to learn more about Forex trading – possibly with the intention to try my luck at live trading someday.

Using some ideas I’ve gathered from a few sources (plus some ideas of my own and a lot of tweaking) I’ve put together a working EA based on 1m chart / scalping strategies. When I say “working” all I mean is it runs around 4000-5000 trades in about 1 years worth of back testing – though not at all profitable at this point.

The issue I’m coming up against is that while I’m getting a very high percentage of profitable trades (80%+), the few non-profitable trades I’m getting are very big losses by comparison to the profit trades.

For example looking at my latest back-test report, the average profit made per trade is 6.88, while the average loss per trade is -39.73, many of the loss trades are between -200 to -300. Now the weird thing is, and that’s what I need help with, I’ve got stop losses in place which are supposed to keep it from going anywhere near those amounts in losses… I’ve tried a few different methods of SL, including trailing SL, static SL, and have even tried adding in a OrderClose based on a fixed negative profit amount per trade – just to see what it does… in which case it brings down the loss trade amounts somewhat (though not to what I’m specifying in code) but increases the total loss trades and reduces the profit trades enough that there’s no difference in the final P/L outcome.

Without having to show my full code – does this sound like something any of you have come across in your own experiences before? I’m sure there is a logical explanation but I can’t for the life of me figure it out… I just want to be certain it’s not some simple thing that can be remedied before I go completely changing the code as I would have figured having 80% profitable trades could be promising if only the stop loss was working like I hoped it would.

Any thoughts/ideas would be much appreciated!

strategies with a negative RRR just do that, which means that the potential loss is several times greater than profit.Such strategies have high profitability, but if you hit stop loss, this is what it looks like. What quality of modeling did you get? N/A

Heres a few questions you may want to ask yourself to tweak your strategy…

  1. What % are winner
  2. What % are losers
  3. Of the % winners how far does price go against you before it goes on to hit TP
  4. What is the drawdown
  5. Of the losers how far does price go towards TP before hitting SL
  6. Where are you putting the SL
  7. What is the risk to reward?
  8. Of the winners how far does price go after hitting TP
  9. What % are you risking per trade
  10. What is your monthly % return
  11. What pair have you tested it on
  12. How does it perform on other pairs
  13. What timeframe are you trading on
  14. Does it perform better kn different timeframe
  15. What if you use daily ATR as a stop loss
  16. What is the minimum pips the losers move towards the TP
  17. What if you move SL to breakeven asap
  18. And heres the kicker: what if you reverse your code. So instead of buying where you’ve set it, you sell. And vice versa

This should get you to where you need to get. Take your time, go through them patiently, backtest. Best of luck. Keep us updated.

1 Like