This algorithm is based on SMA (Simple Moving Average) to identify price trends, detecting "positive price zones" (where the price is above the SMA) and "negative price zones" (where the price is below the SMA), and then connecting turning points within those zones with lines.
Key Steps:
SMA Period Selection: The user can select the SMA period to be 5, 10, or 20.
SMA Calculation: The SMA of the current price is calculated based on the selected period.
Identify Positive and Negative Price Zones:
Positive Price Zone: When the closing price is higher than the SMA, it’s considered a positive price zone.
Negative Price Zone: When the closing price is lower than the SMA, it’s considered a negative price zone.
Identify Turning Points:
In the positive price zone, if the current closing price falls below the SMA, a potential turning point is detected, and the algorithm looks for the lowest point (the lowest high in that zone).
In the negative price zone, if the current closing price rises above the SMA, a potential turning point is detected, and the algorithm looks for the highest point (the highest low in that zone).
Connect the Turning Points:
When transitioning from the negative price zone to the positive price zone, a line is drawn from the lowest point of the negative zone to the highest point of the positive zone.
When transitioning from the positive price zone to the negative price zone, a line is drawn from the highest point of the positive zone to the lowest point of the negative zone.
Dynamic Updates: As new candles form, the algorithm continuously updates the turning points and draws the lines accordingly.
Key Features:
Flexible SMA Period Selection: The user can choose from different SMA periods (5, 10, or 20).
Dynamic Turning Point Recognition: The algorithm dynamically identifies turning points based on the relationship between the price and the SMA, marking fluctuations in price.
Connecting Turning Points: The algorithm connects the key points in positive and negative price zones with lines to help identify price trends.
Use Cases:
This algorithm is useful for technical analysis, especially for short-term trading.
It helps identify support and resistance levels, assisting users in making buy and sell decisions.