OPEN-SOURCE SCRIPT

Fibonacci Levels on Any Indicator [By MUQWISHI]

▋ INTRODUCTION :
A “Fibonacci Levels on Any Indicator” can be applied to any indicator to draw Fibonacci levels based on provided conditions of two price points to produce a sequence of horizontal line levels starting from 0% to 100% in addition to extension levels. The 0% level is measured as the start of retracement, while the 100% level is the beginning of the extension levels. This tool was developed to be easy to add to any indicator, and it could be valuable to some traders in terms of managing trades by setting targets and reducing risk in the trend direction.


_______________________
▋ USAGE:

➤ NEEDS TO IDENTIFY 4 ELEMENTS:
스냅샷
1. Starting Point. What’re the conditions / When will the drawing of the Fibonacci levels begin?
2. Ending Point. What’re the conditions / When will the drawing of the Fibonacci levels end?
3. High Point. What is the price for a 100% Fibonacci level (0% for the downside)?
4. Low Point. What is the price for a 0% Fibonacci level (100% for the downside)?


➤ STARTING & ENDING POINTS CONDITIONS:
Need to specify the condition when the drawing of Fibonacci levels starts and ends, and the indicator shows different prepared conditions.
스냅샷
  • New Phase: Import a value (plot) from an existing indicator, where its status changes from NaN to a real number.
  • Crosses Above/Below: Import a value(1) (plot) from an existing indicator, where it crosses above/below value(2).
  • Reversal Up/Down: Import a value(1) (plot) from an existing indicator, where it rises/decreases than the previous value(1).
  • First/Last Bar: Useful to draw stationary Fibonacci levels.



➤ UPPER & LOWER PIVOTS (0% & 100%):
Need to specify the two price points representing 0% & 100% Fibonacci levels to expose the sequence of Fibonacci lines.
스냅샷
  • Upper Pivot. By default, the ATR Upper Band. It’s possible to import a custom value from an existing indicator.
  • Lower Pivot. By default, the ATR Lower Band. It’s possible to import a custom value from an existing indicator.



➤ FIBONACCI STYLING OPTIONS:
Ability to customize line & label style, color, reverse, and hide/show levels.
스냅샷


_______________________
▋ IMPLEMENTATION:
Here are some examples of implementing the indicator.
Note: All presented examples below are for demonstration purposes, and they're not trading suggestions.


# Example 1: (Reversal Up/Down)
We want to implement Fibonacci levels on the Hull MA by mohamed982. Our requirements are as follows:
  • Fibonacci levels start when the Hull MA reverses up.
  • Fibonacci levels end when the Hull MA reverses down.
  • Upper Pivot is the ATR Upper Band.
  • Lower Pivot is the ATR Lower Band.

After adding the required indicator (Hull MA), here’re the implementation and results
스냅샷


# Example 2: (Crosses Above/Below)
We want to implement Fibonacci Level on the Squeeze Momentum by LazyBear. Our requirements are as follows:
  • Fibonacci levels start when the Squeeze Momentum histogram crosses above 0.
  • Fibonacci levels end when the Squeeze Momentum histogram crosses below 0.
  • Upper Pivot is the Bollinger Upper Band.
  • Lower Pivot is the Bollinger Lower Band.

After adding the required indicators (Squeeze Momentum & Bollinger Band), here’re the implementation and results
스냅샷


# Example 3: (Crosses Above/Below)
We want to implement Fibonacci Level on the Crossing Moving Averages. Our requirements are as follows:
  • Fibonacci levels start when the 20-EMA crosses above 100-MA.
  • Fibonacci levels end when the 20-EMA crosses below 100-MA.
  • Upper Pivot is the ATR Upper Band.
  • Lower Pivot is the ATR Lower Band.

After adding the required indicators (20-EMA & 100-MA), here’re the implementation and results
스냅샷


# Example 4: (New Phase: When the previous value is NaN, and the current value is a real number.)
We want to implement Fibonacci Level on the Supertrend. Our requirements are as follows:
  • Fibonacci levels start when an up-Supertrend (green) line shows up.
  • Fibonacci levels end when a down-Supertrend (red) line shows up.
  • Upper Pivot is the down-Supertrend.
  • Lower Pivot is the up-Supertrend.

After adding the required indicator (Supertrend), here’re the implementation and results
스냅샷


# Example 5: (First/Last Bar)
We want to implement Fibonacci Level between two points, 330 & 300. Our requirements are as follows:
  • Fibonacci levels start at first bar on the chart.
  • Fibonacci levels end at last bar on the chart.
  • Upper Pivot is 330.
  • Lower Pivot is 300.

Here’re the implementation and results.
스냅샷
To customize the number of bars back (like 50 bars)
스냅샷


_______________________
▋ Final Comments:
  • The “Fibonacci Levels on Any Indicator” is made to apply on other indicators for planning Fibonacci Levels.
  • It can be implemented in different ways, along with presented examples.
  • This indicator does not work with plots that were developed by drawing classes.



Please let me know if you have any questions.
Thank you.
Chart patternsFibonacci ExtensionFibonacci RetracementlevelsmovingavaragePivot points and levelsresistenceriskmangementsourcesupportTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?



Trusted Pine Programmer, I Provide Coding Services. For Inquiries
► Website muqwishi.com/home/quotation/
► Telegram t.me/MUQWISHI


⛾ Support My Work on “Buy Me a Coffee” buymeacoffee.com/muqwishi
또한 다음에서도:

면책사항