The "Williams Fractals and Alligator" indicator is a technical analysis tool that combines two essential concepts: Williams Fractals and the Alligator oscillator, which help traders identify potential reversal points and trends in price action.
Components of the Indicator:
Fractals:
Definition: Fractals are patterns that indicate price reversals. An up fractal is formed when there is a high point surrounded by lower highs, while a down fractal is formed with a low point surrounded by higher lows.
User Input: The user can define the period for identifying fractals via an input parameter (n). The default value is set to 2.
Calculation Logic: The indicator uses nested loops to compare the current price against previous and subsequent prices based on the specified period. If the conditions for a fractal are met, it generates a signal.
Alligator:
Definition: The Alligator indicator consists of three lines: the Jaw, Teeth, and Lips, which represent different smoothed moving averages of the price.
User Input: Users can customize the length and offset of each of the Alligator lines:
Jaw Length: Default value of 13
Teeth Length: Default value of 8
Lips Length: Default value of 5
Offsets for each line adjust how far ahead the lines are plotted.
Calculation Logic: The indicator employs a custom Smoothed Moving Average (SMMA) function to calculate the values of the Jaw, Teeth, and Lips using the price source (typically the average of the high and low).
Plotting:
The indicator plots up fractals as upward triangles above the price bars (in teal) and down fractals as downward triangles below the price bars (in red).
The Alligator lines are plotted in different colors:
Jaw: Blue
Teeth: Red
Lips: Green
Each line is plotted with the ability to offset visually on the chart.
Purpose of the Indicator:
The primary use of this indicator is to identify potential entry and exit points in trading based on the fractal patterns while considering the prevailing trend indicated by the Alligator’s three lines.
Up fractals may signal potential buy opportunities, especially when positioned in an uptrend indicated by the Alligator lines.
Conversely, down fractals may signal potential sell opportunities, particularly in a downtrend.
Conclusion:
The "Williams Fractals and Alligator" indicator serves as a comprehensive tool for traders, combining fractal-based reversal signals with trend-following dynamics through the Alligator oscillator, thereby enhancing decision-making in trading strategies.