darusuna.com

Exploring the Awesome Oscillator: A Comprehensive Guide

Written on

Chapter 1: Introduction to Oscillators

Oscillators are pivotal tools in trading, fluctuating around a central point, typically zero. The Moving Average Convergence Divergence (MACD) is one of the most well-known oscillators, where traders make decisions based on signal crossovers. This article delves into a variant of the MACD known as the Awesome Oscillator.

Following the success of my prior publication, "Trend Following Strategies in Python," I have authored a new book featuring advanced contrarian indicators and strategies. This book includes a dedicated GitHub page for continuously updated code. If this piques your interest, feel free to check the Amazon link below for a sample. Alternatively, the PDF version is available at the end of the article.

Section 1.1: Understanding Moving Averages

Moving averages are fundamental to technical analysis, serving various purposes. The simplest form is the simple moving average (SMA), calculated by dividing the total sum of values by their count. Below is the formula for determining a basic mean given a dataset:

The SMA is obtained by dividing the total of the values by the number of values. Traders utilize moving averages to gauge trends and identify trading signals. Refer to the accompanying figure that illustrates a 60-period simple moving average applied to Ethereum's hourly values against USD (ETHUSD).

Assuming you have an OHLC data array imported in Python (a process I've detailed in previous articles), you can write the following primary functions to manage your data effectively:

def add_column(data, times):

for i in range(1, times + 1):

new = np.zeros((len(data), 1), dtype=float)

data = np.append(data, new, axis=1)

return data

def delete_column(data, index, times):

for i in range(1, times + 1):

data = np.delete(data, index, axis=1)

return data

def delete_row(data, number):

data = data[number:, ]

return data

Next, to compute a simple moving average, you can implement the following function:

def ma(data, lookback, close, position):

data = add_column(data, 1)

for i in range(len(data)):

try:

data[i, position] = (data[i - lookback + 1:i + 1, close].mean())

except IndexError:

pass

data = delete_row(data, lookback)

return data

Focus on understanding the concepts rather than just the code itself. You can find most of my strategies' codes in my books. Grasping the techniques and strategies is paramount.

I have recently collaborated with Lumiwealth; if you're interested in creating algorithms, I highly recommend exploring their hands-on courses covering algorithmic trading, blockchain, and machine learning.

Chapter 2: Constructing the Awesome Oscillator

To derive the Awesome Oscillator, follow these steps:

  1. Calculate the midpoint: current high minus current low.
  2. Compute a 5-period simple moving average on the midpoints.
  3. Compute a 34-period simple moving average on the midpoints.
  4. Subtract the 5-period moving average from the 34-period moving average.

Below is an illustration of EURUSD hourly data in the first panel and the Awesome Oscillator in the second panel.

The plot shows the Awesome Oscillator, which employs color coding based on value changes:

  • A green bar indicates the current value exceeds the previous value.
  • A red bar signifies the current value is less than the previous value.

To implement the Awesome Oscillator in Python, use the following function on an OHLC array (not a DataFrame):

def awesome_oscillator(Data, high, low, long_ma, short_ma, where):

Data = add_column(Data, 2)

# Mid-point Calculation

Data[:, where] = (Data[:, high] + Data[:, low]) / 2

# Short-term Simple Moving Average

Data = ma(Data, short_ma, where, where + 1)

# Long-term Simple Moving Average

Data = ma(Data, long_ma, where, where + 2)

# Awesome Oscillator Calculation

Data[:, where + 3] = Data[:, where + 1] - Data[:, where + 2]

# Remove Excess Columns/Rows

Data = delete_column(Data, where, 3)

return Data

USDCHF hourly data is displayed in the first panel with the Awesome Oscillator in the second panel.

To visualize the above plot with color coding, you can use the following function:

def indicator_plot_double_awesome(Data, first, second, name='', name_ind='', window=250):

fig, ax = plt.subplots(2, figsize=(10, 5))

Chosen = Data[-window:, ]

for i in range(len(Chosen)):

ax[0].vlines(x=i, ymin=Chosen[i, 2], ymax=Chosen[i, 1], color='black', linewidth=1)

ax[0].grid()

for i in range(len(Chosen)):

if Chosen[i, 5] > Chosen[i - 1, 5]:

ax[1].vlines(x=i, ymin=0, ymax=Chosen[i, 5], color='green', linewidth=1)

if Chosen[i, 5] < Chosen[i - 1, 5]:

ax[1].vlines(x=i, ymin=Chosen[i, 5], ymax=0, color='red', linewidth=1)

ax[1].grid()

ax[1].axhline(y=0, color='black', linewidth=0.5)

Using this function, you can generate the plot as follows:

indicator_plot_double_awesome(my_data, 3, where_your_awesome_oscillator_lies, name='', name_ind='Awesome Oscillator', window=250)

Chapter 3: Trading with the Awesome Oscillator

The flip strategy represents one of the most fundamental and straightforward trend-following methodologies. A crossover of the zero line signals a trend change, leading to the following trading indicators:

  • A long (Buy) signal occurs when the Awesome Oscillator exceeds the zero level after the previous two levels were below zero.
  • A short (Sell) signal arises when the Awesome Oscillator drops below the zero level following the previous two levels being above zero.

Another approach involves observing color changes of the oscillator, leading to these trading signals:

  • A long (Buy) signal is generated when the oscillator transitions from red to green.
  • A short (Sell) signal occurs when it shifts from green to red.

Section 3.1: Concluding Thoughts

In summary, my goal is to contribute to the realm of objective technical analysis by promoting transparent techniques and strategies that require thorough back-testing prior to implementation. This effort aims to enhance the credibility of technical analysis, dispelling its reputation as being subjective and lacking scientific foundation.

I encourage you to adopt the following steps when encountering a trading technique or strategy:

  1. Maintain a critical perspective and eliminate emotional responses.
  2. Conduct back-testing using real-life simulations and conditions.
  3. If you identify potential, optimize and run forward tests.
  4. Always account for transaction costs and slippage in your evaluations.
  5. Incorporate risk management and position sizing into your tests.

Lastly, even with the above precautions, always exercise caution and keep an eye on the strategy, as market dynamics may evolve and render the strategy ineffective.

For the PDF version of my book, priced at 9.99 EUR, please include your email address in the note prior to payment to ensure it is sent to the correct location. Once you receive it, make sure to download it from Google Drive.

This video titled "Awesome Oscillator By Bill Williams - Best Strategy Guide" provides an in-depth explanation of the Awesome Oscillator and offers strategic insights for trading.

The second video, "AWESOME OSCILLATOR TRADING INDICATOR EXPLAINED & STRATEGIES FOR YOU TO TRY!" elaborates on the oscillator's functionality and presents various strategies for practical application.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Navigating the Rise of Supercookies: A Browser Response

As advertisers shift to supercookies, browsers are enhancing privacy measures to protect users from invasive tracking.

Cicada Cuisine: A Unique Culinary Adventure Awaits You

Discover the intriguing world of cicadas as a culinary delight and learn how to prepare them safely.

Master the Art of Self-Editing: 5 Essential Techniques for Writers

Discover five crucial self-editing techniques that will enhance your writing and help you create polished, professional articles.

# Exploring the Industrial Metaverse: A New Era in Manufacturing

Discover how the industrial metaverse is transforming manufacturing and design through virtual reality and data-driven solutions.

A Comprehensive Review of the M1 MacBook Air After Two Months

In-depth insights into the M1 MacBook Air's performance, ergonomics, and its comparison to the iPad Pro.

Embracing Small Steps: Your Path to Personal Growth

Discover how small, actionable steps can lead to meaningful personal growth and transformation.

Finding Harmony: Lessons from Nature and Our Animal Friends

Discover the wisdom of nature and how animal behaviors can guide us to a healthier, more balanced life.

Innovative Microfliers: The Smallest Flying Structures Ever Created

Discover the groundbreaking