Algorithmic and Mechanical Forex Strategies | OneStepRemoved

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

Risk Management – Deciding When To Hold, And When To Fold

October 10, 2014 by Eddie Flower 5 Comments

There’s a proverb among old forex traders: If you put two newbies in front of the same trading screen and arm them with the same tools, and if each takes the opposite side of a given trade, both will probably lose money, regardless of the final direction of the price move.

Yet, if you put two highly-experienced traders into positions in opposite directions, very often both of them will win the trade or at least break even, in spite of their contradictory trading positions.

Why?

The difference between rookie traders and pros is risk management. In the trading game, successful risk management is the key to survival. Many beginning traders pay lip service to the idea of managing risk effectively, yet few have the discipline to follow through entirely, even with the power of mechanical trading systems.

Forex risk management

Regardless of the exact forex trading strategy or system, loss-taking is a critical component for long-term success.

Any forex newbie can exit from winning trades, but it takes an experienced trader to slip out of losing trades relatively unscathed. In this article I’ve outlined several perspectives on risk management strategies used by successful forex traders across a wide range of markets.

Forex risk management

Most forex traders have a clear idea of their own investment objectives and tolerance for risk. And, most already know that appropriate risk management is crucial for success in any form of trading.

The best trading risk management means using a standard process to identify and analyze risks, then either accepting, mitigating, or rejecting them. For traders, it comes down to finding and assessing opportunities, then quickly acting on or declining those trades.

Basic risk management is two simple steps – Discovering and determining the risks within an investment, then responding to those risks in the best possible way to meet the investment objectives.

Some risks are considered intrinsic risks, or built into the system, while other types of risks are extrinsic in origin. In any event, forex traders have a variety of tools and metrics for assessing risks and setting parameter values. From that point onward, it’s up to the mechanical trading system to work its magic.

Mechanical risk management

Even when relying on mechanical systems, successful traders must be well disciplined and adhere to carefully-planned forex risk management and trade-exit strategies. That’s because people have a natural emotional aversion to taking trading losses, even when necessary.

Mechanical trading systems can help manage risks by better choosing and executing trades, and constantly monitoring positions. They add a layer of impartiality to lightning-fast analysis and trade execution. Yet, there is always room for human error in system design.

Speed plus reduced human oversight equals an increased possibility of trading loss. Mechanical risk management methods must be carefully vetted and tested before they’re implemented.

Most traders are closely focused on the “front end” of forex trading, that is, how to find a winning trade and enter a position at the right point. Other than basic stop-loss orders, few traders think carefully about how best to exit from the trade.

For the long-term survival of any trading system, whether manual or mechanical, the most important issue is how and when to exit from trades. Although less glamorous than the work of crafting a winning entry strategy, the task of building a successful risk management and exit strategy is crucial for success.

Lose your bad trades as soon as possible

Most traders are already aware of the mathematical difficulty of overcoming losses – As shown in the drawdown in Table 1 below, the more the trading-account equity is drawn down, the higher the percentage of subsequent gains required simply to break-even.

Table 1

Lose 25%, must regain 33% to break even
Lose 50%, must gain 100% to break even
Lose 75%, must gain 400% to break even
Lose 90%, must gain 1000% to break even

For example, after losing 50% of the trading account equity, the eventual winning trades would need to earn 100%, i.e. double the account size, simply to break even. Worse, at a 75% drawdown level, a trader would need to quadruple his or her account equity just to reach its original level.

Obviously, very few traders could achieve such a comeback. It’s far better to manage drawdowns by exiting each trade appropriately. Taking each loss at the optimal time allows the trader to stay in the game as long as possible, even after a long string of losing trades.

The runaway loss

Most traders have heard war stories about a single bad forex trade eating up days, months or even years of profits in one gulp. When a runaway loss occurs, it’s more likely the result of error in human judgment rather than from a glitch in the mechanical trading system.

Usually, catastrophic losses result from poor or non-existent risk management, failure to use “hard” stop-loss orders, and multiple trades in which the losses from the average losers are greater than the gains from the average winners.

