Basic Strategy Development Concepts

This series of strategy development articles serves to illustrate the development process used for my algorithmic (or automated) trading strategies.

There are two main development workflows, depending on your choice of software. The first uses Metatrader 4’s strategy tester module, where we build a strategy from the ground up by incrementally adding entries, exits and finally filters.

The second workflow uses StrategyQuant, where we first run a genetic algorithm to automatically generate a basket of profitable strategies, which will then be subjected to several rounds of selection and robustness testing.

After developing a number of strategies, our focus then shifts to portfolio composition and monitoring techniques for live trading.

Through these articles, I hope to convince you that algorithmic trading is well within the means of the average retail trader. Feel free to use this development process as a reference or starting point; you should customize it to suit your particular trading style or market.

As a primer for the development process, this article will provide a brief overview of some strategy development concepts. Let’s dive right in!

What Is an Algorithm?

An algorithm is a computer program that converts an input to an output using a quantitative set of rules. In the case of trading, the input would be the market prices from your broker, while the output would be a certain trading action. Trading rules usually take the form of IF/THEN statements. For example, IF the price exceeds the 20-day moving average, THEN enter the market.

Your challenge as an algorithmic trader is to determine a profitable set of rules. Evaluating your profitability requires backtesting the algorithm using historical price data.

Strategy Robustness

Robustness is a central theme in systematic trading. Simply put, robustness is the ability for a trading strategy to perform well over many markets. Because markets are always changing, I consider robustness to be the single most important quality in a strategy.

The chart below shows a trend strategy that was backtested on 5 forex majors over 17 years. All markets are profitable, which indicates strategy robustness. Unfortunately, this is the exception, rather than the norm.

On the flip side, it is quite common to produce a strategy that works great on one market, but fails on others. There usually has to be a trade-off between robustness and spectacular single-market performance.

Robustness is typically achieved by having a simple set of trading rules. As the saying goes, loose pants fit all.

Most authors in the trading literature seem to agree that a robust strategy should contain no more than four trading rules. Adding too many rules will constrain your algorithm to very specific market conditions. Your backtest will undoubtedly look great, but your live trading performance will suffer once the market deviates from your backtest conditions.

Optimization and Parameter Stability

Once you have determined your trading rules, you will need to decide whether you wish to optimize its parameters.

Using the algorithm example above (Buy if price exceeds 20-day moving average), the lookback period of the moving average may be optimized. A 50-day moving average may perform better than a 20-day moving average, especially if your market is often choppy.

If you plot your strategy performance as a function of your lookback period, you will likely get an optimization chart that resembles the hypothetical one below.

When selecting your parameter value, look for high plateaus on the graph. The parameter should be in a stable region, such that minor changes in parameter value will not drastically affect strategy performance.

In the chart above, a lookback period of 73 would be a more prudent option than 54. Although trading performance appears to be weaker, the strategy will be far more resilient to changing market conditions. 

Strategies With Multiple Optimizable Parameters

What if your strategy contains more than one optimizable parameter?

For example, in addition to the ‘Buy if price exceeds 20-day moving average’ condition, suppose you wish to restrict your market entry to certain hours of the day. You may be wondering whether you should optimize your trading hours as well.

If you compare your optimization charts obtained before and after optimization of the second parameter, you may get either of the two graphs shown below.

The graph on the left shows that optimization of the second parameter has increased performance over a broad range of values, and is thus a robust improvement. On the other hand, the graph on the right shows an increase in peak performance at the expense of robustness.

For the second scenario, it is best to assign a constant value to the additional parameter, or omit the parameter entirely.

Simultaneous Parameter Optimizations

If you do decide to have several optimizable parameters, try not to optimize more than one parameter simultaneously. Apart from a serious increase in computation time, simultaneous optimization increases the risk of overfitting your trading rules to historical data, reducing your strategy’s robustness.

You may miss out on a particular combination of parameters that results in peak performance, but the improvement in robustness will be worth it.

For a more in-depth look at robustness in trading strategy development, I recommend the excellent book ‘Trading Systems: A new approach to system development and portfolio optimization’ by Emilio Tomasini and Urban Jaekle.

Backtest Precision

As a trading strategy developer, you will be running tons of backtests. Regardless of software, you will have to balance the conflicting requirements of test precision and computation speed.

Due to the countless variations of trading strategies that exist, I recommend a less precise backtest during the early stages of development. A high precision backtest will only be done on strategies that have passed all the selection criteria specified during development.

For example, during the Strategy Development portion of this roadmap (Parts 3a & 3b), backtests will be done using OHLC prices only. Promising strategies will be subsequently retested using tick data, under the Strategy Verification portion. 

The vast majority of strategies I have developed tend to perform equally well or slightly worse (up to 10% poorer performance) when tested using tick data.

There is a small possibility that you will miss a great strategy by backtesting with lower precision in the early stages, but the overall time savings will more than compensate for it. After all, trading is a practical money-making endeavour, not an academic exercise. 

Wrapping Up

Hopefully these basic strategy development concepts will help kickstart your algorithmic trading journey.

Personally, these are the core concepts that I adhere to during development. Of course, the list above is by no means exhaustive. As you acquire knowledge and experience, your list of core concepts will grow accordingly.

In the next section, we’ll talk about trading preferences and goals.

Strategy Development Roadmap

Supercharge your strategy development with StrategyQuant

Access 14-day FREE trial here!

Get up to USD 300 discount!

Strategies need improvement?

Use QuantAnalyzer’s powerful analysis tools

Try the FREE version here!

Get 20% Discount here!

FXVM Forex VPS
Follow Us

Recent Posts

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

read more

What Is the Kaufman Adaptive Moving Average?

The Kaufman Adaptive Moving Average is a unique indicator that automatically adapts to the market’s noise. Here I explain its inner workings and show you how to build a trend following strategy around it.

read more

What is Fixed Ratio Money Management?

Have you heard of fixed ratio money management? How does it compare to the popular fixed fractional approach? Here I’ll explain how fixed ratio works, and see how it stacks up against fixed fractional money management.

read more

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

read more

What Is the QQE Indicator?

The QQE is a mysterious indicator that sometimes pops up in trading forums. Does it deserve a place alongside the more traditional momentum indicators like the RSI and CCI? Let’s add it to a trend following strategy to find out!

read more

Hey there, Wayne here! I’m on a mission to develop robust algorithmic trading strategies for the forex markets. Trading Tact is where I share my trading methods and insights.

Follow Us
Have a Question?

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Supercharge your strategy development with StrategyQuant

Access 14-day FREE trial here!

Get up to USD 300 discount!

Strategies need improvement?

Use QuantAnalyzer’s powerful analysis tools

Try the FREE version here!

Get 20% Discount here!

FXVM Forex VPS

Recent Posts

Should You Use the Kelly Criterion for Forex Trading?

Should You Use the Kelly Criterion for Forex Trading?

The Kelly criterion is a famous mathematical formula that attempts to maximize your long-term capital growth. In this post, I’ll apply it to a EURUSD breakout strategy and explain some of its potential shortcomings when applied to forex trading.

read more

Hey there, Wayne here! I’m on a mission to develop robust algorithmic trading strategies for the forex markets. Trading Tact is where I share my trading methods and insights.

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Pin It on Pinterest

Share This