Algorithmic and Mechanical Forex Strategies | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • Testimonials
  • Contact

Four Hazards That Can Frustrate Quantitative Forex Traders

February 28, 2014 by Andrew Selby Leave a Comment

Many traders shift to the quantitative side of the aisle in an attempt to get away from the emotional frustrations that discretionary traders are forced to deal with. However, quantitative Forex traders quickly learn that there are a plenty of frustrations with quantitative approaches as well.

While quantitative traders might not stress over whether or not they entered a position correctly, they are more likely to wonder whether their entire strategy is still viable. Instead of doubting their current positions, they spend their time doubting their backtesting results.

quantitative forex

There are a number of hazards that can frustrate quantitative forex traders, at the root of most of them is a failure to follow the rules of a trading strategy.

There was a recent post on Forex Crunch that looked at four hazards that Forex traders are faced with. While the article was interesting, I thought it would be more interesting to take a look at those same four hazards from a quantitative perspective.

News Events

News events are made out to be a very big deal on many different financial news channels. Many discretionary traders focus their entire strategies around things like crop yields or economic reports. Much of this is done with good reason, as those reports can affect prices.

As quantitative traders, our job is to follow the rules of our strategy, regardless of what the rest of the world is saying or doing. There is a tremendous danger to a quantitative trader’s mindset if he allows himself to be influenced by news events, even if those news events pertain to the markets he is trading.

Currency Interventions

Currency interventions are actually very similar to news events for quantitative traders. Both are unpredictable, and neither should impact your decision making process.

In the event of a government currency intervention, the most successful traders are the ones who are able to keep a level head and stick to their trading strategy. The traders who alter their strategies based on external events are usually the ones that blow up their accounts.

Trading Psychology

One of the trickiest hazards for any trader to deal with is their own psychology. One of the most complicated things about trader psychology is that it can be very hard to identify before it becomes a problem. After it is clear that psychology is an issue, it is probably already too late.

For quantitative traders, psychology issues generally stem from failure to stick to the rules of their strategy. If your system calls for you to wait for a bar to close before cutting a loss, it might be difficult to wait for that bar to close if it is already showing a massive loss. On the flip side, you might also talk yourself into ignoring a stop if your psychology gets in the way of a trade.

System Faults

Another hazard that can frustrate quantitative Forex traders are faults that exist within the systems that we trade. This could stem from any number of biases that invalidate our backtesting results. It could also stem from a bug in our programming.

In order to cautiously avoid any system faults, we must be constantly on the lookout for them. Even the slightest error could seriously jeopardize your profits.

Filed Under: Trading strategy ideas Tagged With: forex traders, hazards, psychology, system flaws

Using the NFL to Illustrate Sample Size Concerns

February 27, 2014 by Andrew Selby Leave a Comment

In my free time, I have been working on developing a quantitative strategy for betting on Major League Baseball games. This has been a very interesting side project, but at the moment it has not been very successful.

The primary reason that I chose to focus on baseball games instead of football or basketball games is that baseball teams play many more games than any other sport. Over time, this should provide a larger sample size, giving me more significant results and eliminating the variance caused by small sample sizes.

sample size

The NFL provides us with an excellent example of what to avoid in terms of the statistical significance of a small sample size.

There was a post on Gestaltu on Monday that looked at the topic of sample size in a similar manner. The author used the natural mean reversion that occurs in the NFL every season as an example to explain the impact that a small sample size can have on performance. The article also addressed the danger that small sample sizes can introduce into our assessments of fund managers and backtesting results.

The Number of Games Played Matters

The regular season in the NFL consists of 16 games played over 17 weeks. In comparison, the NBA and NHL each play 82 games in a season, and MLB teams play 162 games. Multiply those totals by the number of teams in each league and you will see that there are dramatically less NFL games than any other sport each year.

The trading comparison here is obvious. It would be difficult for us to seriously consider a strategy based on 16 trades. The strategy that makes 162 trades each year has a much better chance of avoiding unlucky trades, or at least recovering from them.

Average Teams Making the Playoffs

The article also stresses the point that every year in the NFL there are teams with average talent levels that sneak into the playoffs. Because of the small sample size, these average teams can reap tremendous rewards from a few lucky breaks during the season.

