I've been working on an MT4 EA that compares many trend trading strategies (using many indicator combos). I'm looking for guidance on how best to improve my approach.
I wrote software for 15 years but haven't written code in the past 6 yrs. I got back into coding 3 months ago to write MT4 robots when I realized I could do it easily, even though I had no prior trading experience.
My Ultimate Goal:
To have a collection of EAs with winning indicator combinations that successfully trade trends with little to no human intervention.
Work done so far:
I've created a trend 'rider tester' that
- Allows you to mix and match about a dozen different trend detection methods (eg BBands + Stochastic, MAs, etc).
- Places an order when there is confirmation across all the selected methods,
- Uses dynamic lot sizing based on % risk (of balance or equity),
- Sets a trailing stop loss that kicks in once profit is locked in.
Success so far:
I ran an optimization on M30, for EURUSD, from Jan '16 - Dec '19, and found the Alligator+RSI has the most success (at least the way I coded it), when run against Dukascopy data from tickstory. You can see the backtest result in the image below, and I've attached a set file if you want to see it in action, or DEMO trade it (i.e. with a demo account ONLY). My settings here are super aggressive (50% of acct balance), and take the account from $10K to $1.2M in 4 years)
- What is a better way to set initial stop loss?
My initial stop loss is massive (3400 points), compared to my profit trigger (100 points). I would love to reduce this to further increase gains, but the optimizer shows this is the sweet spot. I have heard that using Average True Range can help, if you multiply it by a constant, but none seem to work well. (( You can try this in the 'experimental settings' ))
- How best can I place multiple orders when a trend is detected?
I tried some logic for 'duplicating winning orders' : when an order locks in a profit, clone the order, but with a smaller stop loss. This does not work well. (( You can also try this in the 'experimental settings' ))
- Whats a better exit strategy I could use?
You may notice that most orders get in and out pretty quickly, even though there is more trend to be ridden. I am thinking of leaving it this way, but I cant help but feel there is a way to exit later for higher profit, while maintaining high win rate. I have heard using heiken ashi might be good; just watching for color change. I may try this next.
- Any Other Feedback Welcome!
There are a lot of smart people out there... many on this forum Please feel free to spot out any issues / inefficiencies. I am new to this, so I am sure there are many little things I have overlooked that could make this better.
Thanks in advance!
Unfortunately I am not at liberty to share the source code here, but i hope this tester EA is a helpful contribution to the community