OPEN-SOURCE SCRIPT

Newday_sma

ที่อัปเดต:
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.





เอกสารเผยแพร่
This Pine Script code is designed to plot "turning point fluctuations" on a trading chart. It identifies price reversal points (from bullish to bearish and vice versa) based on the relationship between the current price and different simple moving averages (SMAs). Here's a breakdown of its functionality:

Key Features:
User-Selectable SMA Versions:

The user can choose between SMA5, SMA10, or SMA20 for determining the price trend.
This allows users to adjust the sensitivity of trend detection by switching between shorter (SMA5) and longer (SMA10 or SMA20) moving averages.
Bullish and Bearish Zone Detection:

The script tracks "bullish" (price above SMA) and "bearish" (price below SMA) zones.
When the price moves from a bearish zone to a bullish zone, the script identifies a potential turning point and draws a line connecting the low of the bearish zone to the high of the bullish zone.
Similarly, when moving from a bullish zone to a bearish zone, the script draws a line connecting the high of the bullish zone to the low of the bearish zone.
Line Drawing:

The script dynamically draws lines connecting the identified turning points (highs and lows) between the zones.
The user can adjust the color and width of these lines and the SMAs.
Plotting SMAs:

It plots three different SMAs (SMA5, SMA10, SMA20) on the chart to visually show the trends based on different periods.
Users can change the color and line width of these SMAs.
How It Works:
The code scans the most recent 100 bars (candlesticks) on the chart.
If the closing price is above the selected SMA, it marks the price as in a "bullish zone."
If the closing price is below the selected SMA, it marks the price as in a "bearish zone."
When the price transitions from bearish to bullish or vice versa, it draws lines connecting the turning points.
Parameters:
SMA Version: Choose between SMA5, SMA10, or SMA20 to define the trend detection period.
Line Color: Set the color of the lines that connect turning points.
Line Width: Adjust the thickness of the lines.
SMA Line Color: Customize the colors for the three different SMAs.
SMA Line Width: Adjust the thickness of the plotted SMA lines.
Purpose:
This script is primarily used for detecting and visualizing price reversal points in the market based on SMA trends. Traders can use it to spot potential turning points where the market changes direction, making it a useful tool for trend analysis and decision-making.






เอกสารเผยแพร่
Code Explanation:
max_bars is limited to 178: This controls the maximum number of bars to be analyzed for trend detection. Only the last 178 bars are considered.
math.min(max_bars - 1, bar_index): This ensures that the analysis doesn't exceed the available number of bars.
Turnover Point Logic: The code calculates turning points for trend changes, drawing lines between points of trend reversal to help visualize bullish and bearish zones.
Purpose:
This script helps detect the trend (bullish or bearish) based on the relationship between the price and the selected SMA (Simple Moving Average). The trend is analyzed within the most recent 178 bars. When the price moves above or below the SMA, a turning point is identified, and lines are drawn to mark these points, which can assist in visualizing trend reversals
Candlestick analysis

สคริปต์โอเพนซอร์ซ

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถเข้าใจและตรวจสอบได้ ต้องขอบคุณผู้เขียน! ที่ให้คุณใช้ได้ฟรี แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?

คำจำกัดสิทธิ์ความรับผิดชอบ