In similar fashion, many fund managers profit from similar lucky breaks in their performance history. The article shows that even track records dating back 10 years can lack samples sizes large enough to be statistically significant.

Just as average football teams can sneak into the playoffs and marginal fund managers can post impressive returns, average trading strategies can produce outstanding returns when backtested in their ideal environments.

Rather than focusing exclusively on backtesting results, we should also be looking at the underlying process of a strategy. We want our strategies to limit the number of input parameters and be able to stand up to thorough statistical analysis. You don’t want to get caught with all of your capital riding on the 2012 Baltimore Ravens during the 2013 season.

Filed Under: Test your concepts historically Tagged With: nfl, sample size, statistical significance

How To Know When Your System Fails

February 26, 2014 by Andrew Selby Leave a Comment

One of the most frustrating aspects of quantitative trading is that most of the strategies we develop will end up failing. Experiencing system failure can be very difficult for a trader to handle on many levels. There will be a tough emotional and psychological impact to deal with, and there will also be financial losses to address.

Because system failure can be such a devastating event, we need to be prepared to recognize it as early as possible and have a plan to deal with it. System failure could be defined by drawdowns that are too large, drawdowns that are too long, or a general failure to create profits. Whatever definition you prefer, it is important to consider failure in quantitative terms, leaving subjective opinions out of the decision. 

system failure

Dealing with system failure can be extremely difficult. The key is to avoid making it a subjective evaluation by pre-defining failure criteria.

Daniel Fernandez from Mechanical Forex wrote a post this week on how to define and quantify system failure. In that post, Daniel discusses having a specific definition for failure that accounts for sample size, relative performance, and performance relative to historic testing results. His point is that traders need to have a quantitative limit at which they will give up on a system.

Avoiding Subjective Assessments

Daniel makes a great point about traders who have an emotional attachment to their strategies ignoring statistical evidence that the system is failing:

When the attachment – due to economical, psychological reasons, etc – is too great, a trader will always have problems with saying that a system failed, because the burden of failure might be greater than the burden of financial loss if the system continues to trade.

When we spend a large amount of time developing our system, we can naturally become attached to them. Just like parents dealing with disciplining their young children, we will have to separate our desire for these systems to succeed from our ability to realistically interpret what is actually happening.

Failure is Relative

Whether you choose to compare your system to a benchmark, historical backtesting, or a monte carlo simulation, you should have a pre-defined limit for how far the system will be allowed to deviate from its expected results. This will help to eliminate any subjective opinions about how well a system is performing.

Sample Size Matters

It is also important to have a pre-defined limit for the sample size that you will consider statistically significant. Comparing a 5 trade sample to a 5000 trade backtest is obviously quite flawed, but you have to set a number of trades that you will consider to be a good representation of your strategy.

As the number of trades increases or decreases, so does the significance of the depth or length of a drawdown. It is your responsibility to define the point at which the number of trades crosses the threshold of significance.

Filed Under: Trading strategy ideas Tagged With: backtesting, live trading, system failure

3 Basic Applications of Moving Averages

February 25, 2014 by Andrew Selby Leave a Comment

As quantitative traders, we design our strategies to make trading decisions based on certain signals. These signals can be as simple, or as complex as we desire.

One of the most basic types of signals that a quantitative strategy will implement is a moving average. While these signals are simple to understand and widely utilized, it is surprising how effective they can be.

moving averages

Whether you use them as trade signals, trend filters, or as parts of other indicators, moving averages are an essential part of quantitative trading.

A recent post on Forex Crunch discussed three ways to use moving averages to generate trade signals. While none of these methods is new to us, the post provided a good reminder that there are multiple ways to implement a moving average in our trading strategies. Each method has a different goal, but they can all contribute to a profitable trading system.

Crossover Entry/Exit Signals

This is the most common way that moving averages are utilized. We have covered plenty of strategies that use moving average to determine when to enter or exit a trade. This is the basis for many trend following strategies.

The basic concept is that when a faster moving average crosses above a slower moving average, an uptrend has begun and the strategy should take a long positions. Then, when the faster moving average crosses back below the slower moving average, the uptrend has ended and the strategy should exit its position and possibly establish a short position.

