Algorithmic and Mechanical Forex Strategies | OneStepRemoved

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

Trading with the Commodity Channel Index

September 14, 2016 by Lior Alkalay 4 Comments

When trading, one of the most important pieces of information to have is the ability to identify momentum—when it begins and when it ends. It can help you plan your next trade and to ensure that that trade is successful. It is in the process of charting momentum that the Commodity Channel Index is especially effective, and that is regardless whether you are trading commodities, stocks or Forex.

The rationale behind the Commodity Channel Index or CCI is that it is an oscillator that measures the deviation from the simple moving average over the period. Just like most oscillators, it has an overbought level and an oversold.

In theory, using the CCI is similar to reading a Relative Strength Indicator (RSI). If the CCI is relatively high then the pair is overbought and when it is relatively low, the pair is oversold. In practice, however, using the CCI is a bit more complicated than the RSI. Unless the CCI is calibrated correctly it is practically worthless in identifying momentum cycles. Moreover, without correct calibration, it can generate plenty of false signals. But if you calibrated the CCI well it is an extremely efficient and powerful tool.

Commodity Channel Index: Calibration

The first step in calibrating the CCI is to identify when the current cycle began. This will help us decide the right period in which to run the CCI. In order to identify the beginning of the current cycle we can use Fibonacci Time Zones, which will give us an accurate measure.

For example, when we look at the Fibonacci Time Zones in the weekly chart below, we can conclude that the current cycle started 36 weeks ago. The rule of thumb is to divide the total period by three to give the average a bit more sensitivity. In the example below, it will be 36/3=12 weeks. That is the average the CCI should run on.

The reason we use Fibonacci Time Zones to calibrate the CCI is because the cycle’s length changes from wave to wave as they become longer and consequently the relevant average changes. Through the Fibonacci Time Zones, we can estimate with some degree of confidence when the cycle started.

Commodity Channel Index

Analysing the CCI

Once the CCI is calibrated, the rest is simple. The CCI, as previously mentioned, measures overbought and oversold levels. But rather than just looking at relative highs of the index we need to look at its behavior.

For example, in the Gold chart below, we can see that the CCI is converging with the price movement. That is a clear sign that bullish momentum is fading. If we take it a step further and continue our trend line all the way to the bottom, we can conclude another thing; that is that the pair, in this case XAU/USD, has already peaked and is heading lower in a bearish momentum.

Commodity Channel Index

Another way to chart the momentum is by examining the CCI behavior between the Fibonacci Time Zones. Notice that the CCI has a tendency to bottom out when the cycle ends and then rise. We can use that to ride on a rebound. There are cases, especially on a long term bullish trend, that we can get the exact opposite effect, i.e., the CCI peaks every time a Fibonacci Time Zone ends. The idea is to observe the pattern and then use it to your advantage.

Of course, as I’ve said in the past, oscillators should always be used alongside other indicators to get the full picture, and the Commodity Price Channel is no different. As usual in trading, there are no guarantees, but certainly the well calibrated CCI can provide a very coherent picture of where a pair’s momentum is headed, north or south.

Filed Under: Trading strategy ideas Tagged With: CCI, Fibonacci, gold, indicator

What’s the Story on Lagging Indicators?

January 14, 2015 by Richard Krivo 7 Comments

Lagging Indicator

A  question that I get asked quite a bit has to do with “lagging indicators”.  Many traders will deride them and are hesitant to use them since they lag the market to a greater or lesser degree.  Their argument is that many pips can be left behind since the initial part of the move has occurred before the entry signal is generated.

While that is an accurate statement, let’s take a look at what comprises the signal that an indicator generates.  Regardless of which indicator a trader uses, RSI, MACD, Stochastics, CCI, etc., each indicator is based on an average of the price action that has already taken place.  With that being the case, it is impossible for an indicator to provide split second, turn on a dime signals based on an immediate move that a currency pair has made.

