Algorithmic and Mechanical Forex Strategies | OneStepRemoved

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

2 Painful hits

February 13, 2017 by Shaun Overton 14 Comments

December and January were extremely unkind to me. I took a huge loss on December 9 that coincided with the Fed meeting and another big punch in January. In total, I went from a 28% profit to a ~4% net loss.

Deservedly, my inbox quickly flooded with comments and suggestions on the drawdown. The most common of those was to stop trading during news events.

So… why am I still trading during news events? There are a few answers to that question.

Curve fitting

It’s not like the strategy loses money on every single news event. It’s 100% true that news events like the Fed meeting can and badly hurt. Say that I’m determined to exclude news events in the future. I’d have to

  1. Collect historical news event data
  2. Create a second algorithm, which selects the news events that forbid and allow trading to continue
  3. Test how the news algorithm interacts with Dominari
  4. Repeat this many times until I’m happy with the final result
Spiraling staircase

Due to the tiny number of news events that impact the markets like the December 9th announcement, my data set is miniature. The risk of overfitting to historical news events is huge.

Working with tiny amounts of data provides little in the way of long run confidence. Focusing my efforts elsewhere is far more likely to improve performance and requires much less work.

Too many trades

Too many trades sounds a bit naive, so let’s dig into what that means. Dominari trades a portfolio of 7 different instruments. All instruments cross with USD.

  • EURUSD
  • GBPUSD
  • USDCHF
  • AUDUSD
  • NZDUSD
  • USDJPY
  • USDCAD

Many subscribers correctly observed that the major losses occurred with trades open on all 7 pairs in the portfolio at the same time. A good predictor of trade performance is the number of trades open simultaneously.

1-3 trades seems to be consistently profitable
4-5 trades leads to biting my nails
6-7 trades is neutral to disastrous

Testing and confirming the max open trades rule was quick and easy. 5+ trades is very dangerous.

Accordingly, Dominari now exits all open trades if there are 5 or more trades open at any given time.

The next feature of Dominari will be a reversal strategy. Dominari was clearly prone to sudden equity changes if 5+ trades were open at the same time.

Make the losses work for us

An obvious counter strategy is to open trades in the opposite direction whenever Dominari would otherwise open too many trades. Testing the idea is very easy.

Coding a Dominari reversal strategy, however, would require a major reprogramming of the expert advisor’s code.

The number of trades per year would be miniscule. I doubt that it would average even 1 trade per month.

The idea is that Dominari can be the normal trading strategy. Whenever Dominari opens too many trades, the strategy then switches into reversal mode and trend trades with a simple trailing stop.

Switching direction should mostly reverse the negative trade skewness back in the positive direction. Almost all of the offending trades open at exactly the same time.

If the biggest losing trades opened at different times, there would be the risk of being too late to the party. All blowout trades opening at the same time means that the strategy can realistically reverse 100% of would-be losses into profits.

Sitting at the top of the docket are changes to Pilum. You can expect to hear about those soon so that I can incorporate Pilum into the Dominari signals. Once that and 2 other internal projects are finished, I’ll be able to dedicate the time required to fully implement the Dominari Reversal System.

Equity stop loss

Dominari uses emergency stop losses on all tickets. That is appropriate 99% of the time for individual trades. Those emergency losses reset once per hour in line with the concept of the TODS.

A little of the problem was bad luck. My stops came within a handful of pips of being triggered. Then they reset even further away, which made a bad problem worse.

When all trades move at the same time, then clearly the strategy could suffer extreme losses.

The first attempted solution after the Fed announcement was to add a portfolio level stop loss. The way that I wrote it also updated once per hour. When a second negative movement came in January, I stopped trying to be clever. It’s a flat, simple, stupid stop loss. If I lose more than 4% on all open trades, the entire Dominari portfolio goes flat.

I’m still trading Dominari

I still have my money trading the Dominari system; my confidence in the long term performance hasn’t changed, but it obviously requires safeguards. The max number of trades and the portfolio level stop loss will go a long way to limiting the impact of big moves in the future. AND, I should get the counter-strategy developed relatively soon to turn potential frowns upside down.

Lastly, many of you questioned why I’ve been so quiet. The honest answer is that I needed some time to process what happened. It’s easy to feel overwhelmed and discouraged when you get knocked down. I needed some time to process what happened.

I also needed time to double check the changes that I made to the portfolio were actually beneficial. It’s very easy to appease traders when they’re upset by rushing out features before they’re thoughtfully considered.

My money is on the line (I lost 2,000 euros between the two moves). What hurt my subscribers hurt me, too.

Filed Under: Dominari Tagged With: curve fitting, drawdown, expert advisor, portfolio allocation, skew

What makes a successful trader?

February 24, 2015 by Eddie Flower 7 Comments

The percentage of successful forex traders is relatively small, yet they share certain similarities: A well-built trading system, plus the right combination of personality traits and learned behaviors.

Of course, the tools are important – Regardless of a trader’s personal characteristics, a successful trader always builds, uses or finds a good Expert Advisor (EA). Most people believe that if they just find the one magic bullet, then everything will be fall into place. As Shaun discusses in the forex robot secrets report, that’s almost never the case.

Characteristics of successful traders

Traders and EA developers who succeed are usually found at one of the two extremes of intelligence: Either they’re highly intelligent, or they’re extremely dim witted. There doesn’t seem to be much middle ground in which “average” developers succeed.

On the one hand, it seems easily explainable that sharp developers should be more successful than “average” ones. Yet, those at the other intellectual extreme are often also more successful than the typical developer.

Why?

One theory to explain the trading success stories of traders and EA developers who are outside-the-ordinary is illustrated by this anecdotal experiment: If a mouse is placed into a cage where cheese is found on a particular side of the cage 60% of the time, and 40% of the time on the opposite side, every mouse will eventually learn to choose the side of the cage where cheese is found 60% of the time.