One evolution of this strategy is to include a third moving average somewhere between the fast and slow moving averages. This middle moving average will allow your strategy to exit quicker, hopefully preventing giving back profits.

Trend Filters

Another popular application of moving averages is to use a long term moving average as a trend filter for a strategy that uses some other criteria for entries and exits. This can be seen quite often in the mean reversion strategies developed by Larry Connors and Cesar Alvarez.

One simple example of this would be a mean reversion system that only wants to trade short-term dips in the midst of a long-term uptrend. The strategy could use a 200-day moving average to determine the overall trend. Then, if the overall trend is up, it might use a different indicator, like RSI, to identify short-term oversold conditions.

Smoothing Other Indicators

Moving averages are also used in many different indicators in order to smooth out the data signals. Averaging the signals that an indicator produces enables a trader to eliminate some of the noise to get a clearer picture of what is actually happening in a market.

Two great examples of other indicators that utilize moving averages are the Stochastic Oscillator and the MACD Indicator. The Stochastic Oscillator uses the %K line, which is simply a moving average of the %D line, as an entry/exit signal. The MACD Indicator is actually based completely on moving averages.

 

Filed Under: Trading strategy ideas Tagged With: MACD, moving averages, Stochastic, trend filter

Can We Increase Returns by Trading Less Frequently?

February 24, 2014 by Andrew Selby Leave a Comment

“It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience.” – Albert Einstein

That quote from Einstein was the inspiration behind a recent post on Gestaltu that looked at ways to further simplify an already simple rotational strategy. The post took Mebane Faber’s extremely popular Ivy Portfolio and tested whether a similar strategy could produced comparable results by rebalancing the portfolio only once per year instead of every month.

ivy portfolio

Is it possible to improve a monthly rebalancing strategy by only trading it once per year?

It is no secret that I am a big fan of Faber’s Ivy Portfolio. I believe that it represents an excellent base on which to build a multi-strategy approach to trading. The results show that it is one of the best all-around long-term strategies out there, and at the same time is extremely simple to follow.

For the testing of this theory, the author started with the version of the Ivy Portfolio which trades 5 asset classes based on their 10-month moving averages. The portfolio is either long or in cash for each of the asset classes based on whether they are above or below their moving averages at the time of rebalancing.

The Backtesting Results

There were an overwhelming amount of numbers provided based on a wide range of possible rebalancing dates. At the end of the day, in almost every case, monthly rebalancing outperformed annual rebalancing.

The authors went as far as testing annual rebalancing on each individual day of the trading calendar. While some days were able to outperform monthly rebalancing, that performance was attributed to luck, rather than a repeatable edge.

The post also experimented with using a 12-month moving average instead of a 10-month moving average. In that case, the returns were almost identical.

Could We Go The Other Direction?

The article concludes with a discussion on the relationship between rebalancing frequency and trading costs. Clearly, rebalancing annually instead of monthly would save a great deal in transaction costs, but the performance isn’t worthwhile. On the other hand, rebalancing daily incurs so many transaction costs that the strategy loses any potential edge.

One area that the article didn’t touch on was weekly rebalancing. This would represent more work and higher transaction costs than rebalancing monthly, but would still be far less transactions than rebalancing daily. I am curious as to whether rebalancing weekly or bi-weekly might be an improvement over monthly rebalancing.

Filed Under: Test your concepts historically Tagged With: ivy portfolio, rebalancing strategy

Three Different Ways That Survivorship Bias Can Damage Your Backtesting

February 23, 2014 by Andrew Selby Leave a Comment

It seems like the more we learn about developing and testing quantitative trading strategies, the more we realize how easily our backtesting results can be ruined. One of the easiest ways that we can produce completely useless testing results is by using data that has not been properly cleaned.

Survivorship bias can creep into the price data we use for our backtesting in many subtle ways. Three of the most obvious ways are through differences in as-traded prices, failing to include delisted stocks, or through testing indexes as they are composed today instead of using their historical components.

survivorship bias

Including only the stocks that have been strong enough to survive can open your backtesting results up to many different versions of survivorship bias.