A runaway loss shows lack of discipline. Instead of becoming enchanted by the dream of scoring “one big winner,” the more prudent strategy for trader survival is to focus on avoiding big losses.

The Golden Rule of Risk Management: Position risk limit

Ironclad stop-loss orders prevent runaway losses. According to the trader’s appetite for risk, the mechanical trading system can set risk limits according to account equity, position size and other parameters, as described later in this article.

Many forex traders advocate a “Golden Rule” of risk management based on position size or position risk limit. They recommend the at-risk account equity should never be more than 1% (conservative) or 2% (liberal) on any single trade position.

From a psychological standpoint, the trader can be indifferent to the outcome of any particular trade when only one or two percent of the account equity is at stake.

And, from a mathematical perspective, it’s important to point out that by risking only 1% to 2% per trade the system can lose repeatedly without approaching the drawdown levels shown in Table 1 above.

Regardless of the mechanical forex system being used, the trader should use only speculative capital. When asked by newbie traders how much money they should use to trade a given system, one well-experienced trader recommends choosing a funding amount which if entirely lost wouldn’t affect the newbie’s sleep at night.

Risk management styles

There are two general styles of successful risk management. Some managers refer to these opposite styles as either the “home run” approach or the “singles and doubles” approach.

On the one hand, a forex trader may choose to take frequent small losses and break-evens while working to harvest all profits from the relatively few big winning trades. Or, a trader may decide to seek many little gains and use infrequent but relatively large stop-losses with a system designed to accumulate the small profits and outweigh the losses.

The trading psychology is more important than the mechanical trading strategy itself. Taking many small losses tends to cause numerous painful twinges, interspersed with occasional moments of pure ecstasy.

In contrast, the “singles and doubles” risk management style offers plenty of minor joys, punctuated by some nasty psychological blows.

The best choice of trading style largely depends on the trader’s personality. A new trader will usually quickly discover which general style best fits his or her personality.

One of the major benefits of forex trading as compared with stock trading is that the forex marketplace easily accommodates both types of trading styles, using many different trading systems.

Since currency pairs trading is a spread-based marketplace, traders shouldn’t be too constrained by the number of round-trip transactions required by any given strategy.

For example, in the EUR-USD market, traders might find a 3-pip spread that’s the same as the cost of three one-hundredths (3/100) of one percent (1%) of an underlying position. This cost is generally uniform, in terms of percentage, regardless of whether the trader is dealing with one-million-unit lots or 100-unit lots of the same currency.

So, if a given trading strategy required 10,000-unit lots, the amount of the spread would be $3, yet for that same trade executed only using 100-unit lots, the spread would be a tiny $0.03.

This is in sharp contrast to the stock market, where the commission on 1000 shares or 100 shares of a stock valued at, say, $20 might be fixed at a total commission of $40.

That means the effective commission cost for the stock-market transaction might range between 0.2% to 2%, thus affecting the trader’s choice of risk management style.

Variability in commission percentages makes it difficult for small traders in the stock markets to scale into their positions because of these skewed commission costs. Yet, forex traders benefit from uniform pricing, so they can use either risk management style.

This freedom of risk management style has drawn many independent traders away from equity markets to forex markets.

4 basic types of stops

Another foundational choice to be made by forex traders based on personality and trading strategy is the type of stop to be used for risk management. There are four basic types of stops:

Equity stop

An equity stop is the simplest type of stop for mechanical trading systems. For any given trade entry, the system calculates a fixed percentage of the account equity, usually between 1% and 2%, as outlined earlier in this article.

For example, for a $10,000 forex account, the trader’s system could risk up to $200, or up to 200 points, on a single mini lot (of 10,000 units) of the EUR-USD currency pair, or up to 20 points on the standard lot with 100,000 units.

Aggressive traders sometimes consider 5% equity stops, that is, a position risk size of not more than 5% of the account equity. This limit is often considered the upper limit for prudent risk management.