mouse and cheese

In other words, mice are at least intelligent enough to stop guessing and simply choose the pathway which is more often successful. In contrast, humans generally try to improve their success by finding and improving on some sort of pattern in randomness, even when it’s not there.

This theory may explain why less-intelligent traders can be successful by sticking to a system based on simple rules that win more often than they lose. Of course, “home-run” systems that are over-optimized in an attempt to “win everything every time” usually fail.

From the perspective of the mice described in the above experiment, it’s not about getting all the cheese every time, it’s about getting enough cheese more often than not.

A trading success story is based on more than just brain power

An automated trading success story may begin with brainpower, but it doesn’t end there. Brainiacs tend to build trading systems based on deep technical analysis. Theories are developed and modified as testing reveals strengths and weaknesses in a given system.

If a mouse is placed into a cage where cheese is found on a particular side of the cage 60% of the time, and 40% of the time on the opposite side, every mouse will eventually learn to choose the side of the cage where cheese is found 60% of the time.

But, there are plenty of intelligent, well-educated traders, and many of them don’t thrive when they’re involved in day-to-day trading. Significantly, winning traders’ ideas tend to become simpler over time instead of more complex.

An EA can be too powerful

Being too smart is a handicap that can keep traders from winning, and the power of EAs can also work against them. EA-focused traders tend to drift off course instead of remaining focused on the simple pathway toward trading success.

Without consistency, it’s difficult make any progress, nor measure results effectively. Too many indicators and too many pathways to explore may tempt EA traders to go astray, and wander away from the simple, basic rules that win.

Trading is a process, not a destination

When the trader approaches system design as a process rather than as a fixed destination, the outlook becomes much better. Success is relative, and improvement is ultimately more important than perfection.

For example, when a trader focuses on a system’s accuracy, the trade-off usually comes in the form of accepting a less-profitable exit point from a given trade. So, a trader’s urge to win a slightly-higher percentage of trades often erodes the system’s performance.

In contrast, process-oriented system designs let traders assess how making slight changes in the trade-entry protocol affect the system’s efficiency. And, using expert money-management methods can help by reducing the emphasis on entry and exit protocols.

Emotion in trading can’t be denied, yet it can be channeled appropriately

Emotion is impossible to separate from trading. But, it shouldn’t be the reason for trying to develop a winning Expert Advisor.

Instead, rational reasons for building an EA include situations in which a trader has been trading a given system long-term and wants to automate a proven winner, or finding ways to automate one’s trading based on narrowly-targeted indicators that win more often than not, even without generating perfect signals.

The question isn’t how to to remove emotion – Instead, the question is how to channel it appropriately, especially when the trader or EA developer has made a huge investment in time spent developing a system.

The goal is to develop and implement a consistent system – not a perfect system. When traders swing back and forth between winning and losing, the lack of consistency makes them feel less confident in their systems.

When a trader is “married” to a supposedly perfect system, there isn’t likely to be any trading success story in his or her future.

Work with professional EA developers

Designing a winning trading system takes hundreds of hours of time, plus at least a decade of experience. As mentioned earlier, system development is a process instead of an endpoint. Still, there’s a way to expedite the process – work with a professional developer like OneStepRemoved.

Where are you in your trading journey? Share your ideas below for you how “find more cheese” in the markets.

Filed Under: Trading strategy ideas Tagged With: accuracy, EA, emotion, expert advisor

Coppock Curves : A Straight Line To Trading Success

April 15, 2014 by Eddie Flower Leave a Comment

Coppock Curves, sometimes called Coppock indicators or Trendex indicators, are a type of indicator which offers quant traders a solid foundation upon which to build a simple yet successful mechanical trading system.

As described in more detail below, I use Coppock Curves in my mechanical trading system to generate trading signals in the S&P 500 or any other highly-liquid index. Coppock Curves also work well for trading iShares and ETFs.

What is a Coppock Curve?

Coppock Curves are a momentum indicator. Over time, they oscillate over and under zero. The Coppock Curve indicator was first described in 1962 by the economist and trader Edwin Coppock. In fact, it works so well that the Market Technicians Association (MTA) recognized Dr. Coppock with a lifetime achievement award in 1989.

Spiraling staircase

Its value lies in showing the beginning of long-term changes in price trends of stocks and indexes, particularly at the beginning of upward trends. This indicator can also signal the bottoms of futures and forex markets, yet I’ve found it less reliable there.

Although you can program your mechanical trading algorithms to generate trading signals based on this indicator over any time frame, I typically use it with monthly charts across a wide range of stock and index markets. Still, active traders can certainly use Coppock Curves with daily or even hourly time periods.

Specifically, I use Coppock Curves to generate “buy” signals at the bottom of bear markets. This indicator is especially good for distinguishing between bear rallies and actual market bottoms.

This is a trend-following indicator, so it doesn’t precisely show a market bottom. Instead, it shows me when a strong, bullish rally has become safely established enough to trade confidently.

Best of all, in my experience trades from signals based on Coppocks Curves are fairly resistant to shakeouts and whipsaws. Coppock Curves are slow, but they’re safe.

Coppock Curves signal the end of a “mourning period”

As background, it’s worthwhile to note that the original idea which led Dr. Coppock to develop his indicator was based on the natural cycle of life, death, and mourning before returning to new life again.

He thought that the normal upward march of stock markets (and therefore stock indexes) was like the “life” part of the cycle, which of course was followed by “death” that is, the period of falling prices during a bear market.

Dr. Coppock was particularly interested in calculating the length of a stock market’s “mourning” period, after which it would be safe to re-enter the market “long” again. Logically, this entry point at the end of the mourning period would represent the beginning of the next long-term uptrend.