Each of these data set flaws can have a varied impact on our backtesting results, depending on the type of strategy we are testing and a number of other variables. In a recent post, Cesar Alvarez took the time to test a few strategies using data that contained different versions of survivorship bias. His results showed that there are times when the bias can have a negligible impact, but there are also times when the impact is significant.

Index Components

At different times throughout the year, each of the major indexes will make adjustments to the stocks that comprise the index. This is done in order to maintain the index’s ability to track the general market in a specific fashion.

By using only the stocks that comprise today’s version of an index as a backtesting universe, we are automatically eliminating all of the stocks that have performed poorly enough to be removed from the index over the length of our backtest. This leaves us with a universe of stocks that is much stronger than the version we would have actually had if we were trading the system live over that period.

Cesar’s research shows us a strategy that was able to post an annual return of 36.25% with a maximum drawdown of 24.54%. However, when the exact same strategy was tested on a historically correct version of the index, the annual return dropped to 14.07% and the maximum drawdown rose to 30.42%.

Delisted Stocks

Delisted stocks are the most commonly understood form of survivorship bias. These are the stocks that our backtesting will miss because they are no longer trading due to acquisitions or bankruptcy. Much like the stocks that are no longer listed in indexes, failing to account for delisted stocks in our universe gives us a stronger universe of stocks than we would have had during live trading.

The evidence that Cesar provides in this case is interesting because it is inconsistent. When testing a mean reversion strategy, including delisted stocks appears to actually improve performance. However, when testing a trend following strategy, including delisted stocks had a negative impact on annual return and maximum drawdown.

As-Traded Prices

Another survivorship bias idea that Cesar wanted to test was the influence of split-adjusted pricing on backtesting performance. Because of stock splits, there are many instances where historic split-adjusted prices of individual stocks are much lower than they actually were at the time.

Cesar’s theory was that this could have a negative influence on backtesting a strategy that required a minimum price for stocks it would consider. While this sounded quite reasonable, the results show that the difference was almost negligible in most cases.

Filed Under: Test your concepts historically Tagged With: backtesting bias, survivorship bias

How the Internet Ruins Traders

February 21, 2014 by Andrew Selby Leave a Comment

The Internet has become the greatest resource that our planet has ever seen. There are endless advantages that it affords traders today that were simply not possible years ago. However, there are also some serious drawbacks that have been created by the world wide web.

Traders today have the ability to learn just about anything they want to know about anything through the internet. The problem is that this vast amount of knowledge can cause traders to experience information overload. Too much information can actually be worse than not having enough.

internet trading

The Internet can be a valuable component in the development of a trader, but it can also lead to a condition of information overload.

Nial Fuller from Learn To Trade The Markets wrote an interesting post about information overload where he covered how expanding coverage of popular economic reports and wider availability of different trading systems can actually be a detriment to developing traders.

Too Many Numbers

“Knowing what the latest Non-Farm Payrolls numbers are is not going to help you become a successful trader.” – Fuller

One of the great trading fallacies of our modern era is that more economic information is going to help us gain some sort of insight that no one else has seen. Many traders get caught up in the excitement surrounding different economic reports, but at the end of the day their strategies aren’t affected by the report either way.

Most quantitative strategies are based on signals that are generated by very specific technical data. While the data itself may be impacted by economic conditions, the actual strategy isn’t basing any decisions on those conditions until they show up in the data. Therefore, the actual economic reports have no direct influence on the strategy.

Too Many Systems

“Knowledge and theory are great, but without practice and experience they are nothing.” – Fuller

Another issue that many modern traders have to confront is getting lost in learning about trading and never crossing over to actually trading. It is easy to convince yourself that you are not ready to trade. There will always be something else to learn. There will always be some concept you haven’t researched yet.

In order to be a successful trader, at some point you have to stop looking for the best strategy and actually start trading one. This shift in mindset is one of the hardest aspects of becoming successful for new traders. In order to climb to the top of the trading mountain, you have to stop reading about climbing the mountain and actually start climbing.

Shifting the Trading Mindset

The Internet can do a great job of convincing traders that they need to process and understand all of the information available in order to make better decisions.