And, believe it or not, I believe that is a very good thing.

While no one likes to leave “pips on the table” so to speak, think of it this way…

What you are forgoing by missing the initial move, you make up for by entering a trade that has a greater amount of confirmation behind it.  If we are looking to enter a trade at the very first sign that a move may be taking place, we are going to find ourselves entering trades based on very short term signals – i.e., little or no confirmation.  Consequently, we will be basing our trades on what ultimately can turn out to be a “false entry” signal.

People will rarely (if ever) buy a house based solely on what it looks like from the curb…or buy a car only because the driver’s seat feels comfortable…or propose marriage to someone during a first date.  We want and deserve some confirmation that there is more to the house than only curb appeal…more to the car than just a comfy seat…and more to our partner than what we learned over a few hours.

So too, we should not jump headlong into a trade based on virtually zero confirmation.

Let’s take a look at a historical Daily chart of the EURCHF currency pair below…

Lagging Chart

If we enter this trade at the point where the MACD line (red) crosses the Signal line (blue), we forgo the profit between point A and point B on the chart – approximately 280 pips.  This is due to the “lag” of the MACD indicator as it is calculating the price action that has taken place over the last several days.  Had we entered the trade short as soon as price began to move down from the high, we would have entered on a bearish move but with virtually no confirmation – we would have bought the house without stepping inside.

However, if we wait for the signal to enter this trade until the move is confirmed by MACD, we set ourselves up for a higher probability trade based on our lagging indicator.

Could this trade turned out to be a loser even with the confirming signal?  Sure…no doubt about it.  But the point is that by waiting we are putting probabilities more on our side – we have more of an “edge” on the trade.

In the case of this particular trade, we ultimately book the profit between point B and point C which is just shy of 1000 pips.

As can be seen from this example, it is possible to have a highly successful trade even though a trader is not capturing the initial pips in a move.

All things considered, I would rather enter a trade late and be right than enter early and be wrong.

 

All the best and good trading,

Richard

 

RKrivoFX@gmail.com

@RKrivoFX

Filed Under: Trading strategy ideas Tagged With: CCI, indicator, lagging, MACD, RSI, Stochastics

Fractals in Forex Trading

May 6, 2014 by Eddie Flower 2 Comments

Fractals indicate natural resistance and support levels, which helps to identify good entry points and locate stop-loss points. Most importantly, fractals help me identify trends and ranges.

Fractals can be used effectively in forex trading, especially with the power of a mechanical trading system. Focusing on the EUR/USD and GBP/USD currency pairs gives the best results.

A fractal is a repetitive natural pattern

A fractal is a geometric shape or set of self-similar mathematical patterns found in nature. When broken into smaller pieces, fractal shapes exhibit the same shape or characteristics of the larger object.

In nature, fractal shapes and patterns may be observed in things such as broccoli and many other types of plants, where the smallest florets still have the same overall shape as the largest “head” of broccoli. Likewise, many mineral and crystal forms exhibit similar patterns on both large and small scales.

Price movements in marketplaces are often thought to be random and chaotic. Yet, as with other seemingly-random forms found in nature, fractal patterns can be observed in price charts of forex pairs and other assets. Forex price movements show certain repetitive fractal patterns which can be profitably traded.

Fractals used in forex trading may show the same form at every size scale, or they may show nearly the same form at different scales. Stated simply, in forex trading a fractal is a detailed, self-similar pattern that repeats itself, often many times over.

It’s important to note that these fractal patterns aren’t the regular, geometrically-square figures found in man-made structures; they don’t have sides with even-integer factors. The distinguishing characteristic of fractals in forex trading and elsewhere is their natural organic scaling when contrasted with ordinary geometric figures.

For example, doubling the length of one side of an ordinary geometric square will scale the area of that figure by four, since the square has 2 sides, and 22 equals four. Or, when a geometric sphere’s radius is doubled, the volume scales to eight, because the sphere has three dimensions, and 23 = 8.

