Algorithmic and Mechanical Forex Strategies | OneStepRemoved

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

Oscillators you need to use

May 31, 2016 by Lior Alkalay 8 Comments

Oscillators, one of the most interesting groupings of technical indicators, are designed to signal overbought and oversold levels. Oscillators are a family of indices that go beyond the mathematics. They focus on one important thing and that is momentum, or more specifically changing momentum. Before we delve into which Oscillators are best to use and how, let me save you some unnecessary pain. Let me tell you first what oscillators aren’t.

How Not to use Oscillators

Some traders believe that Oscillators are some sort of magic indexes. Rest assured when I tell you they are not. Oscillators’ main use is not to tell you whether to buy or sell. Rather, they alert you to when it might be a good time to execute a buy or sell strategy. That is a very big difference. Those who attempt to use Oscillators as an ultimate buy or sell signal should be ready to learn a tough lesson. Those that will use it to fine tune their timing, however, will find Oscillators a very powerful tool.

Now that we’ve established what oscillators are good for let’s focus on which oscillators are worth your time and how to use them.

MACD Indicator

Perhaps the most widely used Oscillator in Forex, the MACD needs no special introduction. What it does need is a proper explanation of how to use it and when.

The idea of MACD is to signal your entry point when you’ve already figured out where the trend is going. It’s not going to alert you to a trend.  What that means is that you first have to perform your technical analysis. Once you reach a conclusion, then you can use the MACD.

On MT4, the MACD comes with default parameters (12, 26, 9). 12 represents the fast Exponential moving average, 26 the slow exponential moving average and 9 the Simple MACD average. Usually, when you trade on a daily basis, those parameters are fine.

Now in the chart below we see two points, A and B. In point A, the histogram moved above the average and that is supposed to be a buy signal. But, technical common sense says that a pronged bearish trend cannot end abruptly without some form of double bottom. Hence, one should ignore that signal.

But in point B, that’s a different story. After a double top that hits a resistance level and hits the trend average, there’s a case for a short. But we need to know when. Notice how after the second top the histogram in the MACD falls again below the average? That’s our mark and that is how you use MACD to time your trade. Once again, the lesson here is that Oscillators are for timing, not for point to the pair’s direction.

oscillators

Stochastic Oscillator

This is one of the most interesting indicators in the Oscillators family. What I like about this indicator is that it essentially gives you a 2-dimensional picture of overbought, oversold and momentum. Unlike the MACD, that’s not always accurate on overbought/oversold level.

The idea of the stochastic oscillator is twofold. First, it’s normalized from 0 to 100, anything below 20 is oversold and anything above 80 is overbought.

Second, using the convergence between the %K line and the %D line tells you something. Not only can you tell when there is an overbought/oversold level but also when the trend turns bullish or bearish. Thus it affords a 2-dimensional use of momentum. Confused? Here’s a classic example of how I would use a stochastic oscillator.

In the first part, we can see that in point C, after the pair has bottomed, the stochastic oscillator was below 20. That signaled an oversold level. We can conclude that there the pair is bottomed out, through a double bottom pattern. We can use the oversold level as enforcement but wait before dipping our toes into a buy position. Only in point D, as the blue line crosses the red line, we get our signal for entry.

However, one other thing is important to note and that is point E. In point E we get the blue line crossing the red line as it does with C. However, since the cross occurs very close to the overbought signal that should deter us from establishing it as an entry. Which means if the crossing in point D was close to the stochastic 80 level, we should have avoided entry.

oscillators

Average True Range

Last but not least, one of my favorite indicators, the Average True Range or ATR for short. Unlike the other two Oscillators the ATR is useful in anticipating potential rises or falls in volatility. Also unlike the other two, there is no oversold or overbought levels. If the ATR is high it suggests volatility is high. Conversely, if the ATR is low it suggests volatility is low.

How can we use this to predict volatility? We know, of course, that volatility is cyclical. Thus we can assume that when the ATR is at record lows for a prolonged period (point F) it’s a signal that a spike in volatility is coming. And, indeed, we can see volatility did come and we got the big spike.

If we decide to use the support as an entry signal we can ATR to gauge whether there’s a chance our buy trade will have a strong momentum. If the ATR was at a record high when we decide to buy that would have been a cautionary note. Not to entry but because it signals that volatility might fall and that means momentum might have been weak. The same principle, of course, works for a sell signal.

oscillators

Filed Under: Test your concepts historically Tagged With: average true range, MACD, oscillator, Stochastic

A Dual Stochastic Forex Strategy Offers Better Results

May 25, 2014 by Eddie Flower 38 Comments

Stochastic oscillators can be a valuable tool for mechanical forex traders. Yet, traders often use stochastics together with numerous unrelated indicators, and the results are generally ho-hum.