Recalling the equity drawdown shown in Table 1 above, it can be seen that with a 5% equity stop 10 consecutive losing trades will cause a 50% drawdown in the trading account.

Also, it should be said that the biggest drawback of using an equity stop is it enforces an arbitrary exit point based on risk management alone, instead of exiting the market as a logical response to price movements.

Still, mechanical trading systems can thrive by using equity stops, especially when combined with other indicators to confirm trading signals.

Chart stop

Mechanical trading systems and expert advisors (EA) use a myriad of technical indicators to generate hundreds or thousands of potential stop levels. The best risk management methods combine the features of both equity stops and technical indicators to calculate chart stops.

One typical example of the chart stop is a swing high/swing low level. In the chart below, a $10,000 trading account with a mechanical system using a chart stop might sell one lot and risk 150 points, about 1.5% of the account’s equity.

swing high low eurusd

Volatility stop

Mechanical trading systems often rely on more sophisticated logarithms to calculate risk parameters based on volatility instead of price movements alone. In any high-volatility marketplace, where prices show wide ranges, the trading system must adapt to the ambient volatility.

This helps the trader avoid being stopped out prematurely by market “noise.” And, the same holds true in low-volatility markets, where the system should constrict the risk parameters in order to avoid giving back profits before successfully exiting from positions.

One of the easiest ways to monitor volatility is by using Bollinger Bands, which rely on standard deviation calculations to measure variations in price. The two charts below illustrate high volatility and low volatility stop levels by using Bollinger Bands.

Bollinger band stops

Low volatility bollinger band stop

As seen in the first chart, a volatility stop lets the trading system employ a scale-in method in order to achieve better overall blended pricing and a quicker break-even level.

Of course, since total position risk shouldn’t be more than 2% of the equity in the trading account, the system choose smaller lot sizes to best fit the total position risk.

Margin stop

A margin stop is a form of risk management used by some cautious traders to reduce the risk and psychological pressure when beginning to trade an entire account by using a single new strategy or system. If used carefully, it can be effective in most markets.

Since forex markets operate twenty-four hours per day, it means that forex dealers could liquidate traders’ positions fairly quickly in case of margin calls. For this reason, forex customers are rarely in danger of generating a negative balance in their account, since computers automatically close out all positions.

The margin-stop risk management strategy is based on the trader’s total capital being divided into various allotments for each of one or more new or different trading strategies and systems.

For example, assume the trader is investing a total of $10,000 into forex trading, and he or she wishes to focus individually on trying 5 different trading systems and strategies in order to determine objectively which is the best “fit” for the trader.

So, the trader will open the forex account by wiring only $2000 from his or her bank account, assuming that each of the 5 receives the same funding proportion. If a forex broker offers leverage of 100-to-1, the $2000 deposit might allow the trading system to control two standard 100,000-unit lots.

Even better, depending on the trader’s risk tolerance and management, the system may trade using a 50,000-unit lot position. That might allow room for as much as 100 points.

As successive strategies are funded and launched exclusively, it’s easier to account for wins and losses due to individual approaches. It allows developers to refine their systems. And, traders enjoy more peace of mind by knowing that an unforeseen “blowup” won’t terminate their trading.

In any event, the primary purpose of the margin stop is to prevent a runaway loss from occurring during the launch of a new strategy or trading system. It also helps enforce discipline in risk and money management.

Know when to hold and when to fold

In conclusion, it can be said that trading success is based on surviving losing trades long enough to finally develop a consistently-winning system. Each forex trader should carefully consider his or her risk tolerance, and craft a risk management strategy to fit.

Mechanical trading systems make it easy to find good entry points, yet it’s just as important to have a sold risk management strategy, plus the tools to determine an exit point immediately after entering any position.

After all, taking the right loss at the right time is a necessary part of the game.

What are your thoughts about losses?

Filed Under: How does the forex market work?, Stop losing money, Trading strategy ideas Tagged With: forex, risk management, volatility

Comprehensive Guide to the Turtle Trading Strategy

March 31, 2014 by Eddie Flower 16 Comments