The apocryphal story says that he asked the bishops at a local Episcopal Church, one of his investment clients, how long people usually spent in mourning after bereavements. He was told that human mourning typically requires between 11 to 14 months, so those were the values he adopted in his original equation to determine when stock prices would begin to rise again.

Coppock Curves were first used as long-term indicators based on monthly charts. Of course, the signals generated with monthly time frames are fairly infrequent. Still, because I use Coppock Curves to trade a variety of markets, I receive plenty of trading signals.

In particular, the monthly time frame is very reliable for stock and index trading. Studies have shown that, since 1920 in the U.S. stock markets, Coppock Curves have generated winning signals with about 80% frequency.

Nowadays, with the rapid turnover in modern markets, it seems that trading cycles have become faster. In addition to monthly time frames, some traders have found that daily time frames work very well in generating successful Coppock Curve signals.

A trader can program a mechanical trading system to recognize and respond to signals based on a daily or hourly time frame, although additional algo trading parameters should be added to reduce the chance of overtrading.

If you want to use Coppock Curves to generate signals on shorter time frames, you could experiment with your mechanical trading system using a variety of make-sense “mourning periods” for your particular marketplace.

How to calculate Coppock Curves

The Coppock indicator is based on three variables: A shorter-term rate of change (abbreviated as ROC), and a somewhat longer-term ROC.  Coppock Curves are developed by using the weighted moving average (WMA) derived from the chosen time periods of a given market index.

The classic equation stated in words:

Coppock Curve = The 10-period WMA of a 14-period ROC plus an 11-period ROC

Or, as a formula for programming:

Coppock Curve = WMA[10] of (ROC[14] + ROC[11])

When ROC = [(Close – Close n periods ago) / (Close n periods ago)] * 100

Where n is the number of time periods.

In the classic scenario, 11 and 14 time periods. Be sure to make separate ROC calculations.

As you can see, the basic setup is very simple – On a moving basis, I program my mechanical trading system to calculate the percent of change in a given index (say the S&P or DJIA) from fourteen months ago.

Then, my mechanical trading program calculates the percentage change in the same index from eleven months ago. Next, the mechanical trading system adds together the two different percent changes. Then, it calculates a 10-period weighted moving average of the above total.

It’s important to note that you can use different time periods for the ROC calculations and the WMA calculations. I sometimes program my mechanical trading system to use the classic 11- and 14-month time periods for ROC while using time periods for the WMA which are shorter than the classic 10-month period.

So, I often use using a 2-month or 3-month WMA (instead of 10 months) while the ROC is calculated using the 11- and 14-month prices.

Or, you can modify your mechanical trading system to employ shorter time periods for some or all of the calculations, i.e. use daily or hourly prices instead of monthly price charts. It generates more signals, but in my experience they’re less reliable unless you add additional filters, as discussed below.

As well, you can add additional embellishments to suit your own needs. In any event, the general method remains the same. When charting the basic inputs, you’ll see that the output is a fairly smooth arc, hence the name of this indicator.

In any event, the classic Coppock Curve equation for programming a mechanical trading system can be stated as: The sum of the 14-month rate of change and the 11-month rate of change, with smoothing by applying a 10-month weighted moving average.

The Coppock Curve “buy” signal

On Coppock Curves, the zero line is the trigger. When the price line rises from below the 0 line it signals a low-risk buying opportunity. My mechanical trading system executes a buy when the Coppock indicator is first below 0, then heads upward from the trough.

Since this is most effective as a bullish indicator, I ignore the opposite (“sell”) signals. Still, some traders, especially those using short time frames, use Coppock Curves with algo trading systems to generate sell signals and execute trades that close out long positions. Active traders can both close long trades and open shorts when the Coppock Curve crosses below the zero line.

The figure below shows the classic Coppock Curve trading strategy using monthly time periods. The buy signal came in 1991. The sell signal came ten years later, in 2001. Note that this long time frame helped me avoid the slump in late 2001 and 2002.

The next buy signal came in 2003 and the sell signal was in 2008. This helped me escape the slump in 2008 and into 2009. Note, also that the current “buy” position, signaled in early 2010, continues to remain open, at least through the date of this chart.

Coppock Curve on S&P 500 monthly chart

The Coppock Curve on an S&P 500 monthly chart

Next, for more-active traders here’s a screenshot showing the strategy applied with shorter time periods, as shown on a daily S&P 500 chart. Of course, many more signals are generated, although in general they are less likely to be winners.

Coppock Curve on a daily S&P 500 chart

Coppock Curve on a daily S&P 500 chart

Importantly, the longer the time period, the safer the buy signal. Since my mechanical trading system based on Coppock indicators is a trend-following system, I don’t necessarily capture the immediate gains from the exact moment of a trend reversal. Instead, my mechanical trading system gets me “long” just before the beginning of a profitable advance in a bull market.

Adjusting and filtering signals from Coppock Curves

I’ve found Coppock Curves to be highly reliable when used for monthly time periods. In my experience, using weekly, daily or hourly time periods usually means that my entries and exits aren’t as “tight” as I would like, meaning that I don’t capture all the gains I had hoped for, and I also have more losses.

However, active traders can decrease the ROC variables, which has the effect of increasing the speed of fluctuation in Coppock Curves and will therefore generate more trading signals. Of course, even though monthly time periods are my favorite, an ultra-long-term trader could also increase the ROC time periods to slow fluctuations even more, thus generating fewer signals.

As I’ve said above, in order to receive earlier entry signals, I usually decrease the WMA downward from 10 months, sometimes to 6 months, and often to as little as 2 months. By programming my mechanical trading system carefully with just the right WMA period, and filtering the signals, I maximize my profitability in a given market.

If you want to use Coppock indicators for active trading, I recommend that you filter the trade signals generated by your mechanical trading system so that you only accept trades which are in the same direction as the current dominant trend. You’ll find this mechanical trading strategy to be the most profitable, since you can avoid many losing trades by filtering the signals.