Like some other traders, I’ve found that using a single stochastic oscillator usually doesn’t produce consistent winners. One stochastic by itself doesn’t seem to yield eye-popping gains.

The good news is that a dual stochastic forex trading system can produce excellent results. I’ve discovered that a winning strategy can be built simply based on dual stochastic indicators, with very little else to clutter the picture.

I’ve enjoyed excellent results by using two stochastic oscillators together – one slow, and the other fast – in order to find trading opportunities.

When used with the appropriate parameters, a system programmed to monitor dual stochastic indicators can signal when the price of a forex pair is trending yet overextended during a period of short-term retracement.

This dual stochastic strategy focuses on trading when the two indicators are showing extreme opposite values. When both the fast and slow stochastics are at or near the designated limit values, it signals a trading opportunity.

Arrows on target

I use my mechanical trading system to watch for such conditions, and enter a trade when the price is about to revert back to the continuation of that trend. For me, it’s a good, simple forex trading system that works very well on its own, without adding other, more-complex indicators.

I’ve used this strategy for trading over a variety of time frames from fifteen-minute to daily. I’ve had particularly good results when using this strategy for trading EUR/USD on hourly time frames, and it works especially well for “short” trades in this currency pair.

The background of stochastic oscillators

The first basic stochastic oscillator was developed in the late 1950s by financial analyst Dr. George C. Lane. The word stochastic itself is derived from a Greek word meaning ‘aim’ and in general finance the word usually refers to the seemingly random pattern of values around a given target value.

Stochastics are based on the idea that during an uptrend prices will stay at or above the closing price of the previous time period. Likewise, during a downtrend prices will stay at or below the closing price of the previous time period.

This easy-to-calculate oscillator was one of the very first indicators used by technicians searching for insight into price moves. It’s a momentum indicator, and it reflects support and resistance levels.

When he first developed this concept, Dr. Lane advocated the use of divergent and convergent trendlines drawn according to stochastics. And, during the earliest use by Dr. Lane and others, stochastic oscillators were usually used with other tools such as Elliot Waves and Fibonacci retracements for best timing.

With regard to trading forex pairs and other assets, the term “stochastics” refers to the location of the current price relative to its recent price range over some given period of time.

Part of the reasoning behind stochastic indicators is that a forex price has a tendency to close near the extreme of its recent price range before a turning point. A stochastic strategy works to predict the price inflection points by comparing a forex pair’s closing price to its recent price range.

The values are plotted on a chart as one or more bands which oscillate around an axis or between a set of limit values. Mechanical trading systems and expert advisors make it easy to set up forex trading programs that incorporate stochastic indicators.

How to calculate fast, slow and full stochastic oscillators for forex trading

Before moving forward to discuss the dual stochastic forex trading strategy, I’ll first lay a foundation by defining and describing the underlying stochastic oscillator concepts.

The basic single stochastic compares a forex pair’s closing price to its overall price range during a given period of time by using two lines or bands.

The line referred to as %K reflects the current market price for a given currency pair. The %D line serves to “smooth out” the %K line by showing the currency pair’s price as a moving average.

There are three general types of stochastic oscillator indicators used in forex trading: Fast, slow and full. The “fast” one is based on Dr. Lane’s original equations for %K and %D. When viewed in the fast version, %K looks fairly choppy. %D is the three-day moving average of %K.

During the earliest use of stochastics for trading, Dr. Lane relied on %D to produce “buy” or “sell” signals according to bearish and bullish divergences. Unlike the dual stochastics strategy, when traders use only a single stochastic indicator, they use %D by itself, and it’s called the “signal line.”

Since %D in the “fast” oscillator is used to generate signals, the “slow” oscillator was introduced to take advantage of this by itself. The slow stochastic oscillator used a three-day SMA to smooth %K, which is exactly equivalent to the role of %D in the fast oscillator.

So, in single stochastic strategies, %K in the slow oscillator equals the %D of the fast oscillator.

The basic stochastic oscillator

%K is 100 x [Closing Price minus Lowest Price of N time periods] / [Highest Price of N time periods minus Lowest Price of N periods]

and

%D is 100 x [Highest Price of (N minus a lesser number) time periods] / Lowest Price of (N minus a lesser number) time periods]

The first equation calculates the range between the high and low of the forex pair’s price over a given time period. The forex pair’s price is expressed as a percent of that range: 100% represents the top limit of the range and 0% represents the bottom of the range, during the chosen time period.

Fast Stochastic

Fast %K equals the basic %K calculation
Fast %D equals a three-period simple moving average of Fast %K

Slow Stochastic