Turtle trading is the name given to a family of trend-following strategies. It’s based on simple mechanical rules to enter trades when prices break out of short-term channels. The goal is to ride long-term trends from the beginning.

Turtle trading was born from an experiment in the 1980s by two pioneering futures traders who were debating whether good traders were born with innate talent, or whether anyone could be trained to trade successfully. The turtles developed a simple, winning mechanical trading system that could be used by any disciplined trader, regardless of previous experience.

The “turtle trading” name has been attributed to several possible origins. For me, it epitomizes the “slow but sure” results from this system. In contrast to complex black box systems, turtle trading rules are simple and easy enough for you to build your own system — I highly recommend it.

The earliest forms of turtle trading were manual. And, they required laborious calculations of moving averages and risk limits. Yet, today’s mechanical traders can use algorithms based on turtle parameters to guide them to successful trading. As always, the key to trading success lies in consistent discipline.

Which markets are best for turtle trading?

Your first decision is which markets to trade. Turtle trading is based on spotting and jumping aboard at the start of long-term trends in highly-liquid markets, usually futures. Since long-term trend changes are rare, you’ll need to choose liquid markets where you can find enough trading opportunities.

turtle trading strategy

My favorites are on the CME:  For Agriculturals, I like Corn, Soybeans, and Soft Red Winter Wheat. The best equities indexes are E-mini S&P 500, E-mini NASDAQ100, and the E-mini Dow. In the Energy group, I like E-mini Crude (CL), E-mini natgas and Heating Oil.

And, in Forex, it’s AUD/USD, CAD/USD, EUR/USD, GPB/USD, and JPY/USD. From the Interest Rate group of derivatives, I like Eurodollar, T-Bonds, and the 5-Year Treasury Note. Finally, in Metals the best candidates are always Gold, Silver and Copper.

Since turtle trading is a long-term undertaking with a limited number of successful entry signals, you should pick a fairly broad group of futures. Those above are my favorites, although others will work as well if they’re highly liquid. For example, in the past I’ve traded Euro-Stoxx 50 futures with excellent results.

Also, I only trade the nearest-month contracts, unless they’re within a few weeks of expiration. Above all, it’s critically important to be consistent. I always watch and trade the same futures.

Position size

With turtle trading, you’ll strike out many times for each home run you hit. That is, you’ll receive many signals to enter trades from which you’ll be quickly stopped out. However, on those few occasions when you’re right, you’ll be entering a winning trade at precisely the right moment – the beginning of a long-term change in trend.

So, for risk management your survival depends on choosing the right position size. You’ll need to program your mechanical trading system to make sure you don’t run out of money on stop-outs before hitting a home run.

Constant-percentage risk based on volatility

The key in turtle trading is to use a volatility-based risk position which remains constant. Program your position-size algorithm so that it will smooth out the dollar volatility by adjusting the size of your position according to the dollar value of each respective type of contract.

This works very well. The turtle trader enters positions which consist of either fewer, more-costly contracts, or else more, less-costly contracts, regardless of the underlying volatility in a particular market.

For example, when turtle trading a mini contract requiring, say, $3000 in margin, I buy/sell only one such contract, whereas when I enter a position with futures contracts requiring $1500 in margin, I buy/sell 2 contracts.

This method ensures that trades in different markets have similar chances for a particular dollar loss or gain. Even when the volatility in a given market is lower, through successful turtle trading in that market you’ll still win big because you’re holding more contracts of that less-volatile future.

How to calculate and capitalize on volatility – The concept of “N”

The early turtles used the letter N to designate a market’s underlying volatility. N is calculated as the exponential moving 20-day True Range (TR).

Described simply, N is the average single-day price movement in a particular market, including opening gaps. N is stated in the same units as the futures contract.

You should program your turtle trading system to calculate true range like this:

True Range = The greater of: Today’s high minus today’s low, or today’s high minus the previous day’s close, or the previous day’s close minus today’s low. In shorthand:

TR = (Maximum of) TH – TL; or TH – PDC; or PDC – TL