Which markets show reliable Coppock Curves?

I use my Coppock curve-powered mechanical trading system to trade a range of indexes, especially those based directly on stocks, such as:

  • Dow Jones Industrial Average
  • S&P 500
  • NASDAQ Composite
  • EURO STOXX 50
  • FTSE 100
  • Nikkei 225
  • Hang Seng

As well, if you’re focused on ETFs you’ll find that a mechanical trading system using Coppock Curves will allow you to catch the beginning of trends in specific market niches, such as biotechnology, energy, and international or regional equities niches.

The key is to make sure you trade only the liquid indexes. Otherwise, you may run the risk of being shaken out during “fake” trend changes.

Trading Coppock Curves in non-equity indexes

As well, for the sake of diversification and to avoid issues with correlation, I also program my mechanical trading system to spot and trade Coppock Curves in non-equity indexes as well. Again, I focus on markets which have sufficient liquidity.

There are some profitable non-equity indexes, including iShares and ETFs, which can be traded using Coppock indicators:

  • Bloomberg US Treasury Bond Index
  • Bloomberg Canada Sovereign Bond Index
  • Bloomberg U.K. Sovereign Bond Index
  • Bloomberg US Corporate Bond Index
  • Bloomberg GBP Investment Grade European Corporate Bond Index
  • Bloomberg EUR Investment Grade European Corporate Bond Index
  • Bloomberg JPY Investment Grade Corporate Bond Index
  • iShares Barclays 7-10 Year Treasury Bond Fund
  • iShares Barclays 20 Year Treasury Bond Fund
  • Schwab Short-Term U.S. Treasury ETF
  • Vanguard Short-Term Government Bond ETF
  • PIMCO 1-3 Year U.S. Treasury Index ETF

I’ve seen reliable signals from Coppock Curves when trading all the above-listed non-equity indexes. As always, the key is to use a mechanical trading system in only those markets which are highly liquid, so that the algorithms are reasonably sure that a confirmed signal is legitimate before trading it.

Coppock Curves show a straight line to success

In recent years, Coppock Curves have been drawing renewed interest from traders who are turning once again to this tried-and-true trading tool. See, for example, these recent mentions of Coppock indicators in the financial press: Jay On The Markets, and the follow up article, as well as in various trader musings.

In summary, I can say that Coppock Curves can lead you straight to success, as long as you have the patience to let your mechanical trading system do the work for you. If you use the length of variables’ time periods which are most appropriate for your chosen markets, you should do very well with Coppock Curves.

Filed Under: Trading strategy ideas Tagged With: Coppock curve, Coppock curves, Coppock indicator, Coppock indicators, expert advisor, mechanical trading, ninjatrader, system, trading

How To Win With Mechanical Trading Systems

March 18, 2014 by Eddie Flower 13 Comments

Much ink has been devoted to pinpointing the causes of mechanical trading systems failures, especially after the fact. Although it may seem oxymoronic (or, to some traders, simply moronic), the main reason why these trading systems fail is because they rely too much on the hands-free, fire-and-forget nature of mechanical trading. Algorithms themselves lack the objective human oversight and intervention necessary to help systems evolve in step with changing market conditions.

Mechanical trading systems failure, or trader failure?

Instead of bemoaning a trading-system failure, it’s more constructive to consider the ways in which traders can have the best of both worlds:  That is, traders can enjoy the benefits of algorithm-managed mechanical trading systems, such as rapid-fire automatic executions and emotion-free trading decisions, while still leveraging their innate human capacity for objective thinking about failure and success.

The most important element of any trader is the human capability to evolve. Traders can change and adapt their trading systems in order to continue winning before losses become financially or emotionally devastating.

Choose the right type and amount of market data for testing

Successful traders use a system of repetitive rules to harvest gains from short-term inefficiencies in the market. For small, independent traders in the big world of securities and derivatives trading, where spreads are thin and competition fierce, the best opportunities for gains come from spotting market inefficiencies based on simple, easy-to-quantify data, then taking action as quickly as possible.

When a trader develops and operates mechanical trading systems based on historical data, he or she is hoping for future gains based on the idea that current marketplace inefficiencies will continue. If a trader chooses the wrong data set or uses the wrong parameters to qualify the data, precious opportunities may be lost. At the same time, once the inefficiency detected in historical data no longer exists, then the trading system fails. The reasons why it vanished are unimportant to the mechanical trader. Only the results matter.

mechanical trading rules

Pick the most pertinent data sets when choosing the data set from which to create and test mechanical trading systems. And, in order to test a sample large enough to confirm whether a trading rule works consistently under a wide range of market conditions, a trader must use the longest practical period of test data.

So, it seems appropriate to build mechanical trading systems based on both the longest-possible historical data set as well as the simplest set of design parameters. Robustness is generally considered the ability to withstand many types of market conditions. Robustness should be inherent in any system tested across a long time range of historical data and simple rules. Lengthy testing and basic rules should reflect the widest array of potential market conditions in the future.

All mechanical trading systems will eventually fail because historical data obviously does not contain all future events. Any system built on historical data will eventually encounter ahistorical conditions. Human insight and intervention prevents automated strategies from running off the rails. The folks at Knight Capital know something about live trading snafus.

Simplicity wins by its adaptability

Successful mechanical trading systems are like living, breathing organisms. The world’s geologic strata are filled with fossils of organisms which, although ideally suited for short-term success during their own historical periods, were too specialized for long-term survival and adaptation. Simple algorithmic mechanical trading systems with human guidance are best because they can undergo quick, easy evolution and adaptation to the changing conditions in the environment (read marketplace).

