PROTECTED SOURCE SCRIPT

[joooey] Agamotto Levels

Overview

The [joooey] Agamotto Levels indicator is designed to identify and draw pivot levels on the chart, which include the full wick range of price highs and lows, on a user-defined fixed timeframe. It allows traders to visualize important support and resistance zones up to 6 months in the past, with an extension of lines up to 500 bars into the future.

Features

Customizable fixed timeframe for pivot point calculations.
User inputs for pivot high and low periods for precise control.
Visualization of the full wick range for pivot highs and lows.
Adjustable color and transparency for the drawn pivot zones.
Automatic limit on historical calculations (up to 6 months) and future extensions (up to 500 bars).

Input Parameters

Fixed Timeframe for Pivots

Title: Fixed Timeframe for Pivots
Type: timeframe
Default Value: 240 (4 hours)
Group: Settings
Tooltip: Sets the timeframe on which pivot points are calculated.
Pivot High and Low Periods

Left and Right Length for Highs
Titles: Pivot High, /
Type: int
Default Value: 10
Group: LENGTH LEFT / RIGHT
Tooltip: Sets the number of bars to the left and right for identifying pivot highs.
Left and Right Length for Lows
Titles: Pivot Low, /
Type: int
Default Value: 10
Group: LENGTH LEFT / RIGHT
Tooltip: Sets the number of bars to the left and right for identifying pivot lows.
Zone Color

Variable: zoneColor
Type: color
Default Value: color.orange with 40% transparency (color.new(color.orange, 60)).
Tooltip: Sets the color and transparency of the pivot zones.
How the Indicator Works
Pivot Calculations:

The indicator uses ta.pivothigh and ta.pivotlow functions to detect pivot highs and lows on the specified fixed timeframe.

It also calculates the highest high and lowest low (full wick) within the left and right length range.

Drawing Zones:

Horizontal lines are drawn at the calculated pivot levels and their respective full wick values.
These lines extend from the detected pivot point to up to 500 bars in the future for better visibility.

Historical and Future Limitations:

The indicator restricts line plotting to a period of up to 6 months in the past.
Future line extensions are capped at 500 bars from the current bar.

Code Snippets
Pivot Point Calculation:

ph = request.security(syminfo.tickerid, fixedTF, ta.pivothigh(leftLenH, rightLenH), lookahead=barmerge.lookahead_on)
pl = request.security(syminfo.tickerid, fixedTF, ta.pivotlow(leftLenL, rightLenL), lookahead=barmerge.lookahead_on)
Drawing Lines:

pinescript
Copy code

if not na(ph) and bar_index > (currentBarIndex - barsBack6Months)
line.new(x1=bar_index - leftLenH, y1=phWickHigh, x2=futureLimit, y2=phWickHigh, color=zoneColor, width=2, extend=extend.right)
line.new(x1=bar_index - leftLenH, y1=ph, x2=futureLimit, y2=ph, color=zoneColor, width=2, extend=extend.right)

if not na(pl) and bar_index > (currentBarIndex - barsBack6Months)
line.new(x1=bar_index - leftLenL, y1=pl, x2=futureLimit, y2=pl, color=zoneColor, width=2, extend=extend.right)
line.new(x1=bar_index - leftLenL, y1=plWickLow, x2=futureLimit, y2=plWickLow, color=zoneColor, width=2, extend=extend.right)

Usage Tips

Best Timeframes: This indicator is particularly useful on higher timeframes (e.g., 4-hour, daily) to identify significant support and resistance levels.

Limitations: Ensure to adjust the leftLenH, rightLenH, leftLenL, and rightLenL inputs based on the desired lookback period for identifying pivots.

Conclusion

The [joooey] Agamotto Levels indicator helps traders identify key pivot levels with enhanced visualization, allowing for better decision-making when analyzing support and resistance zones on charts.
Pivot points and levels

Script protegido

Este script se publica con código cerrado, pero puede utilizarlo libremente. Márquelo como favorito y podrá usarlo en un gráfico. El código fuente no se puede ver ni modificar.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad