avatarSofien Kaabar, CFA

Summary

The web content introduces a trading technique known as the "Moving Average Testing Ground," which uses a simple moving average to generate bullish or bearish trading signals based on the price's interaction with the moving average line over three consecutive periods.

Abstract

The article titled "How to Generate Strong Trading Signals Using a Simple Trick" delves into a specific trading strategy that leverages moving averages, a widely used statistical tool in financial markets for trend analysis and identifying trading opportunities. The "Moving Average Testing Ground" technique is presented as a method to generate clear directional signals by observing whether the price makes three successive highs or lows in relation to the moving average line and how it closes in relation to that line. The technique is described as straightforward, involving a 100-period moving average by default, although it is suggested to test different lookback periods for optimal results. The strategy aims to provide a systematic approach to entering trades, with visual examples provided for both bullish and bearish signals. Additionally, the article offers Python code for implementing the technique, emphasizing the importance of contrarian trading strategies and the use of specialized tools for successful trading.

Opinions

  • The author suggests that moving averages are essential for smoothing out short-term fluctuations and highlighting underlying trends in financial data.
  • The "Moving Average Testing Ground" technique is proposed as a reliable method for generating trading signals, despite the potential for a few false signals.
  • The article promotes the use of a 100-period moving average as a starting point but encourages traders to experiment with different lookback periods to find the most effective settings for their specific market.
  • The author advocates for the integration of contrarian trading strategies, suggesting that they can be enhanced by using programming languages like Python.
  • Visual aids, such as charts and code snippets, are provided to reinforce the technique's validity and assist traders in understanding and applying the strategy.

How to Generate Strong Trading Signals Using a Simple Trick

Using the Moving Average Testing Ground Technique

Moving averages can also have many trading techniques applied on them in order to generate directional signals. This article discusses a technique called the testing ground which relies on a successive test of the moving average line.

Introduction to Moving Averages

Moving averages are a commonly used statistical tool in finance, economics, and data analysis. They are used to analyze time series data and identify trends or patterns over a specific period of time.

A moving average calculates the average value of a data series over a defined number of previous periods. As new data points become available, the oldest data point is dropped, and the newest one is included in the calculation. This creates a “moving” average that adjusts over time.

Moving averages smooth out short-term fluctuations and noise in data, providing a clearer picture of the underlying trend. They are particularly useful for identifying the direction of a trend, determining support and resistance levels, and generating trading signals in financial markets.

There are different types of moving averages, including simple moving averages (SMA) and exponential moving averages (EMA). A simple moving average calculates the average of the data points over a specified period equally weighted, while an exponential moving average assigns greater weight to recent data points, making it more responsive to recent price changes.

Moving averages can be applied to various types of data, such as stock prices, exchange rates, sales figures, or any other time-dependent series. They are often plotted as lines on charts, allowing analysts and traders to visually interpret the data and make informed decisions based on the observed trends.

The following Figure shows an example of a 100-period moving average applied on USDCHF.

Moving average

Contrarian trading is a form of art that requires specialized tools. Learn how to improve your contrarian trading using Python in my book!

The Moving Average Testing Ground Technique

This technique is very simple and relies on the concept of testing a level to generate its signals. The trading conditions are as follows:

  • A bullish signal is generated whenever the market shapes three successive lows below the moving average line but every time, it closes above the moving average line.
  • A bearish signal is generated whenever the market shapes three successive highs above the moving average line but every time, it closes below the moving average line.

It is worth noting that the technique may suffer from a few false signals and the best way to use it is to try a few lookback periods on the moving average so that you have an aggregate score. By default, 100 seems to be decent enough across lookback periods, but that may not hold for every market.

The following Figure shows a bullish signal:

Signal chart

The following Figure shows a bearish signal:

Signal chart

The code for the technique is as follows:

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar

//@version=5
indicator("Moving Average Testing Ground", overlay = true)
lookback = input(defval = 100, title = 'Lookback')
ma = ta.sma(close, lookback)
buy  = low < ma and low[1] < ma[1] and low[2] < ma[2] and math.min(close, open) > ma and math.min(close[1], open[1]) > ma[1] and math.min(close[2], open[2]) > ma[2] 
sell = high > ma and high[1] > ma[1] and high[2] > ma[2] and math.max(close, open) < ma and math.max(close[1], open[1]) < ma[1] and math.max(close[2], open[2]) < ma[2] 
plotshape(buy,  style = shape.triangleup,   color = color.green,  location =  location.belowbar, size = size.small)
plotshape(sell,  style = shape.triangledown, color = color.red,    location =  location.abovebar, size = size.small)
Signal chart
Signal chart
Data Science
Trading
Finance
Investing
Cryptocurrency
Recommended from ReadMedium