The Alligator indicator is a technical analysis tool used to identify trends and their direction in financial markets, it was invented by trader Bill Williams who was a well-known trader and author of several books on trading and technical analysis. He introduced the Alligator indicator in his book titled "Trading Chaos" which was published in 1995. The indicator consists of three moving averages, each representing a different aspect of market behaviour, and is designed to help traders identify trends and potential entry and exit points.
Alligator Indicator Calculation
The Alligator indicator consists of three smoothed moving averages shifted by different periods of time using three moving averages known as the "Jaw," "Teeth," and "Lips" of the Alligator.
1. Jaw (Blue Line)
- This is calculated using the Smoothed Moving Average (SMA) over 13 periods, shifted by 8 bars into the future.
- Formula: Jaw = SMMA(High + Low) / 2, shifted 8 bars into the future.
2. Teeth (Red Line)
- This is calculated using the Smoothed Moving Average (SMA) over 8 periods, shifted by 5 bars into the future.
- Formula: Teeth = SMMA(High + Low) / 2, shifted 5 bars into the future.
3. Lips (Green Line)
- This is calculated using the Smoothed Moving Average (SMA) over 5 periods, shifted by 3 bars into the future.
- Formula: Lips = SMMA(High + Low) / 2, shifted 3 bars into the future.
Where:
- High is the highest price during the period.
- Low is the lowest price during the period.
- SMMA stands for Smoothed Moving Average, which is a moving average that takes into account previous values and current values to provide a smoother result.
These three lines together create the Alligator indicator and when the lines are close together, it suggests a dormant market (no trend), but when the lines are diverging, it indicates a trending market. The direction of the trend is determined by the relative positioning of the three lines.
Word of Warning
Like any technical indicator, the Alligator Indicator is not perfect and may produce false signals, therefore, it's often used together with other indicators and analysis methods to confirm trading decisions.
How To Trade Using the Alligator Indicator?
This simple strategy includes only the basic signals for entering a trade, additional logic can be added for a more robust system:
- If the green line (lips) is above the red one (teeth) and the red line (teeth) is above the blue one (Jaw), there is an upward trend in the market and the cBot opens a buy trade.
- If the green line is below the red one and the red line is below the blue one, and all three lines move down, there is a downward trend in the market and the cBot opens a sell trade.
- In other cases, when lines crisscross each other (or very close to each other) the cBot will wait until the market stops being flat.
You should also pay attention to the distance between the lines. If it increases, the trend is getting stronger and if it decreases then the trend is getting weaker.
How to Improve this Strategy
There are many ways to improve this strategy, the first one is to check if the lips, teeth and jaw lines are moving up or down. You can also add additional indicators for confirmation or additional risk management like market hours, trailing stop losses etc. If you cannot add these extra features yourself contact us.
Stop Loss & Take Profit Calculation
A standard stop loss and take profit as well as position size can be set from the cBots parameter settings.
You can add risk management and other trade rules yourself or by contacting our development team.
How to Optimise the Settings
We have also created a simple video showing how you can run cTrader Automate Optimisation for the Alligator cBot to find the optimal parameter values.
How to Attach Indicator to Chart
You do not need to attach the Alligator indicator to your chart when you run the cBot, but it is a good idea to visually see the indicator to check your trade rules for opening and closing trades and any risk management.
How To View The Source Code
To view the source code for this cBot, you will first need to make sure you have downloaded and installed cTrader Desktop, you can also scroll to the bottom of this page for instructions on how to install the cBot. Once installed you will have the cTrader application open, you need to navigate to the Automate application and click on the name of the cBot, the source should show in the right-hand window.
If you need more help watch a video tutorial on how to use cTrader Automate.
Learn Algorithmic Trading
In this instructional guide, we aim to assist you in acquiring the necessary skills to engage in market trading through automated trading strategies (cBots) using the cTrader Desktop trading platform. By the conclusion of this tutorial, you will gain the confidence to employ a cTrader cBot alongside the Algo application of cTrader, enabling you to automatically execute and handle your market orders. This course is designed to familiarize novice traders with the fundamental principles of algorithmic trading utilizing the cTrader platform.
Learn Microsoft C# for Algo Trading
If you are new to coding your own cTrader cBot for automated trading the following Microsoft C# course will help you modify the starter kit cBot in this download to add new features for your own personal trading strategy.
Algorithmic Trading Facts
A significant number of traders venture into algorithmic trading with the misconception that they have discovered a foolproof strategy that guarantees effortless wealth. However, this notion is far from reality. It is crucial to read this article, as it can save you valuable time and money.
How To Install & Remove
First, make sure you have the cTrader trading platform installed and then simply unzip the file and double-click on it to automatically install it onto the platform.
Any Questions?
If you have any questions, please first search our coding help forum for the answer, if you cannot find it, post a new question.
Need Coding Help?
We can help you modify this cBot for your own personal trading strategy, Contact our team for a quote.
Need a Broker
If you are still looking for a broker you can trust, take a look at our best cTrader broker site.