In contrast, when the one-dimensional lengths of a fractal are doubled, the space contained within that fractal scales up by a number that is not a whole integer.

Leaving aside the mathematical and technical description of fractals — In essence, I use them in forex trading so that my mechanical trading system can break down larger “cluttered” price movements into very simple and highly predictable views of trends and reversals.

Once these trends are visible, it’s easy for my automated trading system to take advantage of them. In particular, I’ve found that fractal signals based on smoothed moving averages (SMMAs) are very valuable for trading when I use them together with momentum indicators.

How do fractals help with forex trading?

Fractals predict reversals in current trends. When viewed as a set of price bars on a chart, the most basic fractal pattern contains five bars or candlesticks with these characteristics:

1. When the lowest bar is positioned at the middle of a pattern, and two bars that have successively higher lows are located on each side of it, this signals the change from a downward trend to an upward trend;

2. When the highest bar is positioned at the middle of a pattern, and two bars that have successively lower highs are located on each side of it, this signals the change from an upward trend to a downward trend;

Bullish and bearish fractals

Stated differently, when the forex fractal pattern shows the highest high at the center, and there are 2 lower highs positioned at each side, it signals a bearish turning point. And, when the pattern has the lowest low at the center, and there are 2 higher lows positioned at each side, it signals a bullish turning point.

Fractals are lagging indicators, so a mechanical trading system can’t act on them until they’re a couple of bars into the reversal. Still, since most of the significant reversals last for multiple bars, the trend usually continues long enough for me to trade it.

Fractals work best for forex trading when used together with a momentum indicator. Along with fractal indicators, I also use an oscillator such as the CCI indicator to facilitate entering a forex trading position as early and safely as I can.

Fractal Alligator indicators

My favorite fractal tool is the “Alligator indicator,” which is a moving-average tool that relies on fractal geometry and SMMAs. This indicator with a fancy name was introduced by senior trader Bill Williams around 1995, and it’s commonly available in MetaTrader software.

If you’re using MetaTrader, you should be able to easily add this fractal indicator by clicking on the menu tabs “Insert,” then “Indicators,” “Bill Williams,” and “Fractals.”

Alligator indicator lines confirm the direction and presence of a trend. Specifically, the Alligator indicator consists of 3 smoothed moving averages. Overlaid on pricing charts, these balance lines represent the metaphorical “jaw,” “teeth” and “lips” of the Alligator.

Carrying the metaphor further, it can be said that when the 3 balance lines are intertwined or converged, the Alligator is asleep with its mouth is closed. This indicates that particular forex market is trading in a sideways range.

Once a trend forms, the Alligator awakens and it begins to “eat.” The Alligator isn’t a picky eater; it can feast on either a bull or a bear. Once satisfied, the Alligator’s mouth closes and the creature returns to sleep.

The Alligator fractal indicator shows trends in the following way: When the price is trading above the mouth of the Alligator, i.e. the green balance line is over the red line which is over the blue line, and all three are aligned and pointing upward, yet still below the price line, this indicator signals a clear uptrend.

Conversely, when the price moves below the Alligator’s mouth, and the blue line is over the red line which is over the green one, and all three of the balance lines are above the price line, then the indicator signals a downtrend.

Finally, once the fractal forex trading Alligator has sated itself, the green, red and blue balance lines once again converge and cross over, signaling the end of the trend. At that point, my mechanical trading system takes profits, and then begins to watch for the next fractal forex trading opportunity.

In short, my mechanical trading system filters fractal signals by stating that the buy rules are confirmed only if they signal a value below the “alligator’s teeth” in the pattern, which means the center average.

Likewise, my sell rules are only confirmed if they signal above the alligator’s teeth. As well, I double-confirm the validity of Alligator signals by using the CCI oscillator.

Fractal forex GBPUSD

The fractal Alligator formula