Daily N is calculated as: [(19 x PDN) + TR]  / 20 (Where PDN is the previous day’s N and TR is the current day’s True Range.)

Since the formula needs a previous day’s value for N, you’ll start with the first calculation just being a simple 20-day average.

Limiting risk by adjusting for volatility

To determine the size of the position, program your turtle trading system to calculate the dollar volatility of the underlying market in terms of its N value. It’s easy:

Dollar volatility = [Dollars per point of contract value] x N

During times when I feel “normal” risk-aversion, I set 1 N as equal to 1% of my account equity. And, during times when I feel more risk-averse than normal, or when my account is more drawn-down than normal, I set 1 N as equal to 0.5% of my account equity.

The units for position size in a given market are calculated as follows:

1 unit = 1% of account equity / Market’s dollar volatility

Which is the same as:

1 unit = 1% of account equity / ([Dollars per point of contract value] x N)

Here’s an example for Heating Oil (HO):

Day    High             Low              Close TR                N

1        3.7220          3.7124          3.7124          0.0096          0.0134

2        3.7170          3.7073          3.7073          0.0097          0.0132

3        3.7099          3.6923          3.6923          0.0176          0.0134

4        3.6930          3.6800          3.6838          0.0130          0.0134

5        3.6960          3.6736          3.6736          0.0224          0.0139

6        3.6820          3.6706          3.6706          0.0114          0.0137

7        3.6820          3.6710          3.6710          0.0114          0.0136

8        3.6795          3.6720          3.6744          0.0085          0.0134

9        3.6760          3.6550          3.6616          0.0210          0.0138

10      3.6650          3.6585          3.6627          0.0065          0.0134

11      3.6701          3.6620          3.6701          0.0081          0.0131

12      3.6965          3.6750          3.6965          0.0264          0.0138

13      3.7065          3.6944          3.6944          0.0121          0.0137

14      3.7115          3.6944          3.7087          0.0171          0.0139

15      3.7168          3.7100          3.7124          0.0081          0.0136

16      3.7265          3.7120          3.7265          0.0145          0.0136

17      3.7265          3.7098          3.7098          0.0167          0.0138

18      3.7184          3.7110          3.7184          0.0086          0.0135

19      3.7280          3.7200          3.7228          0.0096          0.0133

20      3.7375          3.7227          3.7359          0.0148          0.0134

21      3.7447          3.7310          3.7389          0.0137          0.0134

22      3.7420          3.7140          3.7162          0.0280          0.0141

For HO the dollars-per-point is $42,000 because the contract size is 42,000 gallons and the contract is quoted in dollars.

Assuming a turtle trading account size of $1 million, the unit size for the next trading day (Day 23 in the above series) as calculated using the value of N = .0141 for Day 22 is:

Unit size = [.001 x $1 million] / [.0141 x 42,000] = 16.80

Because partial contracts can’t be traded, in this example the position size is rounded downward to 16 contracts. You can program your algorithms to perform N-size and unit calculations weekly or even daily.

Position sizing helps you build positions with constant volatility risk across all the markets you trade. It’s important to turtle-trade using the largest account possible, even when you’re trading only minis.

You must ensure that the fractions of position size will allow you to trade at least one contract in each market. Small accounts will fall prey to granularity.

The beauty of turtle trading is that N serves to manage your position size as well as position risk and total portfolio risk.

The risk-management rules of turtle trading dictate that you must program your mechanical trading system to limit exposure in any single market to 4 units, your exposure in correlated markets to a total of 8 units, and your total “direction exposure” (i.e. long or short) in all markets to a maximum total of 12 units in each direction.

Entry timing when turtle trading

The N calculations above give you the appropriate position size. And, a mechanical turtle trading system will generate clear signals, so automated entries are easy.

You’ll enter your chosen markets when prices break out from Donchian channels. Breakouts are signaled when the price moves beyond the high or low of the previous 20-day period.