Slow %K equals Fast %K smoothed by applying a three-period simple moving average
Slow %D equals a three-period simple moving average of Slow %K

Full Stochastic

The full stochastic oscillator is calculated this way:

Full %K equals Fast %K smoothed by an N-period simple moving average
Full %D equals an N-period simple moving average of Full %K

A stochastic oscillator’s sensitivity to marketplace volatility can be reduced by making adjustments to the time periods, as well as by using different moving averages for the %D value.

The most commonly-used values of N used for single, basic stochastics are time-periods of 5, 9, or 14 units. Many traders set N at 14 time-periods in order to represent a sufficient data sample for meaningful calculations. You can experiment with a different number of periods, and this may affect the results of the strategy.

%K by itself is referred to as the “fast stochastic” value. For single stochastic indicators, %D is generally set to equal a 3-period moving average for %K.

The single %D stochastic is calculated using the last 3 values of %K in order to arrive at a 3-period moving average for the %K stochastic. This creates a “smoothed” value for %K.

Since %D represents the moving average of %K, it’s called the “slow stochastic” because it reacts somewhat more slowly to forex-pair price changes than the %K value does.

When using %D by itself, there is only a single valid signal – The divergence between the price of the forex pair and %D.

Of course, for my dual stochastic strategy as outline below in this article, I use two different sets of time periods.

As indicated above, the classic stochastic calculations are based on a simple moving average (SMA). However, for the dual stochastic strategy described below, I also use an additional exponential moving average (EMA) as a separate confirmation indicator.

The dual-stochastics forex trading strategy

In contrast to the basic single-stochastic indicators described above, a dual stochastics strategy provides a greater number of winning trades.

My dual stochastic forex trading strategy is based on combining together a fast and slow stochastic and waiting for opportunities when the two different indicators are at extreme opposites. I define the extremes as being at least the 20% and 80% levels, if not closer to 0 and 100%.

The dual strategy is simple – The only other indicator I use along with the set of stochastics is a 20-period exponential moving average (20 EMA), although even that isn’t essential. Or, as an alternative, you could confirm signals by using the middle band of the Bollinger bands.

In MetaTrader, the parameters to be set for the two (dual) sets of stochastics are:

Fast stochastic

  • %K period is 5
  • %D period is 2
  • Slowing is 2
  • Fixed minimum is 0
  • Fixed maximum is 100

Slow stochastic

  • %K period is 21
  • %D period is 4
  • Slowing is 10
  • Fixed minimum is 0
  • Fixed maximum is 100

I combine both of the stochastic oscillators in the same window in the MetaTrader chart. It’s easy to do – Just place the first stochastic on the chart, then drag the other one from the window and drop it down on top of the first indicator. Then enter your settings in the dialog box.

Dual-stochastics trading rules

The trading rules are easy. The mechanical trading system is programmed to wait for strongly-trending price, and watch for the stochastics to be at extreme opposites, near the limit values. For confirmation, the system looks for a candlestick pattern signaling a reversal after a brief retracement to the 20-period EMA.

The below EUR/USD chart shows some examples of trading opportunities. The circles show three prospective entry points for “short” trades in an overall downtrend. Examples 1 and 2 are clear signals. Example 3 is marginal, since the slow stochastic is just beginning to move up away from the oversold area.

In Example 1, note particularly that the slow stochastic (the yellow band) is quite oversold, and at the same time the fast stochastic (blue-colored band) has just finished moving beyond the extreme overbought limit.

overbought oversold stochastics

The below EUR/USD chart shows a typical “short” trade entry point during a well-confirmed downtrend. In particular, note the flat, oversold slow stochastic band (yellow), together with the (blue) fast stochastic band’s sharp downward hook below the overbought limit.

Note also that the 20 EMA was touched. The separate EMA indicator provides confirmation of the signal shown by the stochastic oscillators. As well, it’s also worth noting that even though the bearish candlestick isn’t a “classic” engulfing type, still it was confirmed by the later candlesticks.

Bearish dual stochastics

In the EUR/USD chart below, Example 1 shows a typical “short” trade. The slow stochastic (yellow) is flat and touching the oversold limit, while the fast stochastic (blue) has touched the overbought limit.

Example 2 shows a signal that looks to candlestick-lovers like a classic bearish “evening star” pattern at the 20 EMA, but still required a tight stop-loss in order to exit at breakeven.

Another dual stochastics chart

Entry and exit

This last example above is a good reminder that the dual stochastics forex trading strategy is best used with a mechanical trading system programmed with firm trailing-stop and stop-loss rules to ensure that you ride the winners for as long as possible, while minimizing the losses.

