www.for-exe.com
  • Home
  • eWavesHarmonics
  • INDICATORS
    • MT4 Indicators
    • MT4 Free Indicators & Scripts
    • eWaves v1.0 Manual
    • MT5 Indicators
  • Trade Tools
    • Advanced Trade Manager
    • Trade Copier
  • Trader Training
  • Harmonics
    • TheHarmonicIndi
    • TheHarmonicIndi Instructions
    • Harmonic Patterns
  • Trading Blog
  • Contact Us
  • Who is Snorm
  • Q&A
  • Trading Services
  • Useful Links
  • MT4 TIPS and TRICKS
  • Newsletter
  • MetaTrader Wingdings
  • Fibonacci Numbers
  • Privacy Policy
  • Terms of Use and Disclaimer

Trading Lessons from a Robot Coder

27/5/2024

0 Comments

 
Picture
It’s nearly a whole year since I started what became known as ‘The Project’: writing some auto-traders (robots / bots / EAs) that could be left to their own devices but allowing for some human intervention if required. Whilst I have written countless robots over the past decade or so, this is the first bot project that has consumed so much of my time with near-100% focus, often at the expense of my own trading. The key criterium, for the long-term results, is a simple one: the robot must achieve 10x more percentage profit than drawdown.  So, if it achieved 100% profit, the maximal drawdown must not exceed 10%.  For the most part, that has been relatively easy to achieve.

The bulk of my time goes into tweaking and constant back testing, across at least three different brokers. All this time spent on development and testing has taught me some valuable lessons, not only about how bad the MT4 back testing can be, but also some for my own trading and how different the brokers’ price feeds can be.

I thought some of you might get something from my lessons, hence the post – lessons learned in no order, just as they come to mind.

DO NOT TRUST BACK TESTING RESULTS
For some obscure reasons, the MetaTrader back testing is heavily biased to showing positive results. I have no idea why MetaQuotes made it so but it’s a total pain in the arse.  You can not back test trailing stops within a one-minute bar, for example, as the tick data isn’t there; even if it was there, it would be vastly different between brokers, so you have to make the stops very conservative – far from price -to avoid spikes that the back testing would otherwise not show as stopping your trade.  There is also the problem of variable spreads.  I’ve seen some wild random spreads (not news driven) on ICM and Pepperstone that back testing won’t pick up: you’d be stopped in live trading or have profits much reduced with the lot size calculation, whereas back testing will say all is hunky dory and the bot grabbed a great trade. The only way to properly test the bot is on a live account, for several months.  After each week of live testing, I like to back test that week to compare results, then code some workarounds so back and forward tests eventually align, as much as is possible; it will never be 100%. 

KEEP IT SIMPLE
My previous bot traded five different setups.  It achieved >1000% profit for around 20% DD, in less than a year – according to the back testing – but became a monster to tweak and maintain. The other problem was that the base variables for the whole program might not be the best for each setup. After many months in development, I’ve ended up spending many more weeks creating deconstructed bots: one for each setup.  This has allowed me to reduce the number of variables in each program and fine tune each setup.  Now I have individual bots tuned to achieve the long-term target 10:1 ratio, that collectively achieve a greater return than the all-in-one bot. That's just like normal trading: keep it simple and have specific rules for each setup that you trade.

THE PERFECT WAY TO PROVE THE EFFECTIVENESS OF YOUR OWN TRADING SETUPS
This has been the most beneficial experience, apart from the buzz of creating profitable bots.  It takes so much longer to visually back test setups but once coded into a bot, it takes no time at all to confirm if a setup is really any good for manual trading.   I have at least another ten setups to code and test – this will keep me busy until 2025. I’ve always said that any trading idea could be turned into a robot, if it’s any good: the information that a human trader uses is, after all, mostly just a load of binary inputs (on/off; true/false; it is or it isn’t).  Has X done Y; is A greater than B, does Q=R; etc. Traders should trade like robots and thus the trading rules could be coded as such.
 
KEEP TRADING THE SETUPS EVEN AFTER A COUPLE OF WEEKS OF DRAWDOWN
I’ve seen, from the back testing, that most of my bots go into draw down, for a couple of weeks here and there.  When looking at the daily bars, for those draw down periods, I find the average daily range has shrunk to way below normal, or price is stuck in a tight range – it’s no wonder that the bots struggle; I would have struggled to manually trade those periods.  It’s pointless expending too much effort into coding workarounds for those periods – time is far better spent on optimising for ‘normal’ periods and just accepting that there will be some weeks of DD.  Liquidity will invariably return but we never know when, so it’s just best to keep trading the setups, knowing that the tightly coiled spring will eventually go BOING! From working with countless traders, I’ve seen too many give up when they have periods of draw down; they go in search of better short-term trading ideas and leave behind the most valuable ideas that work in the longer term.  Trading (manual or automated) is a long-term game that you cannot judge after just a few weeks.
 