In spite of the round-the-clock availability of e-mini trading, I only enter during the daytime trading session. If there’s a price gap on open, I enter the trade if the price is moving in my target direction on open.

I enter the trade when the price moves one tick past the high or low of the previous 20 days.

However, here’s an important caveat: If the last breakout, whether long or short, would have resulted in a winning trade, I do not enter the current trade.

It doesn’t matter whether that last breakout wasn’t traded because it was skipped for any reason, or whether that last breakout was actually traded and was a loser.

And, if traded, I consider a breakout a loser if the price after the breakout subsequently moves 2N against me before a profitable exit at a minimum 10 days, as described below.

To repeat:  I only enter trades after a previous losing breakout. As a fallback to avoid missing out on major market moves, I can the trade at the end of a 55-day “failsafe breakout” period.

By adhering to this caveat, you will greatly increase your chance of being in the market at the beginning of a long-term move. That’s because the previous direction of the move has been proven false by that (hypothetical) losing trade.

Some turtle traders use an alternative method which involves taking all breakout trades even if the previous breakout trade lost or would have lost. But, for turtle trading personal accounts I have found that my drawdowns are less when adhering to the rule of only trading if the previous breakout trade was or would have been a loser.

Order size

When I receive an entry signal from a breakout, my mechanical trading system automatically enters with an order size of 1 unit. The only exception is when, as mentioned above, I’m in a period of deeper-than-usual drawdown. In that case, I enter ½ unit size.

Next, if the price continues in the hoped-for direction, my system automatically adds to the position in increments of 1 unit at each additional ½ N price movement while the price continues in the desired direction.

The mechanical trading system keeps adding to my holding until the position limit is reached, say at 4N as discussed earlier. I prefer limit orders, although you can also program the system to favor market orders if you wish.

Here’s an example entry into Gold (GC) futures:

N = 12.50, and the long breakout is at $1310

I buy the first unit at 1310. I buy the second unit at the price [1310 + (½ x 12.50) = 1316.25] rounded to 1316.30.