As illustrated in the charts above, the strategy works best for me with the “shorts.” I program my mechanical trading system to enter a “sell” order for 2% of my account equity when the two stochastic bands touch the respective overbought and oversold limits, and the signal is confirmed by the price touching at or near the 20 EMA.

The stop-loss order is placed at exactly 20 pips above my entry point. The system moves my trailing-stop order along behind the current price level during successful trades, usually at a distance of 10 pips.

The dual-stochastic forex trading strategy is simple

The main advantage of this strategy is its simplicity. Instead of relying on the “iffy” nature of a single stochastic indicator, or the complexity of multiple layers of indicators, a set of two stochastic oscillators works very well for me. The strategy is easy to understand, and it’s easy to program for mechanical trading systems.

Have you been using stochastic oscillators in your own trading?

Filed Under: How does the forex market work?, Trading strategy ideas Tagged With: George Lane, Stochastic, stochastic oscillator, stochastic oscillators, Stochastics

3 Basic Applications of Moving Averages

February 25, 2014 by Andrew Selby Leave a Comment

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

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

moving averages

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

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

Crossover Entry/Exit Signals

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

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

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

Trend Filters

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

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

Smoothing Other Indicators

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

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

 

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

MACD & Stochastic Double Cross System

May 6, 2013 by Andrew Selby 4 Comments

What would happen if we combined the indicators from different systems? Would they work together to make a stronger system or would they work against each other?

I recently covered a MACD Trading System and a Stochastic Trading System. Combining these two systems can give us stronger signals. This should, in theory, help to reduce false signals.

MACD & Stochastic Double Cross System

Once again, we will use the 200 unit simple moving average (SMA) to define the direction of the long term trend. It is always better to trade in the same direction of the general trend. Using the 200 unit SMA here will keep us from attempting to swim against the current.

Basically combining the two individual systems, this system will look for a MACD cross signal within two days of a Stochastic cross signal. Due to the nature of these indicators, it is important that the Stochastic cross happens first.

Targeting the situations where both systems agree should isolate only the very strongest signals, thus increasing the win rate.

Trading Rules

Chart and Instrument:  Any
Period:  Any
Market Condition:  Trend

Go Long When:
Price Closes > 200 Day SMA
Bullish MACD Cross < 2 Days After Bullish Stochastic Cross

Go Short When:
Price Closes < 200 Day SMA
Bearish MACD Cross < 2 Days After Bearish Stochastic Cross

Exit Long When:
Bearish MACD Cross

Exit Short When:
Bullish MACD Cross

Strategy Analysis

Combining these two indicators works well because they are both derivatives of price, but they are calculated differently. The Stochastic Oscillator illustrates the price with respect to the range, while the MACD shows us the convergence or divergence of two different moving averages. While both are completely based on price action, they focus on two different aspects of that action.

The primary advantage of this system is that it isolates the signals where the two different systems agree.

Combining the two separate systems will strengthen the advantages and reduce the disadvantages of each system. Both the MACD and Stochastic Oscillator are prone to giving false signals, this system provides an excellent way to focus on only the strongest signals.

This focus on only the strongest signals is also the biggest weakness of this system. If we are going to hold out for only the very strongest signals, then there are going to be far less signals to trade. We will have to follow a wider variety of markets in order to find regular signals.

The SPX daily chart shows a signal using the SMA200, slow stochastics and MACD.

The SPX daily chart shows a signal using the SMA200, slow stochastics and MACD.

This chart of the SPX provides a great example of a long signal for this system. At the end of 2012, the SPX had just recently crossed above its 200 day SMA. Then, just a few days before the new year, we see a bullish Stochastic cross followed by a bullish MACD cross. This system would have caught the entire month of January, which was very positive for the SPX.

One interesting note is that it would not have gotten back into this uptrend in March like either of the systems would have done on their own because the signals were more than a few days apart.

This could be compensated for by expanding the limit on the number of days between signals. However, expanding this limit will also open the system up to more false signals. This is the type of risk/reward situation that each trader must determine for himself.

Why Not Three Indicators? Or Four? Or Five?

If the two indicators used in this system make it stronger than the one indicator systems we looked at before, does that mean that bringing in a third indicator would make this system even stronger? If that logic holds true, why not use a dozen indicators? This is the slippery slope of system design.

When designing trading systems, we must keep in mind that overusing indicators can result in a system that doesn’t find enough signals to trade profitably. Having a system that is profitable on 98% of its trades won’t do you any good if it only gets a signal once every 200 years. Keep this in mind when experimenting with the wide variety of indicators available.

Do you have any thoughts on this trading system? Share your comments and ideas in the section below.

Filed Under: Trading strategy ideas Tagged With: MACD, Stochastic, trading system

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 © 2022 OneStepRemoved.com, Inc. All Rights Reserved.