Trading Software
    Menu Close

    Forex Trading Optimisation Guidelines

    This guideline was written for our customers who use automated systems on the cTrader trading platform. We recommend that the trader has a good solid understanding of trading the markets before they start using an automated trading system, there is no such thing as a robot that you can start, and it will make you money without any human interaction.


    When it comes to optimising a cTrader cBot or an automated trading system you will hear about market cycles and recommendations to optimise as far back as possible with historical data. What you are doing when you optimise a mechanical trading system is fitting the parameter data to the market cycle from the start and end dates of the optimisation run and as the markets change in both short and long-term cycles it is best to catch these cycles and trends with the best settings for your trading system.


    cTrader Optimisation Guideline


    What is an Automated Trading System?

    If you are reading this page, you should already have a good understanding of what is an automated trading system as you need this knowledge before you start looking at optimising the robot's parameters, if you need some help, just read below.


    What is a Strategy Optimisation?

    Strategy optimization from the viewpoint of finding the best collection of entry and exit signals for a backtesting period and this is what we do with the cTraders Optimisation feature to find the optimal settings over a given period of time.

    Real Optimization is performed by taking a fair amount of recent data like 3-months and running the optimization and when the optimisation run is complete, you pick the best set of parameters, after this you test against the portion of data you removed in the beginning and if the system holds up and performs as well then you will have a higher probability of success with new fresh market data.


    Possible Scenario

    One possible scenario of real strategy optimisation and one we recommend is to pick a date range in history for the optimisation run going back 4-months and ending 1-month before today's date, so that you will only be optimising the settings for 3-months leaving the last month un-optimised. Once you have the settings, you then run a backtest for the last month that was not optimised, this is fresh data and not curve or data-fitted in any way, if the results are good then you have a winner.


    What is Curve Fitting?

    As the name suggests Curve Fitting is the process of fitting models to data and analysing the accuracy of the fit, in other words when used with an automated trading system it finds the best settings over the given date range to provide the best possible return of profits with the lowest drawdown.

    Please more that Curve For Data fitting is just a type of optimization, when you hear people say the system is too curve fitted, this does not apply to the general optimisation of your trading system.

    Curve fitting is a type of optimisation that finds an optimal set of parameters for your trading system that best fits a given date range in the historical data. A good advantage of optimising your robot parameters with an automated system is the ability to evaluate their historical performance by backtesting them on historical price data.

    Optimization and curve-fitting are two terms that are commonly used by traders, they are in fact so common now that many traders confuse the terms when they actually have very different meanings.


    Why Should We Optimise?

    If you were to purchase or build your own automated trading system and run it with no backtest then you have no idea if it would blow your account in a matter of days due to some internal bug or bad strategy design, although it could still happen with unpredictable markets events even with a good backtest result, it increases another probability of success.

    One of the main benefits of backtesting your system is to give your strategy an extra boost of confidence, but do not expect the same or even similar results with running on live fresh data as you cannot predict the future.


    Curve Fitting Examples

    Imagine a trading system that suffers a big loss on 2 out of 3 Friday afternoons after 3.00 pm since live trading began and an obvious choice would be not to take any trades on the Friday afternoon after 3.00 pm. If you adjusted your trading hours settings or added this feature to your trading system you will avoid opening trades after this time which should improve the backtest results as the losing trades that we're opening on a Friday afternoon no longer happen – this is a curve fitting.

    Another example is the settings for an indicator, how do you know the right settings for each symbol you wish to trade, for this type of curve fitting I would use a large sample of data and run the optimisation feature, do not optimise any other parameters, just a few key settings for the indicator.

    All that the cTrader optimisation feature does is find these ideal curve fitting parameters for you, but you should not try and fit all the parameters at once, only choose the ones that will have a more solid impact with a live run.

    To prevent curve fitting try testing on sample data by manually adjusting the most obvious logic basic settings like a 5-day moving average for the week, anybody who uses an automated trading system will need to have trading experience and fully understand the features of the system.

    Using many optimised parameters will give you more degrees of freedom which means that more things could go wrong.


    Curve Fitting Pitfalls


    What is Overfitting – Pitfalls?

    One of the major problems with data or curve fitting in an automated trading system is that the parameters are based on past data which does not mean it will work on future data, but if you follow some of the simple rules in the curve fitting examples above you can improve the probability of successful winning trades with a lower drawdown then if you did not optimise certain settings.

    The fitting of parameters onto the past curve of data could cause problems with the future data curve that can cause the system to be out of phase.


    How Far Back Should We Go?

    How far back should we go when optimising and back-testing 1-year, 15-years?

    We all know that we trade in the present and not the past and what only really matters is your brokers most recent data, some say we only need to go back on sample data of 50-100 trades and keep recalibrating, some say we need to go back as far as possible to get as much data as possible. Our view is that the data going too far back is pure junk as these patterns in the market will never happen again as there could be billions of patterns that will never happen again.

    when you optimize a system using stale, historical data patterns then you cripple its performance when it encounters current data patterns. There is no single set of parameters that work great for all possible data patterns. We still believe in only optimising on recent sample data and recalibrating often.

    Many algorithmic traders say that the data before 2010 shows us that the market was very different and no relationship to the present-day market and that Data since 2019 is good enough and works find between tests with Demo trading and on a live trading account.

    3-Month Rule

    One possible method of optimising is to only go back 3-months, this is a good sample of data to use for the current market pattern (cycle), then you can recalibrate every week on a Sunday, I would first run a backtest from the date of the last calibration to the current date and see if the results are still good if they are you do not need to recalibrate.

    A major benefit of this is that it does not take very long to do and can be done in a few hours.


    • Recalibration of the stop loss and take profit part of the system is necessary on a regular weekly basis.
    • Do a quantitative analysis of the data, an example is where the max & min positions of the signal and what are the best hours to execute the signals.

    Using Different Symbols

    Not all symbols will have the same optimised settings, if you run the cTrader optimisation feature for the EURUSD Forex pair, do not expect the same backtest results for any other Forex pair, the curve fitting has been tailored for the market behaviour for EURUSD over the start and end-market date range.


    Which Settings Should be Optimised

    As explained in the section Curve Fitting Examples, you should not try and optimise all the trading system’s settings in one go, you need to first start with the most obvious ones like trading hours or indicator settings and when you run the optimisation start with a single block of settings.


    When to Recalibrate the Settings

    Recalibration means when you re-optimise your settings.

    Not all automated trading strategies require recalibration as it depends on the algorithm, strategies that rely on timing or thresholds are more likely to be sensitive to different settings and data patterns and will require more frequent recalibration.

    Most technical trading systems will require some or all parameter recalibration, it all depends on the type of strategy, if you have purchased such a system then the type of calibration will be provided.

    Regular calibration of your particular (not all) settings of your trading system will provide a higher probability that your system will have the highest chance of success with fresh unfitted data.


    Our Recommendation for Optimising cTrader cBots

    Most of the more complex automated trading systems that we offer for the cTrader trading platform will require some form of curve fitting, here are a few of our best-selling products.


    Smart-Grid Trading System

    Our smart-grid trading system does benefit from curve fitting the parameter settings, but not all of them due to the fact it is quite complex, the following settings we recommend that you use with the cTrader Optimisation Feature.


    Neptune Trading System

    This type of trading system is more black-box and requires regular optimisation of the settings, it needs curve fitting, but as we recommend above in section How far should we go, only optimise 3-months and run weekly recalibration. You can of course experiment with dates going further back from 1-15 years or as far back as the broker will go and compare the live results.


    Switchback Trading System

    This type of trading system does not benefit curve fitting many parameters, instead, the trader needs a good understanding of the financial markets and each feature of this trading system, instead, it is better to manually adjust the settings with values taken from past analysis or known values like weekly moving averages,


    ClickAlgo Recommend


    Walk Forward Testing on Demo Account

    We recommend that when using an automated trading system for the first time that it is run on a demo account for around 3-months, this gives the trader plenty of time to get used to optimising and recalibration the system on a regular basis and to understand exactly how it behaves in different market conditions. Remember, this is a business and not a quick get-rich scheme, so take your time and look for the long game. 


    When to Start Trading on a Live Account

    If after 3-months you are happy with the results, understand the trading systems quirks and are able to calibrate the settings when required, only then should you start trading live with it and when you do start with the lowest position or trade size that is possible with your broker, you can always scale up the trade size when you are more confident of the results.

    There are no such things as an automated trading system that will perform well under all market conditions and any timeframes, your automated systems will need analysis and adjustments and sometimes the market cycle will just not work for your strategy, this is the time to turn it off.


    Useful Links



    We would love to hear your feedback on this article, and if you notice any inaccuracies please contact us below so we may update the page.