The Alligator’s jaw, often depicted as a blue line, shows a Smoothed Moving Average containing 13 periods; this line is then moved 8 bars into the future;

The teeth, depicted with a red line, shows a Smoothed Moving Average containing 8 periods, moved 5 bars into the future;

The lips, depicted as a green line, shows a Smoothed Moving Average containing 5 periods, moved 3 bars into the future.

To reiterate, when the red and green balance lines cross over the blue line, it signals my mechanical trading system to “sell.” Conversely, when the red and green lines cross under the blue line, it signals a “buy.”

For purposes of programming a mechanical trading system for fractal forex trading:

  • n is the number of periods
  • High(n) is the highest price during period n
  • Low(n) is the lowest price during period n
  • SMMA(ABC) is a Smoothed Moving Average in which A is the data being smoothed, B is the period being smoothed, and C is the shift in time-period

The mechanical trading system calculates the balance lines:

  • [Low(n) + High(n)] / 2
  • SMMA (Median price n, 13, 8) = Alligator jaw (the blue line)
  • SMM (Median price n, 8, 5) = Alligator teeth (the red line)
  • SMM (Median price n, 5, 3) = Alligator lips (the green line)

Forex markets show many false trends. That is, often a “trend” may appear to begin, yet the price action soon settles back into a sideways range.

When using fractals, my strategy correctly identifies real trends and then follows them. Fractal forex tools such as the Alligator help my mechanical trading system reach through price clutter and focus on finding and trading the real trends.

My fractal trading method based on Alligator indicators

Here’s the simplest form of my fractal trading system based on Alligator indicators:

• Determine the entry point according to when the Alligator balance lines are intertwined, i.e. the Alligator is “sleeping” and when the CCI oscillator is indicating an overbought price condition;

• Execute new orders with 2% of the account equity;

• Places a stop-loss order at exactly 20 pips below the entry point;

• Sets an exit order to be triggered when more than two of the Alligator balance lines cross the candlesticks and/or when the CCI oscillator indicates an overbought condition.

Other ways to use fractals

Fractals are an easy way to see or confirm trends on any time frame. I program my mechanical trading system to check and see whether the fractals are showing lower lows and lower highs, or higher highs and higher lows. For my typical forex trading, I use fractals based on one-day, one-week, and one-month time frames.

The longer the time frame used to generate the fractal, the greater the reliability of the signals it produces. Also, the longer the time frame, the fewer the signals.

Also, I program my mechanical trading system to calculate fractals in order to set trailing stops. Since fractals show changes in trends, they work well to trigger my mechanical trading system to exit from trades when very-short-term reversals threaten to eat up the profits from a trade.

Trading with fractals and Fibonaccis

Beyond using the fractal Alligator indicator, fractal tools offer a great way to confirm Fibonacci signals. I’ve found that fractal forex trading works well when used for Fibonacci retracement levels.

I program my mechanical trading system to draw Fibonacci bands and calculate the fractals using daily time frames in forex markets such as EUR/USD and GBP/USD.

Then, I open a position when the price touches the most-distant Fibonacci band, yet only after my mechanical trading system sees that a daily (D1) fractal signal has occurred. The mechanical trading system exits the trade when a D1 fractal reversal occurs.

When using Fibonacci tools, fractals help pinpoint tops and bottoms with great accuracy. This gives me the confidence to trade at the right Fibonacci level. It’s easy – My mechanical trading system simply looks for the daily fractal parameter.

General considerations when using fractals

In order to double-check the signals generated from fractal indicators, my mechanical trading system uses other indicators such as the CCI oscillator to confirm fractal signals before trading. And, as with any type of trading method, use appropriate risk management measures to ensure that drawdowns are reasonable.

Fractals can be plotted in multiple time frames and used to confirm each other. One simple rule  is to only trade short-term fractal signals in the direction of long-term fractal signals, since long-term fractals are the most reliable. Use another indicator for safety such as the CCI oscillator to confirm the signal.