What many successful traders have actually found is that there is much greater value in ignoring most of the data available in order to focus on the specific signals of their strategy.  Ignoring all of the noise that comes with trading to focus on specific data points is the key to shifting from the mindset of learning to the mindset of trading.

 

Filed Under: What's happening in the current markets? Tagged With: trading flaws, trading mindset

Are You Sabotaging Your Projected Trend Following Profits?

February 20, 2014 by Andrew Selby Leave a Comment

It is widely understood that most of the profits from trend following and momentum strategies come from a select few big winners. Despite that understanding, traders generally don’t appreciate exactly how few trades make up that select few.

As quantitative traders, we willingly forfeit the desire to pick and choose between signals that our strategy triggers. Even though we aren’t making discretionary decisions about entries and exits, there is still a level of respect that needs to be paid to the importance of the select few trades that will drive our performance.

trend following

Missing just one trade can have a severe impact on your overall return, so if you aren’t committed to taking every trade you might be better off with a buy-and-hold strategy.

The Dorsey Wright Money Management blog published a post earlier this month that did a tremendous job of breaking down exactly how the top 20% of returns of a momentum strategy were relative to the other 80%. The post also showed how each quintile performed relative to a buy-and-hold benchmark.

Breaking Down Performance of Trades

The article took a basic sector rotation strategy that trades S&P 500 sub-sectors and broke its returns into five groups that each made up 20% of the total trades after sorting all trades by performance. They charted the performance of each of these groups and compared it to a chart of a equal-weight strategy that held all of the sub-sectors and rebalanced monthly.

The charts show that, regardless of lookback period, the bottom 60% of the strategy’s trades underperform the benchmark. The next 20% of trades just barely outperform the benchmark, and more or less match it after transaction costs. The only group that significantly outperforms the benchmark is the very top 20% of trades.

The Best Trades Are Critically Important

The point that the post is trying to make is that you absolutely must be willing and able to take every single trade that your trend following or momentum strategy produces. Omitting even one trade from the top 20% could cripple your overall performance because. Because we have no way of knowing what trades will end up producing the best profits, we cannot afford to miss out on any of them.

The article sums up this theme quite nicely:

If you are unwilling to constantly cut the losers and buy the winners because of some emotional hangup, it is extremely difficult to outperform.

Even the Best Traders Learn the Hard Way

Market Wizard Tom Basso tells a great story that fits in well here. Early in his trading career, Tom took a day off to spend the day with his parents who had come to visit him. On that day, he missed a signal for a silver trade that would have ended up being hugely profitable. That single trade would have made the difference between a profitable year and a losing year.

The moral of the story is that if you are going to trade a trend following or momentum strategy, you absolutely must be willing and able to take every single trade signal. There are no exceptions, because just one exception could ruin your performance.

Filed Under: Trading strategy ideas Tagged With: momentum, rotational strategy, trend following

Using an ATR Filter to Gauge Market Conditons

February 19, 2014 by Andrew Selby Leave a Comment

Average True Range (ATR) is primarily used as a mechanism to determine stop-loss levels. Another way to use ATR that is not quite as popular is as a filter to isolate market environments that have the potential to make significant moves.

By gauging the volatility of a given market, ATR can provide us with insight to the possible magnitude of a move. If a market has been experiencing greater volatility, it is probably more capable of producing a significant move than a market that has been experiencing lower volatility.

atr filter

This interesting example demonstrates how we can use an ATR Filter to evaluate market conditions.

Nat Stewart from NAS Trading wrote an interesting post about this topic where he compared the state of a market to weather conditions. He explains how market conditions can be evaluated just as weather conditions and then breaks down an example using ATR to evaluate market conditions.

Market Conditions and the Weather

Nat starts his post by comparing the similarities between wanting to know about weather conditions and market conditions. His concept that underlying conditions can impact the potential of a buy or sell decision is not revolutionary, but it provides us with an interesting visual when coupled with the weather analogy.

Being aware of your environment is essential to success in life and trading. You would probably be far less likely to leave the house during a hurricane. At the same time, you would have a hard time buying breakouts in a sideways trending market. As quantitative traders, we have the ability to build filters for our strategies that check for weather conditions.

The ATR Filter