FIBONACCI RETRACEMENTS OF IMPULSIVE MOVES WORK
… but they work a lot better when you have plenty of confluence. Of all the bots that I’ve written, trading Fib Rs has been the most successful – achieving 1,114% profit with 15% DD, in less than a year.  I suspect there are a lot of Fib R bot traders out there, which helps to make the method more successful. I also suspect they will use different approaches to look for confluence – it doesn’t really matter what you use if it works. I use the information provided by the opening ranges but am looking to add a few other factors for added confluence. To benefit from the rewards of trading Fib Rs, you need to give price plenty of room to do its thing, such as in the last blog post – those occasional big moves will more than make up for extended periods of DD; just like with manual trading.

Which are the best retracement levels to trade? Good question … the Fib R bot trades 38, 50, 62 and 78% retraces.  Individually when just the one Fib R is traded, the results (from the same period that generated the 1114% profit) are: -
  • 38%:74% profit for 21% Maximal DD
  • 50%: 110% for 12%
  • 62%: 110% for 18% - I find that surprising, with 62% being the key ratio.
  • 78%: 134% for 13% - by far the best but only according to the way the bot trades

I’ll probably test others eventually but the above 4 are working perfectly well, if not all individually meeting my 10:1 goal. The compounded result, with ever growing lot sizes, is the key to big account growth with relatively low DD.
 
WAIT FOR UPSIDE/DOWNSIDE REJECTION TO SIGNAL THE CHANGE OF DIRECTION FROM KEY LEVELS
Japanese candlestick analysts will use individual, or a combination of, different types of bars – all with names that few traders will easily remember.  If you’ve done my trading course, you’ll know that I dislike candlestick names and just prefer to see what a price bar has done, or (more importantly) a combination of price bars.  When you combine several bars, you can identify upside and downside rejections (or call them pin bar combos if you must) that, when they occur at key levels, can be effectively used to confirm a trade. Success, without these rejection combos, is greatly reduced.

NOT ALL BROKERS ARE CREATED EQUAL
This has been the most surprising discovery.  A bot that trades the exact same setups with the exact same inputs should roughly generate the same results on all brokers – at least that’s what any normal trader would assume.  Alas, that’s not the case, since the liquidity providers generate their own prices.  I’ve seen a difference of more than 10 points on DOW between brokers and individual M1 bars can vary tremendously.  Just to give you an idea, back testing the Fib R bot just for April this year (a particularly successful month, mostly because of the massive move on the 4th)
  • Pepperstone: 93% for 12.7% DD
  • ICM: 68% profit for 12%
  • FTMO: 35% for 10.6%.
 
Why FTMO performs so badly, relative to Pepperstone, has yet to be determined but it’s quite an eye-opener and consistent with all the bots that I’ve tested. However, results can be vastly improved with some FTMO-specific optimisation, to get it much closer to Pepperstone results.
 
I could go on but that’s enough blah blah for this post.  I might do a follow up in the future, as more bots are created and tested – the simple ABC zigzag should generate some interesting stats and allow me to prove just how valuable the FE127 is.   In the meantime, … back to the project I go.

0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Subscribe to Newsletter
    Picture
    ​​Available on Amazon Kindle
    ​and Google Books

    Archives

    March 2025
    February 2025
    December 2024
    November 2024
    September 2024
    July 2024
    May 2024
    April 2024
    February 2024
    January 2024
    December 2023
    October 2023
    August 2023
    July 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    August 2021
    July 2021
    May 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    August 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013

    RSS Feed

@snormtrader.bsky.social
We no longer use Twitter / X - please follow us on BlueSky
Subscribe to Newsletter
  • Home
  • eWavesHarmonics
  • INDICATORS
    • MT4 Indicators
    • MT4 Free Indicators & Scripts
    • eWaves v1.0 Manual
    • MT5 Indicators
  • Trade Tools
    • Advanced Trade Manager
    • Trade Copier
  • Trader Training
  • Harmonics
    • TheHarmonicIndi
    • TheHarmonicIndi Instructions
    • Harmonic Patterns
  • Trading Blog
  • Contact Us
  • Who is Snorm
  • Q&A
  • Trading Services
  • Useful Links
  • MT4 TIPS and TRICKS
  • Newsletter
  • MetaTrader Wingdings
  • Fibonacci Numbers
  • Privacy Policy
  • Terms of Use and Disclaimer