I started trading in late 2012 and joined FF in early 2013. I have a love of programming and have since coded and backtested countless trading ideas both from FF and of my own creation. Out of all of the EAs that I have coded I have learned that most do really well until they don't, meaning they were great for the market conditions at the time but once those conditions changed they blew up. Many others looked great on paper, but when faced with real spreads and slippage lost all chance of profitability.
I am in no way a pro trader, nor can I claim that I am a profitable trader, but nowadays I do not blow up accounts and I learn more about my psychology and trading all of the time. Here a few things that I have learned in my short journey.
- On paper my risk tolerance is a lot higher than it is in live trading. Although, in the long run, they may have turned out to be profitable, I have stopped a few systems early because I couldn't tolerate the losses.
- For me, demo trading does not compare to live trading. I am more affected by a 1% loss in a live account than I am by a 10% loss in a demo account. So, I only use a demo account to test the logic of my systems and use a very small live account for actual forward testing.
- As appealing as they are, it is much harder to make money on lower, fast moving timeframes. I consider the 1 hour and up a higher timeframe. Most systems I test are for the 1 hour, since I have not entirely lost my psychological need to have at least a few trades open per week.
- I will never be a manual trader. I do not have the patience or the discipline to sit on my hands for hours at a time. Within the first hour, I will start placing trades more out of boredom than anything else.
- I am addicted to checking my open trades. I find myself constantly checking trades that are opened by my systems.
- If the logic of your system is sound, do not override it by closing or adjusting trades. I have many times closed out automated trades early, and although at the time it seemed like the right thing to do, a majority of the time if I would have just left it alone it would have turned out for the better.
- Simpler systems work better. I have had the best results using very few indicators. A majority of the systems that I have been testing lately have involved Fractals, Ranges and Trendlines.
- I really need to break my dependency on MT4 and take the time to learn Python. I currently code and test all of my systems on MT4 although I send all of my trades, through files, to a Python script that places them on Oanda's FXTrade platform. This allows me to trade any size no matter how small. Eliminating the patchwork system I have in place and moving it all to Python would be ideal. Besides, you never know when Metaquotes will give up on MT4 altogether.
In real life I am a bartender, so "On the Rocks" just made sense. Besides, I didn't want to spend too much time coming up with some catchy name that no one really cares about.
About the EA
The EA that I am sharing is a range breakout system with the goal of catching a trend without predicting when it will stop while minimizing losses. Trades are opened based on the highest high or lowest low within a given number of bars. Stops and targets are hidden from the broker and managed by various user defined options. I have had the best results, so far, using an ATR based stop. In my testing the system has an average win rate (depending on settings) of between 30-40%, but the losses are much smaller than the wins.
The most important setting within the EA is the High / Low Extreme Period. This sets the range of bars that the EA uses to open trades. One setting will not work for all currency pairs. The EURUSD responds well to a 25 period while I have found that the GBPUSD responds better to a 36 period. Also keep in mind that a 25 period on the 1 hour chart is the same as a 100 period on the 15 minute chart since there are 4 bars every hour.
I am not a fan of traditional Martingale systems, but have found that in systems, such as this one, with very few consecutive losses, a slight increase in trade size on each loss up to a maximum amount of risk can oftentimes lower overall drawdowns and sometimes increase profits.
I have been live testing this system on a small account since Dec 15, 2017 and after 22 trades I am currently down 11%. About 7% of this is due to a few coding errors that I found, so in reality I should be down about 4%. Compared to my backtesting the system is performing exactly as it should so I am not concerned. I have been running it with 3% intial risk with a 0.7% risk increase on each loss up to a maximum of 5% risk. Since this system uses a trailing stop, the chance of incurring a 5% loss is rare. The max loss I have encountered is 4.38% while the average loss has been 2.25%. The max win has thus far been 17.7% with the average at 8.48%.
Below are a few backtests that I have performed with my set file for the EURUSD. I am using TickDataSuite with Dukascopy data with actual spreads and random slippage at 99.9% modelling quality. These tests were performed from 1/1/2010 to 2/1/2018.
Higher Risk Tests
Lower Risk Tests
Please do not trust my results!
Do your own testing and share any good set files you come up with!
Just because something looks good in backtests never assume that it will continue to be profitable in the future!
Description of EA Settings
- Trade Once Per Direction?
If set to true, the EA will only open one trade in the given direction. If the previous trade was a short the next trade will be a long.
- High / Low Extreme Period
Trades are opened when a bar is either the highest high or lowest low in a given period. This is where you define said period.
- Use NRTR ATR Trailing Stop?
Use the "NRTR_ATR_STOP" indicator as a trailing stop.
- Use BB Stops Trailing Stop?
Use the "BB stops (new format) 1.3" indicator as a trailing stop.
- Use Parabolic Trailing Stop?
Use the "Parabolic_Mod" indicator as a trailing stop.
- Use Three Bar Trailing Stop?
Use the lowest low or highest high of the three previous bars as a trailing stop.
- Exit on Hard Stop?
Exit trades on a set stop defined in pips.
- Exit on Hard Target?
Exit trades on a set target defined in pips.
- Exit on High / Low Extremes
Exit trades at the highest high or lowest low in a given period.
- Use Avg Hist Range for Target? Stop?
Exit trades on a percentage of the range of given number of past maximum trade ranges.
- Max Total Risk w/Martingale
The maximum allowed total risk when using martingale
- Use Martingale on Losses?
Adjust the risk on the next trade following a loss
- Increase Risk Size on Loss?
If set to true the next trade following a loss will have its risk increased by a given amount. The risk will be decreased when set to false.
- Use Martingale on Wins?
If set to true the next trade following a win will have its risk increased by a given amount.
Although I only use the NRTR ATR indicator in my live trading I have included a couple of other options within the settings so below are the indicators these would use. The Parabolic indicator below is the same one included with MT4 except that I modified it to show whether a dot is an upper or lower one.
I have spent a lot of time on this and at present am not willing to share my source code. I also have an expiration set within the code to prevent others from selling my work. I will update the expiration well before it expires. I have no intention of selling this and there are no restrictions on whether it can be used on demo or live accounts.
If you don't agree with any of this then please do not use it and simply move on.