Simple trading rules reduce the potential impact of data-mining bias. Bias from data mining is problematic because it may overstate how well a historical rule will apply under future conditions, especially when mechanical trading systems are focused on short time frames. Simple and robust mechanical trading systems shouldn’t by affected by the time frames used for testing purposes. – The number of test points found within a given range of historical data should still be large enough to prove or disprove the validity of the trading rules being tested. Stated differently, simple, robust mechanical trading systems will outshine data-mining bias.

If a trader uses a system with simple design parameters, such as the QuantBar system, and tests it by using the longest appropriate historical time period, then the only other important tasks will be to stick to the discipline of trading the system and monitoring its results going forward. Observation enables evolution.

On the other hand, traders who use mechanical trading systems built from a complex set of multiple parameters run the risk of “pre-evolving” their systems into early extinction.

Build a robust system that leverages the best of mechanical trading, without falling prey to its weaknesses

It’s important not to confuse the robustness of mechanical trading systems with their adaptability. Systems developed based on a multitude of parameters led to winning trades during historical periods – and even during current observed periods – are often described as ‘robust.’ That is no a guarantee that such systems can be successfully tweaked once they have been trade past their “honeymoon period.” That is an initial trading period during which conditions happen to coincide with a certain historical period upon which the system was based.

Simple mechanical trading systems are easily adapted to new conditions, even when the root causes of marketplace change remain unclear, and complex systems fall short. When market conditions change, as they continually do, the trading systems which are most likely to continue to win are those which are simple and most-easily adaptable to new conditions; a truly robust system is one which has longevity above all.

Simple algorithmic mechanical trading systems with human guidance are best because they can undergo quick, easy evolution and adaptation to the changing conditions in the environment (read marketplace).

Unfortunately, after experiencing an initial period of gains when using overly-complex mechanical trading systems, many traders fall into the trap of attempting to tweak those systems back to success. The market’s unknown, yet changing, conditions may have already doomed that entire species of mechanical trading systems to extinction. Again, simplicity and adaptability to changing conditions offer the best hope for survival of any trading system.

Use an objective measurement to distinguish between success and failure

A trader’s most-common downfall is a psychological attachment to his or her trading system. When trading-system failures occur, it’s usually because traders have adopted a subjective rather than objective viewpoint, especially with regard to stop-losses during particular trades.

Human nature often drives a trader to develop an emotional attachment to a particular system, especially when the trader has invested a significant amount of time and money into mechanical trading systems with many complex parts which are difficult to understand. However, it’s critically important for a trader to step outside the system in order to consider it objectively.

In some cases, the trader becomes delusional about the expected success of a system, even to the point of continuing to trade an obviously-losing system far longer than a subjective analysis would have allowed. Or, after a period of fat wins, a trader may become “married” to a formerly-winning system even while its beauty fades under the pressure of losses. Worse, a trader may fall into the trap of selectively choosing the testing periods or statistical parameters for an already-losing system, in order to maintain false hope for the system’s continuing value.

An objective yardstick, such as using standard deviation methods to assess the probability of current failure, is the only winning method for determining whether mechanical trading systems have truly failed. Through an objective eye, it’s easy for a trader to quickly spot failure or potential failure in mechanical trading systems, and a simple system may be quickly and easily adapted to create a freshly-winning system once again.

Failure of mechanical trading systems is often quantified based on a comparison of the current losses when measured against the historical losses or drawdowns. Such an analysis may lead to a subjective, incorrect conclusion. Maximum drawdown is often used as the threshold metric by which a trader will abandon a system. Without considering the manner by which the system reached that drawdown level, or the length of time required to reach that level, a trader should not conclude that the system is a loser based on drawdown alone.

Standard deviation versus drawdown as a metric of failure

In fact, the best method to avoid discarding a winning system is to use an objective measurement standard to determine the current or recent distribution of returns from the system obtained while actually trading it. Compare that measurement against the historical distribution of returns calculated from back-testing, while assigning a fixed threshold value according to the certainty that the current “losing” distribution of mechanical trading systems is indeed beyond normal, to-be-expected losses, and should therefore be discarded as failed.

So, for example, assume that a trader ignores the current drawdown level which has signaled a problem and triggered his investigation. Instead, compare the current losing streak against the historical losses which would have occurred while trading that system during historical test periods. Depending upon how conservative a trader is, he or she may discover that the current or recent loss is beyond, say, the 95% certainty level implied by two standard deviations from the “normal” historical loss level. This would certainly be a strong statistical sign that the system is performing poorly, and has therefore failed. In contrast, a different trader with greater appetite for risk may objectively decide that three standard deviations from the norm (i.e. 99.7%) is the appropriate certainty level for judging a trading system as “failed.”

The most important factor for any trading systems’ success, whether manual or mechanical, is always the human decision-making ability. The value of good mechanical trading systems is that, like all good machines, they minimize human weaknesses and empower achievements far beyond those attainable through manual methods. Yet, when properly built, they still allow firm control according to the trader’s judgment and allow him or her to steer clear of obstacles and potential failures.

Although a trader can use math in the form of a statistical calculation of standard distribution to assess whether a loss is normal and acceptable according to historical records, he or she is still relying on human judgment instead of making purely-mechanical, math-based decisions based on algorithms alone.

Traders can enjoy the best of both worlds. The power of algorithms and mechanical trading minimizes the effects of human emotion and tardiness on order placement and execution, especially with regard to maintaining stop-loss discipline. It still uses the objective assessment of standard deviation in order to retain human control over the trading system.

Be prepared for change, and be prepared to change the trading system

Along with the objectivity to detect when mechanical trading systems change from winners into losers, a trader must also have the discipline and foresight to evolve and change the systems so they can continue to win during new market conditions. In any environment filled with change, the simpler the system, the quicker and easier its evolution will be. If a complex strategy fails, it may be easier to replace than to modify it, while some of the simplest and most-intuitive systems, such as the QuantBar system, are relatively easy to modify on-the-fly in order to adapt to future market conditions.