Then, if the price move continues, I buy the third unit at [1316.30 + (½ x 12.50 = 1322.55] rounded to 1322.60.

Finally, if gold keeps advancing I buy the fourth, last unit at [1322.60 + (½ x 12.50) = 1328.85] rounded to 1328.90.

In this example the price progress continues in such a short time period that the N value hasn’t changed. In any event, it’s easy to program your mechanical trading system to keep track of everything on-the-fly, including changes in N, position sizes, and entry points.

Turtle trading stops

Turtle trading involves taking numerous small losses while waiting to catch the occasional long-term changes in trend which are big winners. Preserving equity is critically important.

My automatic turtle trading system helps my confidence and discipline by removing the emotional component of trading, so I’m automatically entered in the winners.

Stops are based on N values, and no single trade represents more than 2% risk to my account. The stops are set at 2N since each N of price movement equals 1% of my account equity.

So, for long positions I set the stop-loss at 2N below my actual entry point (order fill price), and for short positions the stop is at 2N above my entry point.

To balance the risk when I add additional units to a position which has been moving in the desired direction, I raise the stops for the previous entries by ½ N.

This usually means that I will place all my stops for the total position at 2 N from the unit which I added most recently. Yet, in case of gaps-on-open, or fast-moving markets, the stops will be different.

The advantages of using N-based stops are obvious – The stops are based on market volatility, which balances the risk across all my entry points.

Exiting a trade

Since turtle trading means I must suffer many small “strike-outs” to enjoy relatively few “home-runs,” I’m careful not to exit winning trades too early.

My mechanical trading system is programmed to exit at a 10-day low on my long entries, and at a 10-day high for short positions. If the 10-day threshold is breached, my system exits from the entire position.

The mechanical trading system helps overcome my greed and emotional tendency to close out a profitable trade too early. I exit using standard stop orders, and I don’t play any “wait and see” games…. I let my mechanical trading system make those decisions for me.

It can be gut-wrenching to watch my account fatten dramatically during a major market move with a winning trade, then give back significant “paper gains” before I’m stopped out. Still, my pet mechanical trading system works very well.

Turtle trading algorithms offer a quick way to build your own do-it-yourself mechanical trading system which is simple, easy-to-understand and effective.

If you have the discipline to keep your hands off and let your mechanical trading system do its job, turtle trading may be your best choice.

After all, turtles are slow, but they usually win the race……

 

 

Filed Under: How does the forex market work?, Stop losing money, Trading strategy ideas Tagged With: forex, mechanical trading systems, risk management, Turtle 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 To Create A Winning Trading System

March 11, 2014 by Eddie Flower 2 Comments

Many traders are attracted to forex because of the opportunities for fat gains, especially when compared with stocks. Yet, when trading forex the inherent leverage can affect traders’ emotions, leading to over-trading, loss-chasing and second-guessing. A mechanical trading system can provide the winning solution.

Why build a trading system?

Manual trading works well for many stock traders, especially those using buy-and-hold strategies for a limited number of favorite picks, yet forex traders need better tools and stronger discipline in order to be profitable.

In any industry, a well-built machine is more efficient than any human

A well-built mechanical trading system offers a trader the best of both worlds: technology and math give the trader the ability to spot and take advantage of market inefficiencies and harvest gains in a busy, cluttered environment, while freeing him or her from the emotional roller-coaster ride of trading.

Find your own niche

There are plenty of trading systems available nowadays; the key to forex trading success lies in finding or adapting the “right” system for your own needs and style. Once you’ve decided the parameters for success, including your overall goals and objectives for trading, personal tolerance for risk, and the amount of capital to be devoted to trading, a system can be built to fit you like a glove.

When building a system, there’s plenty of room for specialization and individualization – If everyone were trading the same way, spreads would soon disappear. Like fast-moving mosquitoes buzzing around a lumbering elephant, many traders earn an excellent living by capitalizing on opportunities inevitably created by the movements of much-larger players in the marketplace; the key is to gather an actionable set of patterns and indicators that fits your personal style.

If a pattern is noticeable, then it’s probably actionable

The first step is to search through past trading data in order to identify patterns and conditions which appear to consistently offer profitable trading opportunities. Historical price and volume charts often show patterns which appear to signal upcoming price moves, and technical indicators will help clarify an otherwise-fuzzy picture.

Try looking at different combinations of indicators over different historical time periods to see if they may give predictive power in spotting market turns or changes in trend. A “caveman-style” approach to quickly testing your hunches can be as simple as finding a noticeable pattern on a printed chart, then holding a sheet of paper over the upcoming section and “guessing” what will happen next; when you’re right, you may have found a winning pattern.

Testing & optimization

Once you’ve identified a fairly-predictable pattern by looking at charts, it’s time to think about how to trade it profitably. You should consider how it fits with your personal trading style, including risk management. The patterns and indicators upon which your system is based can be simple or complex, as long as they work in the marketplace and fit your circumstances.

How to create a winning trading system

The next step is to translate these patterns and scenarios into mathematical coding, to form a set of trading rules which can be fully tested. You can do this yourself, or you can rely on the services of a coding expert to help accomplish this. After you’ve created the foundation for a system, it can be tested objectively by changing the inputs to find the optimal conditions for trading, such as the best combinations of currency pairs, stops, and other variables.

You can use software to quickly test multiple combinations of indicators. The key is to identify predictable patterns which will give you the confidence to trade when you see them appear, whether long or short, then fine-tune them to maximize your gains. It’s important to realize that more complexity isn’t necessarily better – A super-complex system probably won’t fatten your wallet if it only signals a trade once every ten years and your computer happens to be offline when that finally occurs.

Don’t become married to your system

Most importantly, if your indicators aren’t working out during testing as you had hoped, don’t become emotionally invested in “proving” that they work. Instead, step back and take a broader look – Perhaps it’s time to use a different combination of indicators, or change your approach altogether.

During testing and optimization, it’s important to leave untouched some of your historical market data as untested “out-of-sample” data while you work through testing your system using in-sample data. For statistical purposes during testing, you can only use data once before modifying your system; then of course it becomes part of your in-sample data. If you contaminate your test data, that is, if you rely on a certain date range of data to first develop and test your system, then later re-test your modified system with the same data, the results may be skewed. So, use your out-of-sample data only for final testing and tweaking after you’ve built your system, so you can be sure that such data is “pure” and not already accounted for in the system.

Be sure to back-test any prospective new system over reasonably long periods, so you’ll have an idea how it performs long-term. And, check the results when using different lengths for your moving averages. Also, it’s worthwhile to test your system widely across different forex pairs, even those you don’t typically trade – You may be surprised to find that your system does especially well in a market that you haven’t tried before.

Implementation

Even though testing and minor tweaking should be thought of as an evolutionary process that continues during the life of your trading, at this point you’re ready to implement your system by using it to trade with real money. If you’ve done your homework well, and you stick to the rules that your testing has proved will work under specific conditions, then you’ll be confident in proceeding forward.

Stick to the proven rules and you’ll be successful

Societies rely on laws to govern the behavior of their citizens because they’ve learned over time (tested and optimized) what works. Likewise, in order to be successful with forex you should adhere to the consistent trading rules that you’ve established in a scientific manner. If you stick to the rules, your mechanical trading system can help you win the forex game.

Filed Under: How does the forex market work?, MetaTrader Tips, Test your concepts historically Tagged With: indicator, leverage, mechanical, out-of-sample, risk management

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

How Concentration Risk Can Affect System Design

October 13, 2013 by Andrew Selby 2 Comments

In a post titled Better Beta Is No Monkey Business that was published on The AllianceBernstein Blog on Investing, author Patrick Rudden took a different approach to looking at blindfolded monkeys throwing darts. The blindfolded monkey concept was popularized in Burton Malkiel’s book, A Random Walk Down Wall Street.

In his book, Malkiel suggests that a group of randomly selected, blindfolded monkeys could throw darts at a newspaper’s financial section and end up with a portfolio that outperforms a portfolio selected by a group of experts. Rudden builds his piece on previous research that suggests that the monkeys would be likely to outperform the experts because they would be biased towards selecting smaller cap stocks.

Rudden argues that:

Leaving monkeys (blindfolded or not) aside, the research conclusion is an important one. What it shows is the limitation of cap-weighted indices where the size of a constituent is a function of share price. Such indices by construction put more emphasis on stocks with high prices and less emphasis on stocks with low prices. They will favor components whose prices have risen the most.

He illustrates past examples of concentration risk:

This concentration risk is often unintended. And it creates risks that can be bad for your wealth when investors stampede out of crowded positions, causing violent market swings. As my colleague, Dave Barnard, points out in a recent paper,2 the technology sector ballooned to more than 29% of the S&P 500 in 2000 (Display). Over the next two years, the sector lost more than half its value. Similarly, Japanese stocks lost about a third of their value in the two years after their weight in the MSCI World Index peaked at 44% in late 1989. Similar trends played out in the energy sector in 1980 and in financials in 2007, at the peak of the credit bubble.

concentration risk

Concentration Risk can be lurking beneath your trading system without you even knowing it.

He continues by explaining that while cap-weighted index fund may have some benefits, there is likely more to be gained from a different approach:

But we believe that any approach which loosens the connection between weight and price is likely to have a performance edge. For example, investors could permit some increase in tracking error or create smarter-beta benchmarks based on equal-, value- or risk-weighted components, and with explicit mechanisms designed to avoid concentration risk. These solutions might be slightly more expensive than a typical passive index, but we think it’s a price worth paying to avoid the risks of a pure, cap-weighted approach. And it’s probably a better idea than giving a monkey some darts and a copy of the FT.

Like most forms of risk and biases, our goal as systematic traders is not to completely avoid them, but to simply be aware of them. Understanding concentration risks can have a major impact on basic trading system design.

Filed Under: Trading strategy ideas Tagged With: concentration risk, random walk, risk management, system design

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.