The Alligator and other fractal tools help

Fractals offer a set of powerful tools that you can use to strengthen your profits. Since mechanical trading systems are able to calculate fractal values and act on them quickly, there are plenty of fractal-based trading opportunities.

My own personal favorite is the Alligator indicator, yet fractals also work well with Fibonacci indicators and other trading strategies. In fact, fractal tools enjoy a relatively small yet devoted following among successful traders.

There are plenty of articles about fractals, as well as trader discussions about the basis for fractal forex trading success if you’d like to explore the topic further.

How do you use fractals in your trading? Share your thoughts on fractals below.

Filed Under: How does the forex market work?, Trading strategy ideas Tagged With: Alligator, Bill Williams, CCI, Fibonacci, forex trading, fractals, mechanical trading, SMMA

Timing Forex Entries Using the CCI Oscillator

December 23, 2013 by Andrew Selby Leave a Comment

Many traders will agree that the entry and exit signals your system utilizes are far less important than most people believe. At the same time, using an entry strategy that has a significant edge can greatly reduce the stress of trading that strategy. If your positions are generally profitable from the start, you won’t have to spend as much time worrying about the losers.

An interesting entry strategy that appears to have a big edge is the CCI 50 System. This strategy was published by user Billbss on the Forex Factory forum in April of 2008. Billbss explains that he borrowed the idea for the strategy from Dr. Bob, who he knew from another site. Dr. Bob had been using the strategy for futures, but Billbss believes he was the first to apply it to Forex.

The CCI 50 Strategy

The strategy is based on the Commodity Channel Indicator (CCI), which is generally used to identify cyclical trends in the futures markets. There are three different entry signals that are possible. They are determined using the 50 unit CCI, the 14 unit CCI, and the 34 unit EMA.

forex entires

The CCI 50 is a relatively simple method for timing forex entries that uses two versions of the CCI oscillator and an exponential moving average.

The first possible entry occurs when the 50 unit CCI crosses above its zero line. In this case, the 14 unit CCI and 34 unit EMA act as trend filters. The 14 unit CCI must also be above its zero line, and the current price must be above its 34 unit EMA.

The second possible entry is called the “First Zero Line Reject.” This occurs when the 50 unit CCI has already crossed above the zero line and then either the 50 Unit CCI or the 14 unit CCI cross below +100, but bounces back up before breaking the zero line.

The third possible entry is what Billbss calls “The Slingshot.” This happens when the 50 unit CCI is above the zero line and the 14 unit CCI crossed below -75 and then bounces back above its zero line.

The reverse of any of these three entries would signal a short entry.

Billbss doesn’t specify an exit strategy, but suggests that there are plenty that would work because the entries are so well timed. He did his backtesting on GBP/USD 15 minute bars, but suggested that the entries worked well across multiple currencies and time frames.

Exit Options

Later in that thread, Creztor suggests that using price-based stop-losses would be a good way to exit trades. He comments that exits could be based on the entry price, and also on the 50 unit CCI crossing back below +100.

User MasterOfDomain expands on this idea:

One of the exits most often used with this system is waiting for the CCI 14 to cross back over the +100 line (for longs) -100 (for shorts).

Kenayi adds a similar exit strategy:

 I exit my Long position when 14cci breaks -100, returns above (without taking the zero) and breaks -100 again.
my 2nd exit option is when 50cci breaks below 100 level

The Negative Side

As we are moving into 2014, does the CCI 50 strategy still work? Will it continue to work in the future?

More recent commentors on the thread have expressed mixed results. Some have found great success with the strategy, while others produced nothing but losers. It appears that the CCI 50 is just like every other Forex strategy in that its success or failure is determined by the trader who implements it.

One of the key negatives about the strategy is that there will be a large number of false zero line signals, especially when trading it from an automated approach. Structuring an expert advisor to handle these false signals could prove difficult.