Nat explained how this concept could be applied by providing us with backtesting results for a simple S&P 500 futures breakout strategy. For these backtests, he used ATR as a filter, requiring a certain level of volatility before his strategy would participate.

As the volatility required by the strategy increased, so did the win rate and average profit per trade. When an ATR of 10 was required, the strategy posted a win rate of 53.3% and an average trade of $82. When the required ATR was boosted to 40, the win rate increased to 76.5% and the average profit per trade jumped to $761.

Key Takeaways

Nat points out that these results are opposite of what we would expect based on the common practice of setting position sizes based on ATR. Many trend followers will reduce position sizes when ATR expands when those trades appear to actually be more profitable.

One thing that he doesn’t provide us is how many trades were eliminated when the ATR filter was raised from 10 to 40. It is possible that the bigger filter eliminated most of the trades, which would result in a lower annual return and total profit. It could also expose the backtesting results to small sample size bias.

Regardless of whether Nat’s backtesting results are statistically significant, his greater point remains effective. Every trader should be concerned with determining what type of market weather his strategy performs best in and look for ways to isolate those situations.

 

Filed Under: Trading strategy ideas Tagged With: atr, filter, market conditions

The Blueprint for Creating Your Own Forex Strategy, Part 2

February 18, 2014 by Andrew Selby Leave a Comment

Earlier this month, we looked at an article from Forex Crunch that covered the first three steps for building a new quantitative Forex strategy. Those first three steps covered brainstorming strategy ideas, defining the rules, and optimizing the parameters.

At that point we had a strategy that we had reason to believe would perform well in a trading situation. The next steps would involve properly testing our strategy in order to prove its value.

forex strategy

After brainstorming, defining rules, and optimizing a new Forex strategy, the next steps involve rigorous testing.

Forex Crunch has since published the second three steps for creating a robust Forex system. This post focuses on testing the system that was created with the first three steps. It suggests starting with in-sample testing, then moving to out-of-sample testing, and then suggests some even deeper methods of testing.

The Most Important Point Regarding Testing

While there is plenty of great information in the article about the different types of testing that should be performed on a new Forex strategy, the most significant point that the article makes is actually stated in the introduction:

Relying on the CAR (compound annual return) figure is not always a good idea because this metric does not take into account the risk that was involved in producing those gains.

This point is extremely basic, which makes it easy to overlook. While a strong compound annual return is the end goal of every trader, we all know that there are many ways to arrive at a strong compound annual return, and some of them aren’t worth the effort.

In addition to compound annual return, we also need to be concerned with how the strategy performs from a risk perspective. Looking at statistics like maximum drawdown, profit factor, Sharpe ratio, and winning percentage gives us a better idea of how the strategy arrives at its compound annual return.

This bigger picture view will give us a more qualified overview of what trading the strategy will feel like. We can use that to determine if the amount of risk the strategy exposes our capital to is in our tolerable range.

Testing Forex Strategies

Testing on in-sample data is where we can fine tune our strategies in order to get the return and risk statistics into the desired range. From there, we move to out-of-sample testing where we attempt to replicate those statistics on a fresh data set.

There are also testing methods like Walk-Forward Optimization and Monte Carlo Simulations that can shed even more light onto how our new system can be expected to perform in live trading. The important thing to watch for during this testing phase is consistency. The strategy should perform similarly across all of these different types of testing.

If the strategy produces solid returns through a wide range of testing, it can be expected to produce similar results in live trading.

Filed Under: Test your concepts historically Tagged With: backtesting, in-sample, monte carlo, out-of-sample, walk forward

  • 1
  • 2
  • 3
  • …
  • 18
  • Next Page »
FREE trading strategies by email

Trending

Sorry. No data so far.

Archives

  • Dominari
  • How does the forex market work?
  • Indicators
  • MetaTrader Tips
  • MQL (for nerds)
  • NinjaTrader Tips
  • Pilum
  • QB Pro
  • Stop losing money
  • Test your concepts historically
  • Trading strategy ideas
  • Uncategorized
  • What's happening in the current markets?

Translation


Free Trading Strategies

Privacy PolicyRisk Disclosure

Copyright © 2023 OneStepRemoved.com, Inc. All Rights Reserved.