Anchored Square of 9 by AlgoCadosThe 'Anchored Square of 9 by AlgoCados' pine script indicator, leverages the non-discretionary, mathematical principles of W.D. Gann's Square of 9 for predicting vital support and resistance levels across all financial assets. Its mathematical precision and versatility make it a universally applicable tool, suitable for analysis of any financial asset without bias. Characterized by its adaptability to both high and low time frame analyses (HTF and LTF), this sophisticated indicator provides a structured, reliable method for market analysis, making it an essential asset for traders looking to apply a consistent and comprehensive approach across various market conditions and asset classes.
CME_MINI:NQH2024
Core Functionality
Anchored Price Point: The script allows users to define an anchor time and anchor point type (High, Low, Open, Close), serving as the basis for subsequent calculations. This flexibility enables precise adaptation to varying market conditions and analysis needs.
Angular Shifts and Projection: The indicator implements a range of angular shifts for LTF and HTF analyses, allowing for detailed and customizable projection of support and resistance levels. Angular shifts can range from 11.25° for finer intraday nuances up to 7200° for broader, long-term trend insights.
Mathematical Implementation
Anchor Point Selection: The script selects an anchor point based on user inputs for the anchor type and anchor time. This point serves as the basis for calculating deviations.
Angular Shift Calculation: The indicator calculates deviations by applying angular shifts to the square root of the anchor price. These deviations are used to project potential support and resistance levels.
Projection Lines and Labels: For each angular shift, the script generates projection lines and labels, which are dynamically adjusted as new data becomes available. This visual representation aids in identifying significant price levels.
CME_MINI:NQH2024
Key Features and Customization Options
Customizable Angular Shifts: Traders can enable or disable specific angular shifts to tailor the analysis to their trading strategy.
Projection Styles and Labels: Offers various styles (Solid, Dotted, Dashed) for equilibrium, upper shifts, and lower shifts lines, along with customizable label options (Levels, Prices, Levels + Prices) for enhanced clarity and information density.
Dynamic Labeling: Utilizes dynamic labeling for each projection line, indicating the angular degree and price level, facilitating a comprehensive understanding of potential market movements.
User-Friendly Inputs: Features user-defined inputs for anchor time and type, angular shifts, line styles, and labeling options, making the tool highly adaptable and intuitive.
Pine Script Technical Insight
Input Handling: The script incorporates a series of input controls to allow users to specify the anchor time, anchor type, and which angular shifts to display.
Line and Label Generation: Utilizes Pine Script's capabilities to dynamically generate and adjust projection lines and labels based on the calculated support and resistance levels.
Efficiency and Adaptability: Efficiently loops through a predefined set of angles, applying them to the anchored price point to calculate and project support and resistance levels, demonstrating the script's adaptability to both intraday and longer-term analysis.
Mathematical Formulation and Indicator Logic
Initial Setup and Inputs
The indicator starts by capturing user inputs for the anchor point—this can be a High, Low, Open, or Close price at a specified anchor time. These inputs determine the base price (P-base) from which all calculations are derived.
High if Anchor Type = "High"
Low if Anchor Type = "Low"
Open if Anchor Type = "Open"
Close if Anchor Type = "Close"
Angular Shifts and Projection Basis
The core of the "Anchored Square of 9" methodology involves calculating support and resistance levels through angular shifts applied to the Price-base (P-base).
The indicator enables a series of angular shifts, specified by the user, to project these levels dynamically.
Angular shifts are interpreted through the lens of Gann's theory, with each degree corresponding to a potential market turn or equilibrium point.
The script translates these angles into actionable projections using the square root of the anchor price, then applies the angular coefficients to find deviation points.
Angular Coefficients and Pi
In the context of the "Anchored Square of 9" indicator, angular shifts are crucial for projecting potential support and resistance levels. These shifts are quantified by angular coefficients derived from geometric principles, specifically leveraging the relationship between angles in degrees and their radian counterparts using π (Pi). Here's how angular coefficients are integrated:
Pi Reference for Angular Shifts: Given that 360° equates to 2π radians, angular coefficients (θ) for the indicator are calculated by translating degrees into a radian measure and then applying this measure to modify the square root of the base price (P-base).
Example of Angular Coefficients Shift:
A 180° shift corresponds to π radians. In the indicator's formula, this would translate to an angular coefficient of 1, since 180° = π in terms of π. Thus, applying this angular shift involves adding or subtracting 1 from the square root of P-base and then squaring the result to project a new price level.
Similarly, a 90° shift, equating to π/2, would have an angular coefficient equivalent to 0.5, reflecting its proportion of the circle (or square, in the context of Gann's geometry).
Implementation in Calculation of Deviations
Incorporating π into the formula for calculating deviations enriches the indicator's mathematical foundation, providing a direct link to geometric principles:
For each selected angular shift (θ), the script calculates positive and negative deviations from the square root of the anchor price. These deviations represent potential support and resistance levels.
P± = round (( sqrt root (P-base) ± θ)²)
Where:
P ± represents the calculated price levels for support (-) and resistance levels (+);
θ is the angular coefficient derived from the user-selected angular shifts;
sqrt root (P-base) is the square root of the base price;
round (⋅) ensures that the calculated levels are adjusted to the nearest tick size, maintaining relevance to actual trading scenarios.
Dynamic Projections and Visualization
The script generates lines and labels for these calculated levels, dynamically extending them as new market data becomes available. This feature ensures that traders have the most current and relevant information for decision-making.
For visualization:
Equilibrium Lines: Drawn at P-base to indicate the anchor or equilibrium point.
Support and Resistance Lines: Drawn at P- and P+, respectively, showing potential levels of market reaction
CME_MINI:NQH2024
Labeling and Style Customization
The indicator provides extensive customization for the appearance of projection lines and labels. Traders can select the line style, color, and text information (levels, prices, or both) to be displayed, tailoring the visual output to their preferences and trading strategy.
Implementation Details
This detailed approach to calculating support and resistance levels showcases the indicator's adherence to Gann's principles while leveraging modern computational methods to enhance trading analysis. By translating angular shifts into quantifiable projections, the "AlgoCados x Anchored Square of 9" indicator offers a powerful tool for identifying potential market movements with high precision.
The Pine Script implementation encapsulates this complex logic within a user-friendly interface, allowing traders to harness advanced analytical techniques within the TradingView platform. Through dynamic calculation and visualization, the indicator equips users with a deep understanding of market structures, enabling informed trading decisions based on mathematical projections.
Conclusion
The 'Anchored Square of 9 by AlgoCados' indicator merges mathematical precision with trading intuition, offering an advanced tool for traders seeking to leverage the time-tested principles of W.D. Gann's Square of 9. With its comprehensive set of features and customization options, it stands as a powerful addition to the TradingView platform, designed to enhance market analysis and decision-making for traders at all levels.
Embrace the essence of smarter trading where every insight is "Healthy For Your Trading."
Gannsquareofnine
Dynamic GANN Square Of 9 BandsDynamic GANN Square Of 9 Bands
Created on 3 Sept 2023
Adjust Increment Value:
Customize increment to match symbol and price characteristics for accuracy.
Green Line:
200 EMA. Identifies trend direction; moves with the prevailing trend.
Red Lines:
Mark prominent reversal levels closer to the red range; ideal for mean reversion strategies.
Crossing red levels may indicate trend continuation to the next red level.
Grey Lines:
Show immediate target reversal levels; watch for potential reversals.
Key Features:
Levels are different from Standard Deviation Lines.
Levels remain fixed and parallel, unaffected by volatility.
Despite its dynamism, it can serve as a leading indicator, revealing potential trend changes.
Primarily designed for trend-following strategies.
Additional Tips:
Use additional confirmations
Manage predefined risk and quantity
Additional Resources:
GANN Square Of 9 Pivots:
Gann Spiral / Square of 9The Gann Spiral, more commonly known as the Square of 9 is one of the most well known tools that Gann used. Today, it is most commonly used to find possible support and resistance levels, and possible reversals in time.
This indicator is a more flexible version of the traditional Gann Spiral / Square. This is achieved by allowing you to change:
Price and Time direction
The timeframe
How often to draw lines based on degrees
Toggles for Price and Time
Price and Time line customization
How to use:
1 - Select your desired starting value of Price and Time.
2 - Choose the direction of Price and Time.
3 - Choose the amount of lines to display.
4 - Choose how often for lines to be drawn (Rotation Degree Value).
==================================================================
Side Note:
This uses a more proper and more accurate formula to "navigate the square". (Sqr x + 2)^2 is not the formula used, but rather (Sqr x + 1)^2.
If you wish to use the formula you're used to, change Full Revolution Value to 180.
The reasoning behind this formula change is because I re-created the square in the form of an actual spiral. The issue with such a conversion is that the formula used to construct it uses one Pi. If you understand circles, you should know that we're off by 180 degrees. A full rotation is 360, not 180.
Correcting for this error requires a slight but important change in the formula, that being +1 instead of +2. This not only corrects it to fit for a proper spiral, but also makes it easier to use fractions. 1/360 results in 1 degree. This slight formula change makes it incompatible when used on the actual Square of 9, however it is technically the more accurate formula.
Gann Square This indicator build by Gann Square of 19.
you select start and end of big trend in daily timeframe and calculate date range.
by draw trend line in Gann square and enter the numbers cross by line in settings input you could recognize future pivot points
remember : first) this tool worked only in daily timeframe. second) better using this in dark theme :)
chart example :
Magic levelsIt is by far the simplest on chart presentation of Gann square of 9. It calculates the levels based on previous day closing. These levels usually acts as support and resistance.
Degree Gann NumbersThe script plots numbers from Cardinal & Ordinal lines of Gann square of 9 for a given range. Inputs required are the degree of cardinal or Ordinal line & Range Min & Max Number.
For example, if we want to plot 45-225-degree Ordinal line numbers from Gann square of 9, on the chart for a range of 50 to 600, Input for the degree will be 45 & Range Min =50 / Range Max = 600
if we want to plot 90-270-degree Cardinal line numbers on the chart for a range of 50 to 600, Input for the degree will be 90 & Range Min =50 / Range Max = 600
Gann Square of 9Gann's Square's are some of the best known tools created by Gann. His most well known square was his Square of 9.
The reason for this was because of the symmetry 9 had with itself. Gann was able to balance both price and time with this symmetry.
- 9 is the last single-digit and largest number
- You can add anything to 9 and it will give you a natural number
- (9 + 3 = 12); 1 + 2 = 3... (9 + 9 = 18); 1 + 8 = 9... etc.
- Multiplying any number by 9 will have the natural number be 9
- (9 * 6 = 54); 5 + 4 = 9... (9 * 3 = 27); 2 + 7 = 9... etc.
For these reason, Gann claimed that 9 has everything within itself.
Here I have created an on-chart square of 9 including the cardinal and ordinal cross points colored. In the settings you are able to customize the starting value of the table as well as the period movement. In most cases, 81 is not high enough to be useful in charting cases, so I'd recommend printing out your own Gann Square of 9 that goes as high as you need it to go.
THIS IS NOT TRADING ADVICE ; please use your own technical analysis before making any decisions based off of public indicators. Learn more about Gann's Squares before attempting to use them as this script was not meant to give you answers, only the table.
GANN Square Of 9 PivotsGANN Square Of 9 Pivots
How to use for Intraday ?
Method 01 (From 9:05 am to 9:15 am or pre-open market)
Take the Weighted Average Price or Volume Weighted Average Price (VWAP) or Time Weighted Average Price (TWAP) of any stock or index.
You can use TWAP for Index as volume is not available.
Method 02 (From 9:05 am to 9:15 am or pre-open market)
Take the Last Traded Price (LTP) of index or stock
Method 03 (After 9:30 am or after 1st 15 min)
Only take Last Traded Price (LTP) of stock or index
Ideal Time
15min to 1hr after market opens
Indicator Features
Lines
Gray Dashed Line: Calculation Price
Teal Solid Line: Long Above
Red Solid Line: Short Below
3 Teal Dotted Lines: Bullish Targets 1, 2 & 3
3 Red Dotted Lines: Bearish Targets 1, 2 & 3
Labels
1st Numbers: Price
2nd Numbers in (): % change from LTP to that Level
For Index
As VWAP is not available for Index, TWAP (Time Weighted Average Price) values can be used for Index.
Custom Price Inputs
Price of your choice can be given manually by selecting:
Source > Custom
Enter Price > (type the price)
Timeframe
Higher timeframes like Weekly, Monthly can be changed using Timeframe Option
For More Reading
Reading: traderji.com/community/threads/intraday-trading-using-gann-calculator.39185/#post-419677
Calculator: stockmaniacs.net/freebies/free-tools/gann-square-of-9-calculator/
Gann Square of 9(For Bursa Malaysia only)
This indicator will display nearest support and resistance from Gann Square of 9 Box.
Red line (Strongest)
Resistance
Support
Blue line (Moderate)
Act as support and resistance
Only workable for price lower than RM18.
Gann Bursa Malaysia Ver1Gann Square of 9 is a spiral of numbers starting with the number one in the center.
The numbers spiral around the center in a clockwise manner to the number 9, which completes the first cycle around the center.
Square of 9 Wheel is one of the popular market tools of legendary trader W.D. Gann
Based on Gann Square of 9, this indicator automatically plot the lines which act as support and resistance .
Red Line - very strong support/resistance
Blue Line - strong support/resistance
Notes :
These indicator only suitable for Bursa Malaysia.
Currently Only Cover Price Range( RM ) from 0.020 - 2.50
gannsquareof9chart2This Indicator works on W.D.Gann Square of 9 chart
gann works on SQUARES: ODD and EVEN
HIGH and LOW of this chart will be the " SQUARES "
this chart provides 7 major and 8 minor levels in between the ODD or EVEN Squares .
major levels are colored in blue and white respectively.
minor levels are colored in olive .
better visibility in dark background
change the color of the levels according to your requirement.
Once the HIGH or LOW (or SQUARES) breaks The next ODD or EVEN SQUARES open up ,
As the breakout of Squares happens the chart expands and acquire the new HIGH or LOW.
I have given Three different resolution option user can switch between:
DAILY ; WEEKLY ; MONTHLY .
thankyou