Güncellendi
Monthly Returns Analytics [everget]

Hello friends,
Monthly Returns Analytics is a visual statistics toolkit for studying how an asset has performed month by month across multiple years.
Instead of calculating and comparing monthly returns by hand, the indicator measures every month from its opening price to its closing price and lets you examine the same history from seven perspectives: by calendar month, by quarter, by year as stacked columns or as lines, in time order, as a running waterfall, and as a distribution.
The month in progress is shown live and updates as price moves, but it is left out of the statistics until it closes.
🛠️ How It Works
The indicator reads the symbol's monthly bars and calculates the return of every calendar month as:
[Month Return] = (Close - Open) / Open × 100
Quarters and years run from their first month's open to their last month's close.
The Mode setting decides how these returns are laid out, and Years decides how far back the indicator looks, the current year included:
A few conventions hold across the modes:
By Month
Twelve groups, January to December, each with one column per year. Columns are green for gains and red for losses, so you can see at a glance whether a month tends to be positive and how much it varies from year to year. Hover over a month's name for each year's return, the mean and the median, and see the hint beside the groups for how to read them.
By Quarter
Four groups, Q1 to Q4, each with one column per year that stacks the quarter's three months in their calendar colors. Each month's price move is measured as a percentage of the quarter's opening price, with gains stacked up from zero and losses down, so the column adds up exactly to the quarter's return. When a quarter has both gains and losses, a line marks its net return, dashed while the quarter is still running. Hover over a quarter's name for each year's return, the mean and the median.
By Year, Stacked
One column per calendar year, the current one on the right, built from the year's months the same way: each month's move as a percentage of the year's opening price, gains up and losses down. The column adds up to the year's return and shows which months made or broke it, and a line marks the net return of years with both gains and losses. The Stats Table lists the return of every year.
By Year, Lines
One line per year through its monthly returns, January to December, each year in its own color, named in a legend and at the end of its line. Each point is that month's own return, not the year's running total, so the lines compare the seasonal shape of each year. The month in progress is a dashed segment, and the Stats Table lists the return of every year.
Sequential
Every month in the lookback in time order, colored by calendar month, with each year named under its January. This is the plain time series of monthly returns: turn on the regression line to see whether returns have been trending up or down, and watch how widely they swing from one period to the next.
Waterfall
Every month in the lookback as a step that starts where the previous one ended, so the steps trace the running sum of the monthly returns. Optional boxes enclose each calendar year, green when its months add up to a gain and red when they add up to a loss. The Stats Table shows the Sum of the monthly returns, which is where the last step ends, and their Compounded return, the gain or loss from holding through all of them. The two drift apart as swings grow: +50% followed by -50% sums to 0% but compounds to -25%.
Histogram
Every month in the lookback as a box labeled with its date, such as "Mar '24", stacked in the bin its return rounds to and colored by calendar month. It shows not only how often each range of returns occurred but also which months fell into it, including the outliers in the catch-all bins at either end. Bin Range sets how far the bins reach on each side of zero, and Bin Step how finely they slice the returns.
📊 Statistics
In "By Month", "By Quarter", "By Year, Lines" and "Sequential", reference lines can mark the Maximum, Minimum, Mean and Median of the finished periods across the whole pane, and the Mean plus and minus a multiple of the Standard Deviation. Their values also appear on the price scale. Maximum, Minimum and Mean are on by default.
A Regression Line can be fitted through each group in "By Month" and "By Quarter", and through all the columns in "By Year, Stacked" and "Sequential". Its slope shows whether returns have been improving or deteriorating over time. In "By Month" and "By Quarter", the group's tooltip then also shows its R²: how closely the returns follow that straight line, from 0 (not at all) to 1 (exactly).
The Stats Table in the bottom right corner summarizes the selected mode, with the period it covers in its title:
Max/Min Tags mark the highest and lowest finished returns:
⚙️ How to Use
Add the indicator to a chart of the symbol you want to study. The layout appears in its own pane, ending at the chart's last bar, so scroll to the latest bars if you don't see it, and zoom out until it fits.
Then pick the mode that answers your question:
I hope this tool becomes a useful addition to your market analysis workflow. If you have any feedback, ideas, or suggestions for future improvements, I'd be happy to hear them.
👋 Good luck and happy trading!
Monthly Returns Analytics is a visual statistics toolkit for studying how an asset has performed month by month across multiple years.
Instead of calculating and comparing monthly returns by hand, the indicator measures every month from its opening price to its closing price and lets you examine the same history from seven perspectives: by calendar month, by quarter, by year as stacked columns or as lines, in time order, as a running waterfall, and as a distribution.
The month in progress is shown live and updates as price moves, but it is left out of the statistics until it closes.
🛠️ How It Works
The indicator reads the symbol's monthly bars and calculates the return of every calendar month as:
[Month Return] = (Close - Open) / Open × 100
Quarters and years run from their first month's open to their last month's close.
The Mode setting decides how these returns are laid out, and Years decides how far back the indicator looks, the current year included:
- "By Month" and "By Quarter": one column per year in each group
- "By Year, Stacked" and "By Year, Lines": one column or line per year
- "Sequential", "Waterfall" and "Histogram": the last 12 × Years months
A few conventions hold across the modes:
- The newest column in each group is on the right.
- A hollow box with a dashed outline is the month in progress.
- MTD, QTD and YTD mark a month, quarter or year that is still running.
- Where boxes take the color of their calendar month, a legend in the top right corner names the colors.
By Month
Twelve groups, January to December, each with one column per year. Columns are green for gains and red for losses, so you can see at a glance whether a month tends to be positive and how much it varies from year to year. Hover over a month's name for each year's return, the mean and the median, and see the hint beside the groups for how to read them.
By Quarter
Four groups, Q1 to Q4, each with one column per year that stacks the quarter's three months in their calendar colors. Each month's price move is measured as a percentage of the quarter's opening price, with gains stacked up from zero and losses down, so the column adds up exactly to the quarter's return. When a quarter has both gains and losses, a line marks its net return, dashed while the quarter is still running. Hover over a quarter's name for each year's return, the mean and the median.
By Year, Stacked
One column per calendar year, the current one on the right, built from the year's months the same way: each month's move as a percentage of the year's opening price, gains up and losses down. The column adds up to the year's return and shows which months made or broke it, and a line marks the net return of years with both gains and losses. The Stats Table lists the return of every year.
By Year, Lines
One line per year through its monthly returns, January to December, each year in its own color, named in a legend and at the end of its line. Each point is that month's own return, not the year's running total, so the lines compare the seasonal shape of each year. The month in progress is a dashed segment, and the Stats Table lists the return of every year.
Sequential
Every month in the lookback in time order, colored by calendar month, with each year named under its January. This is the plain time series of monthly returns: turn on the regression line to see whether returns have been trending up or down, and watch how widely they swing from one period to the next.
Waterfall
Every month in the lookback as a step that starts where the previous one ended, so the steps trace the running sum of the monthly returns. Optional boxes enclose each calendar year, green when its months add up to a gain and red when they add up to a loss. The Stats Table shows the Sum of the monthly returns, which is where the last step ends, and their Compounded return, the gain or loss from holding through all of them. The two drift apart as swings grow: +50% followed by -50% sums to 0% but compounds to -25%.
Histogram
Every month in the lookback as a box labeled with its date, such as "Mar '24", stacked in the bin its return rounds to and colored by calendar month. It shows not only how often each range of returns occurred but also which months fell into it, including the outliers in the catch-all bins at either end. Bin Range sets how far the bins reach on each side of zero, and Bin Step how finely they slice the returns.
📊 Statistics
In "By Month", "By Quarter", "By Year, Lines" and "Sequential", reference lines can mark the Maximum, Minimum, Mean and Median of the finished periods across the whole pane, and the Mean plus and minus a multiple of the Standard Deviation. Their values also appear on the price scale. Maximum, Minimum and Mean are on by default.
A Regression Line can be fitted through each group in "By Month" and "By Quarter", and through all the columns in "By Year, Stacked" and "Sequential". Its slope shows whether returns have been improving or deteriorating over time. In "By Month" and "By Quarter", the group's tooltip then also shows its R²: how closely the returns follow that straight line, from 0 (not at all) to 1 (exactly).
The Stats Table in the bottom right corner summarizes the selected mode, with the period it covers in its title:
- "By Month", "Sequential" and "Histogram": the number of finished months and their Max, Min, Mean, Median and Stdev
- "By Quarter": the same for finished quarters
- "By Year, Stacked" and "By Year, Lines": the return of each year, from its first open to its last close
- "Waterfall": the Sum and the Compounded return of the months shown
Max/Min Tags mark the highest and lowest finished returns:
- "By Month" and "By Quarter": the best and worst year of each month or quarter, with the year and the return
- "By Year, Stacked": the best and worst year, with the return
- "By Year, Lines": the best and worst month across all the lines, with the date
- "Sequential": the best and worst month, with the date and the return
⚙️ How to Use
Add the indicator to a chart of the symbol you want to study. The layout appears in its own pane, ending at the chart's last bar, so scroll to the latest bars if you don't see it, and zoom out until it fits.
Then pick the mode that answers your question:
- Is March usually a good month? Use "By Month" and compare March's columns, mean and median.
- Which quarter carries the year? Use "By Quarter".
- Which months made or broke each year? Use "By Year, Stacked".
- How does this year compare with past years, month by month? Use "By Year, Lines".
- Are returns trending, or swinging more widely than before? Use "Sequential" with the regression line.
- How much does compounding change the total? Compare Sum and Compounded in the "Waterfall".
- How wide is the spread of returns, and how fat are the tails? Use the "Histogram".
- Monthly returns come from the symbol's monthly bars, so the lookback doesn't depend on how much history the chart has loaded. A symbol with a short history simply fills fewer columns.
- The month in progress updates with every price change until it closes, and so do the figures that include it: the MTD, QTD and YTD values, the Waterfall's Sum and Compounded, and its year box colors. It is left out of the statistics, Max/Min tags and regression lines. Finished months never change.
- The layout is positioned in bars, not dates, counting back from the last bar. On a chart with fewer bars than the layout needs, it extends past the last bar.
- Years is capped at 38 by TradingView's limit of 500 boxes per script.
- Monthly returns from each month's open to its close, read from the symbol's monthly bars
- 7 modes: "By Month", "By Quarter", "By Year, Stacked", "By Year, Lines", "Sequential", "Waterfall" and "Histogram"
- A lookback of 2 to 38 years
- Live tracking of the month in progress, kept out of the statistics until it closes
- Maximum, Minimum, Mean, Median and Standard Deviation lines, each with its own color, style and thickness
- Regression lines, with R² for the "By Month" and "By Quarter" groups
- Max/Min tags for the best and worst finished periods
- A Stats Table with figures for the selected mode
- Hover tooltips with each year's return, the mean and the median in "By Month" and "By Quarter"
- A waterfall with the sum and compounded return, and optional year boxes
- A histogram with an adjustable bin range and step
- Adjustable column width, spacing and colors, and separate sizes for the axis labels, hint, Stats Table and tags
- Settings grouped by mode, with the ones that don't apply to the selected mode greyed out
I hope this tool becomes a useful addition to your market analysis workflow. If you have any feedback, ideas, or suggestions for future improvements, I'd be happy to hear them.
👋 Good luck and happy trading!
Sürüm Notları
- Pine Script V6
Sürüm Notları
- Code refactoring
Sürüm Notları
- Renamed from "Combo Month-to-Month % Return" to "Monthly Returns Analytics"
- Added a "Mode" setting with seven views of the same monthly returns: "By Month" (the original layout), "By Quarter", "By Year, Stacked", "By Year, Lines", "Sequential", "Waterfall" and "Histogram"
- Monthly returns now come from the symbol's monthly bars, so the lookback no longer depends on how much history the chart has loaded
- The month in progress is now shown live, hollow with a dashed outline, and left out of the statistics until it closes
- Replaced "Maximum Columns per Chart" with "Years", now up to 38
- Added a Stats Table with figures for the selected mode: the count, Max, Min, Mean, Median and Stdev; the return of each year; or the waterfall's sum and compounded return
- Added Max/Min tags marking the highest and lowest finished returns
- Added an optional regression line through each group
- Replaced the per-month labels with month and quarter names along the bottom: hover over one to see each year's return, the mean, the median and, with the regression line on, its R²
- Replaced "Show Tooltip" with "Show Hint", and "Label Size" with separate sizes for the axis labels, hint, Stats Table and Max/Min tags
- Removed "Show Labels", "Show Label Details" and "Offset to Left"; the layout now ends at the last bar
- Columns are now boxes whose width is set in bars, 2 by default
- Bessel's correction is now on by default
- Added a dashed zero line, and color legends for the months and, in "By Year, Lines", the years
- Reorganized settings into general, per-mode and per-line sections, with context-aware controls and tooltips
- Input values are no longer shown in the status line
- Updated internal library dependencies
- Code refactoring for improved maintainability
Ücretli Alanda Mevcut
Bu gösterge yalnızca Trading Toolkit abonelerine açıktır. Bu komut dosyasına ve everget tarafından sunulan diğer komut dosyalarına erişmek için katılın.
👨🏻💻 Coding services -> Telegram: @alex_everget
🆓 List of my FREE indicators: bit.ly/2S7EPuN
Claim your $20 bonus just for joining Bybit!
bybit.com/invite?ref=56ZLQ0Z
🆓 List of my FREE indicators: bit.ly/2S7EPuN
Claim your $20 bonus just for joining Bybit!
bybit.com/invite?ref=56ZLQ0Z
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Ücretli Alanda Mevcut
Bu gösterge yalnızca Trading Toolkit abonelerine açıktır. Bu komut dosyasına ve everget tarafından sunulan diğer komut dosyalarına erişmek için katılın.
👨🏻💻 Coding services -> Telegram: @alex_everget
🆓 List of my FREE indicators: bit.ly/2S7EPuN
Claim your $20 bonus just for joining Bybit!
bybit.com/invite?ref=56ZLQ0Z
🆓 List of my FREE indicators: bit.ly/2S7EPuN
Claim your $20 bonus just for joining Bybit!
bybit.com/invite?ref=56ZLQ0Z
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.