OPEN-SOURCE SCRIPT
已更新

Average Daily % Change by Weekday

83
📊 Average Daily % Change by Weekday
This script calculates and displays the average daily percentage change for each weekday (Monday through Sunday) based on historical price data. It helps traders analyze which days tend to be bullish or bearish over a selected backtest date range.

✅ Features:
Customizable date range (From Year/Month/Day to To Year/Month/Day)

Calculates average % change for each weekday (Mon–Sun)

Supports assets that trade 7 days (e.g., crypto)

Color-coded outputs (green = positive, red = negative)

Final results shown as a table in the bottom-right corner

Works only on the 1D timeframe (daily)

🧠 How it works:

For each day within the selected date range:

The script calculates the % change as: (Close - Open) / Open * 100

Then, it groups the data by weekday and averages the values

This gives you insight into how each day of the week behaves historically for the current asset.

⚠️ Notes:
This script only works on daily (1D) timeframes.

For most accurate results, use it on assets with long trading history (e.g., BTCUSD).

Designed for educational and statistical analysis purposes.

發行說明
Update: "Avg Daily % Change by Weekday" Indicator v2

  • Added input option to enable or disable date range filtering for backtesting flexibility.


  • Refactored code to use arrays instead of multiple separate variables, improving efficiency and maintainability.


  • Added detailed statistics per weekday: Winrate, Average Winning %, Average Losing %.


  • Enhanced summary table with new columns showing count, winrate, average win/loss percentages.


  • Changed overlay to true for displaying on price chart.


  • Added validation to restrict script usage to daily timeframe only.


  • Improved color coding with transparency for better visual clarity.


  • Prepared plot of current day average change (commented out by default).


  • Added consolidated "ALL" row summarizing statistics across all weekdays.


This update improves analytical depth and usability of the indicator, enabling better weekday performance evaluation.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。