In summary, it can be said properly-built mechanical trading systems should be simple and adaptable, and tested according to the right type and amount of data so that they will be robust enough to produce gains under a wide variety of market conditions. And, a winning system must be judged by the appropriate metric of success. Instead of merely relying on algorithmic trading rules or maximum drawdown levels, any decision about whether a system has failed should be made according to the trader’s human judgment, and based on an assessment of the number of standard deviations of the system’s current performance when measured against its historic-test losses. If mechanical trading systems are failing to perform, the trader should make the necessary changes instead of clinging to a losing system.

Filed Under: How does the forex market work?, MetaTrader Tips, Trading strategy ideas Tagged With: backtesting, expert advisor, forex, mechanical trading, risk management, standard deviation, stop loss, strategy

How Automated Should Your Trading Strategy Be?

December 31, 2013 by Andrew Selby Leave a Comment

One of the most attractive things about quantitative trading approaches is that many of them have the capability to be completely automated. That leads many traders to believe that they will be able to simply program a strategy into their platform and turn their computer into a virtual ATM.

As with most things in life, automated trading isn’t as simple as it appears. The performance of different strategies changes over time as markets adjust. Continually evolving technology exposes our strategies to continually evolving biases. The fact that a strategy worked well last year is no guarantee that it will work well this year.

With all of the different ways that markets could fundamentally change, do you really feel comfortable designing a fully automated strategy?

automated trading

Completely automated trading sounds like a great idea, but you may see some advantages to keeping some manual aspects in your strategy.

An article that appeared on Forex Crunch earlier this month discussed the pros and cons of automated and manual trading. After breaking down both sides, the article concluded that the best approach is usually to develop a strategy that lies somewhere between the two extremes.

The fact that you want to build a fairly automated strategy does not have to mean that you can’t override that strategy if markets suddenly change. On the other hand, the discretionary approach you are working on might be improved with an expert advisor to help you identify setups.

Advantages of Automated Trading

The biggest advantage of using an automated trading approach is the reduction in slippage through flawless execution. If your strategy doesn’t have to wait for you to confirm an entry, it can jump into a position the instant that it sees a signal. This improvement in order entry also allows a trader to avoid being glued to a computer screen all day.

Some of the other advantages of automated trading that the article covered include the ability to process large amounts of data and the ability to trade around-the-clock. The article points out that automated strategies can monitor far more markets than humans can, and automated strategies never have to sleep.

Advantages of Manual Trading

The biggest advantage of manual trading, according to the article, is having the ability to call and audible. The article suggests that if a crash in Japanese Yen is due to a large typhoon, a manual trader can simply shut down his strategy until the weather clears up.

Another advantage that manual traders have is the ability to scale the aggressiveness of their strategy up or down depending on gut feelings or discretionary judgements. This may not be helpful if your gut feelings are not very accurate, but traders with extensive experience will be much more comfortable trusting their instincts.

As you can see, there are advantages to both sides of this discussion. The best approach for any trader is to find an approach that works well with their own personality.

Filed Under: Trading strategy ideas Tagged With: automated trading, expert advisor, manual trading

3 Forex Expert Advisors to Build Your System Around

November 21, 2013 by Andrew Selby Leave a Comment

Many of the traders interviewed in the Market Wizards books expressed concern that too many traders place too much emphasis on entry and exit signals. They suggest that topics like position sizing and risk management are far more important.

However, quantitative traders still have to decide on some criteria to properly define their entry and exit signals. With so many options out there, it can be more difficult than those Market Wizards books suggest to find and decide on a decent entry and exit strategy that has an edge.

Even after you find and develop your system, there is always room for improvement. For that reason, many forex traders are constantly looking for new ideas, edges, and expert advisors. Babypips.com published their Top 3 Featured Expert Advisors for November 2013 at the beginning of this month.

forex expert advisor

Babypips.com has profiled three different forex expert advisors that might be useful in creating profitable trading systems.

They went through the trouble of backtesting each of these EAs from October 2010 through October 2013. Here are the highlights:

The Linear Weighted Moving Average Strategy

This expert advisor was suggested to me by a kind forum user bobbillbrowne in the Expert Advisors and Automated Trading section.

In a nutshell, it makes use of the linear weighted moving averages (LWMA) on the short-term time frames such as 1-min, 5-min, and 15-min charts.

This strategy signaled a total of 23 trades over the course of the backtesting period. The average profit on a trade was 0.43%, the win rate was 56.52%, and the maximum drawdown was 13.45%.

The AUD/USD MACD Cross Strategy

My search for profitable EAs also led me to the MLQ4 Codebase via the MT4 trading platform.

I stumbled upon this MACD Cross system by author ilkyulee, who specified that this robot must be used on AUD/USD’s daily chart.

This strategy signaled a total of 46 trades over the course of the backtesting period. The average profit on a trade was 1.16%, the win rate was 26.09%, and the maximum drawdown was only 5.69%.

The MACD Sample EA Strategy

I also took a look at the sample systems included in MT4 and found an updated version of the MACD Sample EA.

The currency pair and time frame weren’t specified so I just decided to run the tests on my favorite pair and time frame, which is EUR/USD 1-hour.

This strategy signaled a total of 190 trades over the course of the backtesting period. The average profit on a trade was 0.59%, the win rate was 73.68%, and the maximum drawdown was only 0.39%. Not a bad start for an out-of-the-box sample strategy.

Proceed With Caution

The article then goes on to remind traders that automated trading can be dangerous:

Before you trust a robot with your life (or in this case, your hard-earned cash), make sure that it’s a good autobot and not a bad decepticon.

In other words, you gotta do your homework and additional research to figure out if the EA is consistently profitable or not.

