batteriesinfinity.com

Introducing Fibonacci Volatility Bands for Trading Insights

Written on

Chapter 1: Understanding Volatility Bands

Volatility bands serve as essential tools in trading, illustrating statistical extremes that often correlate with market movements. This article delves into a novel band type known as Fibonacci volatility bands.

After the success of my previous publication, "Trend Following Strategies in Python," I have released a new book. It encompasses advanced contrarian indicators and strategies, with a dedicated GitHub page for continually updated code. If you're interested, you can purchase the PDF for 9.99 EUR via PayPal. Please include your email in the note to ensure the correct delivery, and remember to download it through Google Drive once you receive it.

The Concept of Volatility Bands

Volatility bands are dynamic lines that shift with market prices over time, aiming to encompass them. The most recognized volatility bands are Bollinger Bands. Typically, they utilize a smoothing technique on market data followed by a volatility measure to assess normality.

In contrast, Fibonacci volatility bands adopt a similar concept but integrate the famous Fibonacci sequence, where each number is the sum of the two preceding ones. The Fibonacci ratios derived from this sequence, particularly the well-known ratio of 1.618, are utilized in these calculations.

For those interested in the details surrounding the Fibonacci sequence and Bollinger Bands, previous articles provide valuable insights. For now, let's focus on coding Fibonacci volatility bands in Pine Script, the programming language used in TradingView, a leading charting platform.

I have recently collaborated with Lumiwealth. If you're eager to learn how to create various algorithms, feel free to explore the link below. They offer hands-on courses covering algorithmic trading, blockchain, and machine learning, which I highly recommend.

Creating Fibonacci Volatility Bands

The objective here is to construct and display Fibonacci volatility bands on TradingView. First, create a free account to access the charts. Once logged in, locate the Chart button on the homepage and select any asset for which you wish to calculate the indicator. Next, find the Pine Editor at the bottom of the screen and prepare to start coding.

The steps to create this indicator include:

  1. Compute a 20-period average true range (ATR) for the market price.
  2. Calculate a 20-period moving average of the highs.
  3. Calculate a 20-period moving average of the lows.
  4. To determine the first resistance, multiply the ATR by 1.618 and add it to the first moving average.
  5. For the second resistance, multiply the ATR by 2.618 and add it to the first moving average.
  6. For the first support, subtract 1.618 times the ATR from the second moving average.
  7. For the second support, subtract 2.618 times the ATR from the second moving average.
  8. Finally, calculate a 20-period moving average of the close price, which will serve as the middle line.

The indicator should resemble the chart below.

Example of Fibonacci Volatility Bands

The bands can be utilized similarly to Bollinger Bands. Now, let’s look at how to code this in Pine Script.

First, specify the version of Pine Script, which is version 5, noting the slight changes from the previous version.

//@version = 5

Next, define the indicator's name using the following syntax:

indicator("Fibonacci Volatility Bands", overlay = true)

Now, calculate the ATR and the moving averages:

atr = ta.atr(lookback)

sma_high = ta.sma(high, lookback)

sma_low = ta.sma(low, lookback)

Next, apply the support and resistance line calculations:

first_resistance = sma_high + (atr * 1.618)

second_resistance = sma_high + (atr * 2.618)

sma_middle = ta.sma(close, lookback)

first_support = sma_low - (atr * 1.618)

second_support = sma_low - (atr * 2.618)

Finally, use the following syntax to plot the indicator:

fr = plot(first_resistance, color = color.black)

sr = plot(second_resistance, color = color.black)

fill(fr, sr, color = color.new(color.black, 90))

fs = plot(first_support, color = color.black)

ss = plot(second_support, color = color.black)

fill(fs, ss, color = color.new(color.black, 90))

plot(sma_middle)

Example of Fibonacci Volatility Bands

Check out my weekly market sentiment report to gain insights into current positioning and future market direction using both complex and straightforward models. More information about the report can be found via this link.

Summary

In conclusion, my aim is to contribute to the realm of objective technical analysis by promoting transparent techniques and strategies that require thorough back-testing before implementation. This approach seeks to improve the perception of technical analysis, moving it away from the notion of being subjective and lacking scientific basis.

Medium is a treasure trove of insightful reads, and after consuming many articles, I decided to share my own insights. Consider signing up for Medium through my referral link (at no extra cost to you).

Whenever you encounter a trading technique or strategy, I recommend following these steps:

  1. Maintain a critical mindset and eliminate emotional biases.
  2. Back-test it using real-life simulations and conditions.
  3. If potential is found, optimize and conduct a forward test.
  4. Always factor in transaction costs and slippage in your tests.
  5. Incorporate risk management and position sizing into your evaluations.

Lastly, even after confirming the above, remain vigilant and monitor your strategy, as market dynamics can shift, rendering previously profitable strategies unviable.

Chapter 2: Practical Applications of Fibonacci Bands

Discover how to identify market reversals utilizing Bollinger Bands and Fibonacci retracement techniques. This video provides valuable insights into the practical applications of these tools.

Learn how to effectively use Bollinger Bands and Fibonacci in Forex and stock trading through this informative video, which covers essential strategies for traders.

Share the page:

Twitter Facebook Reddit LinkIn

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

Recent Post:

Understanding the Challenges Domestic Violence Victims Face

An exploration of why victims of domestic violence often remain silent, detailing personal experiences and the struggle for independence.

Harnessing OneNote for Enhanced Content Creation and Productivity

Discover how OneNote can streamline content creation and boost productivity across multiple platforms.

Understanding Fate: The Lesson of Letting Go in Relationships

Explore the importance of recognizing self-worth and the inevitability of letting go of relationships not meant to last.

Consistent Earnings Through Realistic Writing Objectives

Explore how to set achievable writing goals that lead to consistent income.

Responsible Use of AI: A Call for Caution and Awareness

This article discusses the potential risks of AI and the need for responsible usage, highlighting the implications for creativity and society.

Tesla's Struggle in the Autonomous Vehicle Landscape

A look into Tesla's challenges in the autonomous vehicle race and the competition it faces.

Exploring Software Design Patterns: A Comprehensive Overview

A detailed overview of software design patterns, their benefits, and applications in development.

# Enhancing Your Work-Life Balance: 50 Practical Tips for Designers

Discover 50 actionable strategies to improve your work-life balance as a designer, with tips on productivity, creativity, and self-care.