OPEN-SOURCE SCRIPT
تم تحديثه

Avi - 8 MA

147
Moving Averages (MA) Section
User Inputs:
The script lets you enable/disable and configure eight different moving averages. For each MA, you can choose:

The type: Simple Moving Average (SMA) or Exponential Moving Average (EMA)
The period (length)
The color used for plotting
Calculation:
A custom function (maFunc) calculates the MA value based on the selected type and length. Each moving average (from MA 1 to MA 8) is computed accordingly and then plotted on the chart.

2. EMA Cloud
Inputs:
There are inputs for a "Fast EMA" (default 8) and a "Slow EMA" (default 21).

Calculation & Plotting:
The script calculates the 8-period and 21-period EMAs. Although these EMAs are not directly plotted (they’re set with display.none), they are used to determine the market condition:

If the fast EMA is above the slow EMA, the area between them is filled with a greenish color.
If the fast EMA is below the slow EMA, the fill color turns reddish.
3. Buyer/Seller Pressure & ATR Calculations
Price Difference:
The script computes the difference between the close and open prices (as well as the percentage difference), which can be used as a measure of buyer vs. seller pressure.

ATR (Average True Range):
A 14-period ATR is calculated and then expressed as a percentage of the current close price. This gives a sense of volatility relative to the price level.

4. Volume Metrics & Relative Volume
Daily Volume & Averages:
The script retrieves daily volume data and computes a moving average for volume over a configurable length (default 20).

Relative Volume:
It calculates:

The average volume for the current period.
A relative volume multiplier comparing current volume to its moving average.
An estimated full-day volume based on the elapsed trading time, and checks if it will exceed the previous day’s volume.
The values are then formatted (e.g., converting to millions) for easier reading.
Conditional Formatting:
A background color is set based on whether the estimated relative volume is above or below a threshold.

5. Table Display
Purpose:
A table is created (position is configurable) to display key metrics:

14-day ATR percentage
Relative volume information (as a multiple and whether it exceeds the previous day)
Price difference (absolute and percentage change)
Style:
The table cells include conditional background and text colors to highlight different market conditions.

6. Pivot Points & Labels
Pivot Calculation:
The script calculates pivot highs and lows using user-defined left/right bar lengths.

Label Drawing:
When a pivot point is detected, a label is drawn on the chart to display its value. The style and colors for these labels are also configurable by the user.


Summary
This indicator script is quite comprehensive. It not only provides multiple moving averages and an EMA cloud to help visualize trend conditions but also includes features to assess market volatility, volume dynamics, and pivot levels—all of which are displayed neatly on the chart through plots and a customizable table. The commented-out gap detection code suggests that further features could be integrated if gap analysis is required.

If you have any specific questions or need further modifications, feel free to ask!





ملاحظات الأخبار
1. Moving Averages (MA) Section
User Inputs:
The script lets you enable/disable and configure eight different moving averages. For each MA, you can choose:

The type: Simple Moving Average (SMA) or Exponential Moving Average (EMA)
The period (length)
The color used for plotting
Calculation:
A custom function (maFunc) calculates the MA value based on the selected type and length. Each moving average (from MA 1 to MA 8) is computed accordingly and then plotted on the chart.

2. EMA Cloud
Inputs:
There are inputs for a "Fast EMA" (default 8) and a "Slow EMA" (default 21).

Calculation & Plotting:
The script calculates the 8-period and 21-period EMAs. Although these EMAs are not directly plotted (they’re set with display.none), they are used to determine the market condition:

If the fast EMA is above the slow EMA, the area between them is filled with a greenish color.
If the fast EMA is below the slow EMA, the fill color turns reddish.
3. Buyer/Seller Pressure & ATR Calculations
Price Difference:
The script computes the difference between the close and open prices (as well as the percentage difference), which can be used as a measure of buyer vs. seller pressure.

ATR (Average True Range):
A 14-period ATR is calculated and then expressed as a percentage of the current close price. This gives a sense of volatility relative to the price level.

4. Volume Metrics & Relative Volume
Daily Volume & Averages:
The script retrieves daily volume data and computes a moving average for volume over a configurable length (default 20).

Relative Volume:
It calculates:

The average volume for the current period.
A relative volume multiplier comparing current volume to its moving average.
An estimated full-day volume based on the elapsed trading time, and checks if it will exceed the previous day’s volume.
The values are then formatted (e.g., converting to millions) for easier reading.
Conditional Formatting:
A background color is set based on whether the estimated relative volume is above or below a threshold.

5. Table Display
Purpose:
A table is created (position is configurable) to display key metrics:

14-day ATR percentage
Relative volume information (as a multiple and whether it exceeds the previous day)
Price difference (absolute and percentage change)
Style:
The table cells include conditional background and text colors to highlight different market conditions.

6. Pivot Points & Labels
Pivot Calculation:
The script calculates pivot highs and lows using user-defined left/right bar lengths.

Label Drawing:
When a pivot point is detected, a label is drawn on the chart to display its value. The style and colors for these labels are also configurable by the user.

Summary
This indicator script is quite comprehensive. It not only provides multiple moving averages and an EMA cloud to help visualize trend conditions but also includes features to assess market volatility, volume dynamics, and pivot levels—all of which are displayed neatly on the chart through plots and a customizable table. The commented-out gap detection code suggests that further features could be integrated if gap analysis is required.

If you have any specific questions or need further modifications, feel free to ask!

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.