The author also cautions that past performance does not guarantee future results. He also explains that just because an expert advisor does not initially have a great P&L does not mean that it will never be profitable. It may just need to be adjusted in a certain way to become profitable.

 

Filed Under: How does the forex market work? Tagged With: expert advisor, forex, trading systems

Retail trader disadvantage

October 28, 2013 by Shaun Overton Leave a Comment

Michael Halls-Moore invited a reply to one of my tweets last week, “Retail traders have an advantage over the pros? Me thinks not.” He wrote a great overview of why the institutional traders look longingly at the retail crowd and all the hoops that they don’t have to jump through.

His points are all valid, but he overlooked the big picture. Pricing is everything to a trader. Retail traders get the short end of the stick when it comes to the cost of doing business.

The cost of trading is massively disproportionate

Let’s say that you’re a would be quantitative trader and that you’re looking for opportunities. Let’s say you trade mini lots in the forex market with 60% accuracy and 1:1 risk reward ratios. If you’re not familiar with what a typical trading system looks like, those numbers means that you have an enormous edge.

Some of the less reputable forex brokers out there charge 3 pip fixed spreads. If you’re trading with a broker offering fixed spreads, I urge you to start price shopping. Fixed spreads are wildly overrated. You pay a huge premium for the certainty of a fixed spread. I can’t think of anything remotely plausible to justify them.

The larger forex brokers charge typical spreads in the neighborhood of 2 pips on the largest majors. Although most seem to find this reasonable, the comparison between a 2 pip average spread and institutional spreads is night and day.

Do you know what the average EURUSD spread looks like on the interbank market? It’s often 0.2-0.5 pips. Retail traders pay an average markup of over 300% on their trades.

retail trader pricing

Retail traders facing the institutions is a bit like David and Goliath.

Retail forex prices have declined in recent years. A few brokers like MB Trading and Pepperstone offer raw spreads with commissions tied to the dollar volume traded. These are, in my opinion, are about the fairest prices available to low balance traders running an expert advisor.

The best deal available to semi-institutional forex traders (CTAs, large balance retail traders, etc) is Interactive Brokers. The customer support is famously poor; they’re cheap for a reason. IB also offers raw spreads with a commission.

My experience with IB has been excellent, but you need to trade size for the economics to work. A 0.5 pip typical spread is great, but the 2 mini-lot minimum trade size and $2.50 minimum commission really adds up. Trading with IB doesn’t approach institutional type pricing until your average trade size approaches 1 standard lot.

So, how does pricing affect the final outcome with our 1:1 risk reward strategy that wins 60%?

  • Free trading: After 100 trades, you’ve earned $600 and lost $400. The hypothetical net profit is $200.
  • Fixed spread: You’ve spent $300 in spread costs to enter 100 trades. The total net profit is -$100 ($200-$300).
  • Average retail: You’ve spent $200. There is no profit because you breakeven ($200 hypothetical profit – $200 in costs). However, your broker loves you for doing that many trades.
  • Good retail pricing: Let’s say the average cost of a trade is 1.3 pips after commissions. You’ve spent ~$130 placing 100 trades. The total profit is $70.

Even with good strategies, the profitability of your algorithm is as simple as choosing the cheapest broker.

Equities pricing

Trading stocks is even more expensive than forex. I remember back in the day when I thought Scottrade was cheap for offering $7 commissions. It gets worse and worse when you go through the list of stock brokers. Most of them try to get away with charging $7-10 per trade. If customer service is important to you, then those are the shops to look at.

If your top priority is trading profitably, then again, broker selection is critical. The only way that a small guy can make it is by chipping away at the costs. Interactive brokers is again a great option, charging fractions of a penny per share traded. If you decide to trade 2 shares of Google (GOOG: $1,017 per share) or 1,000 shares of Fannie Mae (FNMA: $2.35 per share), the transaction costs are tiny. Two ticks in your favor is all it takes to cover the trade.

You might be thinking that I said two ticks in forex is expensive. How can I say that two ticks in equities is reasonable?

Volatility. Two ticks in the stock market is a little hiccup. It’s not at all uncommon to see highly liquid stocks move 2-3% in a single day. Forex is only interesting because of the leverage. The currency pairs themselves rarely move more than 1%, and that’s usually on major news.

Risk Management

Every employee knows that they’re only one mistake away from getting fired. That’s the reason that everyone hates having a boss. There’s a single person with unilateral authority to financially murder you. Who’s going to look upon that as a good thing?

Well, the truth is that bosses exist for a reason. It’s someone that calls you out when you do something stupid. More importantly, the boss has the power and influence to ensure that you stop doing stupid things.

The dream of entrepreneurship is not having a boss. You go on vacation when you can, you don’t have to play office politics, you don’t have to waste time selling good ideas. You just go out and do them.

Even with good strategies, the profitability of your algorithm is as simple as choosing the cheapest broker

I can tell you as a small business owner that the negatives stand out strongly in my mind. When you don’t have someone to hold you accountable, even if it’s a mentor, you make many more dumb mistakes than you should. It takes incredible discipline to hold the line consistently. Knowing that I’m not going to look stupid or have to explain myself to anyone probably gives me a lot more false confidence than I really need.

Self-employed traders working at home experience the same thing. Who calls you out when you’re trading just because you’re bored?

The decline in the trading account points out the obvious, but that’s not enough to necessarily stop the bad behavior. We’re social creatures. Most people need to speak with other people to maintain their sanity. When you’re trading at home alone, it takes a lot of effort to ensure that you’re getting enough social contact. A good boss prevents you from indulging in bad behaviors.

Conclusion

Selecting the right broker is enough to determine whether or not a good strategy will wind up making money or not. It’s expensive to trade. The bigger you are, the better your pricing.

Retail trading prices have reached a point where it’s at least possible to trade profitably. Nonetheless, the number of strategy types out there is limited because the lower, shorter term strategies are prohibitively expensive to trade.