Filed Under: How does the forex market work?, Trading strategy ideas Tagged With: CCI, forex

Divergence

May 31, 2012 by Shaun Overton 2 Comments

Many ideas for expert advisors and strategies utilize the concept of divergence for making trading decisions. Although the idea appears in countless indicators, divergence is most often drawn on CCI, MACD and the stochastics indicators.

Review of Divergence

Divergence occurs whenever the price and some oscillating indicator diverge in their directionality. Price can theoretically be any value between 0 and infinity. It does not have a ceiling.

Oscillators, on the other hand, are bounded by minimum and maximum values.  Stochastics and the RSI range between zero and one hundred. The number fifty represents an equilibrium in the movement of prices.

When the price makes a new higher high compared to some recent high, usually around 15-20 bars in the past, the assumption is that the indicator should achieve new highs, too. What happens, however, is that as the indicator starts moving slightly in the opposite direction. The price breaks new highs. The indicator remains slight under its old high. The direction of the price movement looks sharply up, whereas the indicator reads mildly down.

Divergence is Tricky

The problem with divergence is that if you put 10 different traders in a room and ask them to draw all of the divergences that they see, you’ll get 10 different answers. Traders each have personalities, all of which vary in their sensitivity to price movements. Some look at broad trends, while others obsess over the tiniest flutter in the market. Those groups in turn draw divergences either in line with major price movements or mark the chart with constant buzzing up and down. All of this is a complicated way of saying that the period used for divergence is arbitrary.

Every thing written about divergence promises that it shows when to consider exiting a trade. My opinion is that this is probably not sound. If you think about the major legs of a trend, you can think of it like the probability of a coin toss. When the first leg of a trend starts, it has something like a 50% probability of ending. Just as with the coin toss, the fact that a coin comes up heads doesn’t change the probability of the next toss coming up heads.

If you trade the second leg of a trend, then you eliminate half of the losers that would have occurred. More persuasively, I don’t think that you can spot a trend before it occurs from any type of technical analysis. Trading the first leg is not an option if you assume that trend directionality cannot be predicted before the trend even starts.

I’m tempted to turn the idea on its head. If you define divergence with an unvarying period that is programmable, then it would be possible to analyze the probability of a trend continuing. I don’t see much validity in Elliot Wave Theory, but I do like the idea of the third leg being the biggest. Most people would count the third leg of an Elliot Wave trend as the second leg. It represents the second move in the direction of the trend.

If you used divergence as an entry method after the first leg finishes and placed a stop at the beginning of the trend, then you would expect to find a profitable strategy based on the assumptions about leg length. If the first leg is usually shorter and the second leg is usually bigger, then the winners should be bigger than the losers. The 50-50 odds of winning would still yield a slightly positive profit factor. Anything greater than 50% odds would make for a stellar expert advisor.

Kernel of Truth

What I like about divergence is its relationship to oscillating indicators. The oscillators attempt to rescale the price, which happens to match nicely with a mathematical concept called the Hurst exponent. The Hurst exponent is a number between 0 and 1 that measures the trendiness of a signal. A value of 0 implies a value that never moves, whereas a value of 1 implies a value that trends in a straight line. Financial data on sufficient time scales, usually one hour bars or longer, exhibit high Hurst values. Testing that I did on the EUR/USD daily data showed a Hurst exponent around 0.7.

The method for estimating the Hurst exponent involves rescaling the price across different lengths of time. The fact that oscillators attempt to rescale price jumped out at me. True, they do it in a much more simplistic manner. The fact that divergence, a phenomenon that occurs from rescaling, occurs when compared to the original price encourages me. It makes me wonder if there might be a kernel of mathematical truth in an otherwise subjective concept.

Filed Under: Trading strategy ideas Tagged With: CCI, divergence, Hurst exponent, MACD, oscillator, Stochastics, trend

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.