The quantitative traders and hedge funds get the more active strategy space to themselves. Their trading costs are so low that they’re really the only people that can afford to trade actively.

Filed Under: What's happening in the current markets? Tagged With: commission, CTA, equities, expert advisor, forex, hedge fund, insitutional, Interactive Brokers, MB Trading, Michael Halls-Moore, Pepperstone, pip, quantitative strategies, retail, risk management, risk reward ratio, spread, stocks, volatility

Can my broker steal my expert advisor?

October 17, 2013 by Shaun Overton 4 Comments

I get this question often enough that it’s time to put this out on the internet. There are plenty of reasons for traders to remain wary or suspicious of their broker. If you’re using the broker’s software, can they steal the expert advisors in your account that are making money?

Steal MT4 expert advisor

Can the broker steal your EA for MT4 or MT5?

The answer is an emphatic no. I started my career working as a broker and have been involved with forex for 7 years this month. I’ve seen the backend systems and tools that the MT4 brokers use to manage clients and their positions. I’ve also seen them on the floor of one of the MetaTrader bridge companies.

The brokers use a piece of software called the MetaTrader Manager. The manager is basically a database that tracks the open positions and equity for clients. It does not have a button for sucking MT4 expert advisors from client accounts.

Filed Under: MetaTrader Tips Tagged With: broker, expert advisor, metatrader, MetaTrader Manager, mt4

Testing Shaun’s Euro Currency Scalping Strategy

October 13, 2013 by Andrew Selby Leave a Comment

Back in March, Shaun published a Scalping Expert Advisor that traded the Euro-USD five minute chart using moving average envelopes. In case you missed it, here is the video Shaun made explaining the strategy:

Shaun’s strategy was recently featured for an in-depth post by Jeff from System Trader Success. In that post, Jeff attempted to test and develop Shaun’s simple scalping strategy. Here is how Jeff described Shaun’s strategy:

Shaun noticed that extreme price moves as defined by 1% distance from a 200-period simple moving average (SMA) occurred very rarely. Going with the premise that price will soon retreat from such an extreme, this might be a potential location to open a trade. In short, Shawn’s Simple Scalping System (SSS) is a mean reverting strategy that utilizes a SMA envelope. When price closes beyond the envelope a trade is opened. The trade is closed when price returns to the envelope.

Jeff’s rules were exactly the same as Shaun’s. He tested the strategy from May 2001 through December 2011 starting with $10,000. The first thing he noticed was the severe impact slippage and commissions would have on the returns. After testing a few different combinations, he settled on using a $5 commission and 1 Tick slippage on each trade.

Jeff’s results show the system to have a profit factor of 1.10. He notes that the profit factor is 1.38 on the long side and 0.88 on the short side. Because of that, he elects to focus exclusively on the long side trades from that point forward.

currency scalping

Shaun’s simple currency scalping strategy has an edge.

The open ended downside of the system leaves Jeff thinking that adding a stop component may improve performance:

Notice that many of the trades that experience a 1000 or larger drawdown end up being red points on the chart. These are very expensive drawdowns that turn into large losers. Somewhere between $600 and $1,000 might be a good place to put a hard stop to limit those large losses.

However, finding the right stop proves to be challenging:

Stop values up through $2,000 really push our net profit down. Can anyone really trade a scalping system that might require a $2,000 or more catastrophic stop loss? This makes me wonder if we need to find an additional filter to help reduce unprofitable trades. Instead of simply applying a hard stop we might want to test trading only during certain hours, trading only during a bull market or adding a volatility filter. These are all good ideas and we’ll continue to explore this trading system in a future article.

Much like Shaun originally suggested, Jeff comes to the conclusion that this strategy has merit, but needs further development. He suggests a number of potential components that could improve the returns.

 

 

Filed Under: Test your concepts historically Tagged With: currency scalping, euro, expert advisor, moving average envelope

Keeping up with the humans

October 10, 2013 by Shaun Overton 2 Comments

Daniel Fernandez posts a nice summary of some of the problems algorithmic traders have experienced over the past few years. If you’ve been wondering why your expert advisor isn’t making money, well, you’re not alone.

Daniel points out the terrible performance of the Barclays systematic trading index and its nearly three years of continuous losses. Even the pros are losing money consistently.

Tough Times with Algorithmic Trading

Barclays system traders return

The performance of professional systems traders has fallen over the past two years

Key sections:

It is no secret that algorithmic trading had some “golden years” between 2008-2011. Through this period – most notably due to the high directional volatility of the financial crisis – systems based on a wide variety of market characteristics were able to obtain high amounts of profit, with an almost completely negative correlation with equity markets. Among the high-performers found during this period, trend followers were perhaps the most impressive, with some systems achieving returns of more than 100% of capital within this period, with little drawdown whatsoever. During these years everyone trading algorithms was making a killing. Then, change happened.

 

The answer seems to be simple and at the same time incredibly complex: fundamental influence and uncertainty. Algorithmic trading systems are all designed with the idea that some historical assumption will continue to be true in the future. This assumption can be that price tends to break at a certain hour, that momentum created in one direction leads to continuations, that two instruments are co-integrated, etc. When these assumptions break, the algorithms fail because they have no way to know that under current market conditions their assumptions are no longer valid. This “breaking up” of algorithms means that we usually need to take loses to realize that something has changed – to remove or modify our strategy – and this makes us invariably less reactive than human traders. The strength of algorithmic trading, it’s high capacity to exploit structural characteristics, becomes its weakness when the underlying structure changes.

Filed Under: What's happening in the current markets? Tagged With: algorithmic trading, Barclay's, Daniel Fernandez, drawdown, expert advisor

  • 1
  • 2
  • 3
  • …
  • 5
  • 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.