Sessions RangesAn indicator that displays each trading session. Each box represents a single session (Asian, London and NY) and their respective overlaps.
Поиск скриптов по запросу "Cycle"
BRT Trading Hours CryptoBackground to let you know when it's weekend days and when it's between 8am and 12pm in BRT timezone for studies.
Risk Indicator OverlayInvestigates relationship between various moving averages for different crypto assets. Displays risk based on historical data. Can be used together with "Risk Indicator"
Risk IndicatorInvestigates relationship between various moving averages for different crypto assets. Displays risk based on historical data. Can be used together with "Risk Indicator Overlay"
MACRO BTC HEALTH 1WThis indicator is used as MACRO tool to view the outlook of BTC on the 1W time frame to illustrate (BLX chart works best)
BTC's price action and where it's at, it helps provide an indication of the crypto market's current health as BTC health is an overall indicator in the crypto market as a whole.
This indicator uses historic data to fit between 4 bands fitted to MA, top(red) when BTC is overheated, 2 bands in middle(yellow) when BTC in fair value, and bottom band(blue) when BTC is oversold  
I combined MA that fit BTC 1W chart precisely to show when BTC looks overheated vs over sold using historic data. 
When BTC is in the top bands historically overheated.
When BTC is in the middle it is fighting at fair value with the 2 yellow lines in the middle, bullish when above yellow lines, as they act as support, and in downtrend when price is below yellow lines and can act as resistance.
Historically the 200W MA is where BTC finds support at an oversold level at the bottom blue line.
When two yellow lines in middle cross downwards historically results in a downtrend to the bottom oversold line (blue). and when two yellow lines cross up and BTC holds them as support bullish trend continues until it is overheated passed the red band.
This indicator is not meant for day trading but is meant to illustrate a MACRO view of BTC current situation from a zoomed-out view, and to help illustrate to investors where things are at so they leave emotions out of the market and can make decisions based on BTC current levels using Historic data. Pro tip use bottom line(blue, oversold) as an opportunity to buy in and top line red(overheated) to scale out of positions, LONG TERM CRYPTO IS BULLISH BUT GREAT TO GET AN OUTLOOK OF THE CURRENT STATE OF BTC, WHILE ALSO USING MACRO ECONOMIC SENTIMENT IRL, FUNDAMENTAL ECONOMIC DECISIONS, ECONOMIC CONDITIONS/ENVIRONMENT, ECONOMIC HEALTH ,FED DECISIONS, INTEREST RATE ENVIRONMENT AND OF COURSE LOOKING AT CRYPTO ADOPTION.  
Hope this indicator helps leave emotions out of the market by providing a good guide of BTC sentiment, and its current health to make decisions accordingly.  NFA but good to envision the MACRO BTC HEALTH at the 1W timeframe.
NY Session in REDNY is Red from UK time 1200 to 1800.
The rest is white, helps distinguish me NY with non NY since I like trading NY session 
Bar CountBar Count Indicator for TradingView. It will label bars with numbers underneath which is awesome when sharing analysis or waiting for bars 7 (50% chance), 12 (70% chance), and 18 (90% chance) looking for higher probability for the High or Low of the day to have formed.  
HTF Candle Countdown Timer//@version=5
indicator("HTF Candle Countdown Timer", overlay=true)
// ============================================================================
// INPUTS - SETTINGS MENU
// ============================================================================
// --- Mode Selection ---
mode = input.string(title="Mode", defval="Auto", options= , 
     tooltip="Auto: Αυτόματη αντιστοίχιση timeframes\nCustom: Επιλέξτε το δικό σας timeframe")
// --- Custom Timeframe Selection ---
customTF = input.timeframe(title="Custom Timeframe", defval="15", 
     tooltip="Ενεργό μόνο σε Custom Mode")
// --- Table Position ---
tablePos = input.string(title="Table Position", defval="Bottom Right", 
     options= )
// --- Colors ---
textColor = input.color(title="Text Color", defval=color.white)
bgColor = input.color(title="Background Color", defval=color.black)
transparentBg = input.bool(title="Transparent Background", defval=false, 
     tooltip="Ενεργοποίηση διάφανου φόντου")
// --- Text Size ---
textSize = input.string(title="Text Size", defval="Normal", 
     options= )
// ============================================================================
// FUNCTIONS
// ============================================================================
// Μετατροπή string position σε table position constant
getTablePosition(pos) =>
    switch pos
        "Top Left" => position.top_left
        "Top Right" => position.top_right
        "Bottom Left" => position.bottom_left
        "Bottom Right" => position.bottom_right
        => position.bottom_right
// Μετατροπή string size σε size constant
getTextSize(size) =>
    switch size
        "Auto" => size.auto
        "Tiny" => size.tiny
        "Small" => size.small
        "Normal" => size.normal
        "Large" => size.large
        "Huge" => size.huge
        => size.normal
// Αυτόματη αντιστοίχιση timeframes
getAutoTimeframe() =>
    currentTF = timeframe.period
    string targetTF = ""
    
    if currentTF == "1"
        targetTF := "15"
    else if currentTF == "3"
        targetTF := "30"
    else if currentTF == "5"
        targetTF := "60"
    else if currentTF == "15"
        targetTF := "240"
    else if currentTF == "60"
        targetTF := "D"
    else if currentTF == "240"
        targetTF := "W"
    else
        // Default fallback για μη-mapped timeframes
        targetTF := "60"
    
    targetTF
// Μετατροπή timeframe string σε λεπτά για σύγκριση
timeframeToMinutes(tf) =>
    float minutes = 0.0
    
    if str.contains(tf, "D")
        multiplier = str.tonumber(str.replace(tf, "D", ""))
        minutes := na(multiplier) ? 1440.0 : multiplier * 1440.0
    else if str.contains(tf, "W")
        multiplier = str.tonumber(str.replace(tf, "W", ""))
        minutes := na(multiplier) ? 10080.0 : multiplier * 10080.0
    else if str.contains(tf, "M")
        multiplier = str.tonumber(str.replace(tf, "M", ""))
        minutes := na(multiplier) ? 43200.0 : multiplier * 43200.0
    else
        minutes := str.tonumber(tf)
    
    minutes
// Format countdown σε ώρες:λεπτά:δευτερόλεπτα ή λεπτά:δευτερόλεπτα
formatCountdown(milliseconds) =>
    totalSeconds = math.floor(milliseconds / 1000)
    hours = math.floor(totalSeconds / 3600)
    minutes = math.floor((totalSeconds % 3600) / 60)
    seconds = totalSeconds % 60
    
    string result = ""
    
    if hours > 0
        result := str.format("{0,number,00}:{1,number,00}:{2,number,00}", hours, minutes, seconds)
    else
        result := str.format("{0,number,00}:{1,number,00}", minutes, seconds)
    
    result
// Μετατροπή timeframe σε readable format
formatTimeframe(tf) =>
    string formatted = ""
    
    if str.contains(tf, "D")
        formatted := tf + "aily"
    else if str.contains(tf, "W")
        formatted := tf + "eekly"
    else if str.contains(tf, "M")
        formatted := tf + "onthly"
    else if tf == "60"
        formatted := "1H"
    else if tf == "240"
        formatted := "4H"
    else
        formatted := tf + "min"
    
    formatted
// ============================================================================
// MAIN LOGIC
// ============================================================================
// Επιλογή target timeframe βάσει mode
targetTimeframe = mode == "Auto" ? getAutoTimeframe() : customTF
// Validation: Έλεγχος αν το target timeframe είναι μεγαλύτερο από το τρέχον
currentTFMinutes = timeframeToMinutes(timeframe.period)
targetTFMinutes = timeframeToMinutes(targetTimeframe)
var string warningMessage = ""
if targetTFMinutes <= currentTFMinutes
    warningMessage := "⚠ HTF < Current TF"
else
    warningMessage := ""
// Υπολογισμός του χρόνου κλεισίματος του HTF candle
htfTime = request.security(syminfo.tickerid, targetTimeframe, time)
htfTimeClose = request.security(syminfo.tickerid, targetTimeframe, time_close)
// Υπολογισμός υπολειπόμενου χρόνου σε milliseconds
remainingTime = htfTimeClose - timenow
// Format countdown
countdown = warningMessage != "" ? warningMessage : formatCountdown(remainingTime)
// Format timeframe για εμφάνιση
displayTF = formatTimeframe(targetTimeframe)
// ============================================================================
// TABLE DISPLAY
// ============================================================================
// Δημιουργία table
var table countdownTable = table.new(
     position=getTablePosition(tablePos), 
     columns=2, 
     rows=2, 
     bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
     frame_width=1,
     frame_color=color.gray,
     border_width=1)
// Update table content
if barstate.islast
    // Header
    table.cell(countdownTable, 0, 0, "Timeframe:", 
         text_color=textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
    
    table.cell(countdownTable, 1, 0, displayTF, 
         text_color=textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
    
    // Countdown
    table.cell(countdownTable, 0, 1, "Countdown:", 
         text_color=textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
    
    table.cell(countdownTable, 1, 1, countdown, 
         text_color=warningMessage != "" ? color.orange : textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
// ============================================================================
// END OF SCRIPT
// ============================================================================
VWMA Series (Dynamic) mtf - Dual Gradient Colored"VWMA Series (Dynamic) mtf - Dual Gradient Colored" is a multi-timeframe (MTF) Volume-Weighted Moving Average (VWMA) ribbon indicator that plots up to 60 sequential VWMAs with arithmetic progression periods (e.g., 1, 4, 7, 10…).  Each VWMA line is dual-gradient colored:  Base hue = Greenish (#2dd204) if close > VWMA (bullish), Magenta (#ff00c8) if close < VWMA (bearish)  
Brightness gradient = fades from base → white as period increases (short → long-term)
Uses daily resolution by default (timeframe="D"), making it ideal for higher-timeframe trend filtering on lower charts.Key FeaturesFeature
Description
Dynamic Periods
Start + i × Increment → e.g., 1, 4, 7, 10… up to 60 terms
Dual Coloring
Bull/Bear + Gradient (short = vivid, long = pale)
MTF Ready
Plots daily VWMAs on any lower timeframe (1H, 15M, etc.)
No Lag on Long Sets
Predefined "best setups" eliminate repainting/lag
Transparency Control
Adjustable line opacity for clean visuals
Scalable
Up to 60 VWMAs (max iterations)
Recommended Setups (No Lag)Type
Example Sequence (Start, Inc, Iter)
Long-Term Trend
1, 3, 30 → 1, 4, 7 … 88
93, 3, 30 → 93, 96 … 180
372, 6, 30 → 372, 378 … 546
Short-Term Momentum
1, 1, 30 → 1, 2, 3 … 30
94, 2, 30 → 94, 96 … 152
1272, 5, 30 → 1272, 1277 … 1417
Key Use CasesUse Case
How to Use
1. Multi-Timeframe Trend Alignment
On 1H chart, use 1, 3, 30 daily VWMAs → price above all green lines = strong uptrend
2. Dynamic Support/Resistance
Cluster of long-term pale VWMAs = major S/R zone
3. Early Trend Change Detection
Short-term vivid lines flip from red → green before longer ones = early bullish signal
4. Ribbon Compression/Expansion
Tight bundle → consolidation; fanning out → trend acceleration
5. Mean Reversion Entries
Price far from long-term VWMA cluster + short-term reversal = pullback trade
6. Volume-Weighted Fair Value
Long-period VWMAs reflect true average price paid over weeks/months
Visual Summary
Price ↑
  ████  ← Short VWMA (vivid green = close > VWMA)
   ███
    ██
     █
    . . . fading to white
     █
    ██
   ███
  ████  ← Long VWMA (pale = institutional average)
Green lines = price above VWMA (bullish bias)  
Magenta lines = price below VWMA (bearish bias)  
Gradient = shorter (left) → brighter; longer (right) → whiter  
Ribbon thickness = trend strength (wide = strong, narrow = weak)
Best For  Swing traders using daily trend on intraday charts  
Volume-based strategies (VWMA > SMA)  
Clean, colorful trend visualization without clutter  
Institutional fair value anchoring via long-period VWMAs
Pro Tip:
Use Start=1, Increment=3, Iterations=30 on a 4H chart with timeframe="D" → perfect daily trend filter with zero lag and beautiful gradient flow.
Central Banks Balance Sheets ROI% ChangeIntroducing the  "Central Banks Balance Sheets ROI% Change"  indicator, a tool designed to offer traders and analysts an understanding of global liquidity dynamics. 
This indicator tracks the Return on Investment (ROI) percentage changes across major central banks' balance sheets, providing insights into shifts in global economic liquidity not tied to cumulative figures but through ROI calculations, capturing the pulse of overall economic dynamics.
 Key Enhancements: 
     ROI Period Customization:  Users can now adjust the ROI calculation period, offering flexibility to analyze short-term fluctuations or longer-term trends in central bank activities, aligning with their strategic time horizons.
  
     Chart Offset Feature:  This new functionality allows traders to shift the chart view, aiding in the alignment of data visualization with other indicators or specific analysis needs, enhancing interpretive clarity.
     Central Bank Selection:  With options to include or exclude data from specific central banks among the world's top 15 economies (with the exception of Mexico and the consolidation of the EU's central bank data), traders can tailor the analysis to their regional focus or diversification strategies.
     US M2 Option:  Recognizing the significance of the M2 money supply as a liquidity metric, this indicator offers an alternative view focusing solely on the US M2, allowing for a concentrated analysis of the US liquidity environment.
  
     Comprehensive Coverage:  The tool covers a wide array of central banks, including the Federal Reserve, People's Bank of China, European Central Bank, and more, ensuring a broad and inclusive perspective on global liquidity.
     Visualization Enhancements:  A histogram plot vividly distinguishes between positive and negative ROI changes, offering an intuitive grasp of liquidity expansions or contractions at a glance.
This indicator is a strategic tool designed for traders who seek to understand the undercurrents of market liquidity and its implications on global markets. 
Whether you're assessing the impact of central bank policies, gauging economic health, or identifying investment opportunities, the "Central Banks Balance Sheets ROI% Change" indicator offers a critical lens through which to view the complex interplay of global liquidity factors.
Tesla Coil MLThis is a re-implementation of @veryfid's wonderful Tesla Coil indicator to leverage basic Machine Learning Algorithms to help classify coil crossovers. The original Tesla Coil indicator requires extensive training and practice for the user to develop adequate intuition to interpret coil crossovers. The goal for this version is to help the user understand the underlying logic of the Tesla Coil indicator and provide a more intuitive way to interpret the indicator. The signals should be interpreted as suggestions rather than as a hard-coded set of rules. 
NOTE: Please do NOT trade off the signals blindly. Always try to use your own intuition for understanding the coils and check for confluence with other indicators before initiating a trade.
Rolling 250-Day Sharpe RatioThis Pine Script indicator, “Rolling 250-Day Sharpe Ratio”, computes the trailing Sharpe Ratio for any traded asset over a 250-session window, equivalent to approximately one trading year. The script first derives daily log returns and adjusts them by subtracting the daily equivalent of the 3-month US Treasury yield to obtain the excess return. It then calculates the rolling mean and standard deviation of these excess returns to produce the annualized Sharpe Ratio, which is displayed as a continuous time series on the chart. This allows traders and analysts to assess how the asset’s risk-adjusted performance evolves over time relative to a risk-free benchmark.
A persistently high Sharpe Ratio can indicate strong risk-adjusted returns, but it is essential to approach extreme values with caution. Elevated Sharpe readings can sometimes reflect unsustainable trends, excessive leverage, or periods of unusually low volatility that may revert abruptly. Conversely, a low or negative Sharpe Ratio does not automatically imply an asset should be avoided; it might signal an opportunity if the risk environment normalizes.
PRO Investing - LevelPRO Investing - Level 
 📊 Dynamic Support/Resistance 
This indicator plots the PRO Investing Level, defined as the midpoint between the highest high and lowest low over the past 252 trading days (default lookback period, equivalent to ~1 year). It acts as a key mean-reversion reference level, useful for identifying potential support/resistance zones or market equilibrium levels.
 Features: 
🕰️ Option to display only today’s level or historical levels.
⚙️ Customizable lookback period for flexibility across timeframes and strategies.
📉 Teal line plotted directly on the chart, highlighting this institutional-grade level.
Ideal for traders looking to anchor price action to significant historical ranges—particularly useful in mean-reversion, breakout, or volatility compression strategies.
Exponential Top and Bottom FinderThis is an indicator to identify possible tops and bottoms after exponential price surges and drops, it works best on ETH 1D, but you can also use it for bitcoin and altcoins.
It's based on stochastic first and second derivatives of a close moving average
Killzone za Indexe - @mladja123This indicator highlights the Kill Zones on index charts, showing key market sessions where high-probability price movements are likely to occur. It helps traders identify optimal entry and exit points based on session dynamics and market rhythm, enhancing strategy precision for swing and intraday trading on indices.
Market State Momentum OscillatorMarket State Momentum Oscillator (MSMO)
Overview
The MSMO combines three elements in one panel:
Momentum oscillator (gray/blue area with aqua signal line)
Market State filter (green/red background area)
Money Flow Index (orange line)
Works on all markets and all timeframes. Non-repainting at bar close.
Colors and meaning
Gray area: Momentum above 0 (bullish bias)
Blue area: Momentum below 0 (bearish bias)
Aqua line: Signal line smoothing the oscillator
Green background: Market state bullish (price above moving average)
Red background: Market state bearish (price below moving average)
Orange line: Money Flow Index (volume-weighted momentum)
How to use
Always wait for confirmation of the green or red market state before acting.
Trend alignment: Watch the slope of the Weekly and Daily 200 MA and Weekly and Daily 50 MA to understand higher-timeframe trend direction. Trade only in alignment with the broader trend.
Entries:
Long: Green state + gray histogram rising + MFI trending up
Short: Red state + blue histogram falling + MFI trending down
Exits: Histogram crossing back through 0, or state background flips against the position.
Users can add chart alerts on plot crossings if needed.
Inputs
Lengths for oscillator pivot, signal smoothing, state moving average, trend weight, return %, and Money Flow Index. Defaults work for most charts.
Note
Educational use only. Not financial advice.
Tags
trend, oscillator, market state, momentum, money flow, crypto, forex, stocks, indices, futures
Multi-Session MarkerMulti-Session Marker  is a flexible visual tool for traders who want to highlight up to 10 custom trading sessions directly on their chart’s background.
 
 Custom Sessions: Enter up to 10 time ranges (in HHMM-HHMM format) to mark any market session, news window, or personal focus period.
 Visual Clarity: For each session, toggle the highlight on or off and select a unique background color and opacity, making it easy to distinguish active trading windows at a glance.
 Universal Time Handling: Session times automatically follow your chart’s time zone—no manual adjustment required.
 Efficient and Fast: Utilizes TradingView’s bgcolor() for smooth performance, even on fast timeframes like 1-second charts.
 Clean Interface: All session controls are grouped for easy editing in the indicator’s settings panel.
 
How to use:
 
 In the indicator settings, enter your desired session times (e.g., 0930-1130) for each session you want to highlight.
 Toggle “Show Session” and pick a color for each session.
 The background will automatically highlight those periods on your chart.
 
This indicator is ideal for day traders, futures traders, or anyone who wants to visually segment their trading day for better focus and analysis.
Bitcoin Power Law OscillatorThis is the oscillator version of the script. The main body of the script can be found  here. 
 Understanding the Bitcoin Power Law Model 
Also called the Long-Term Bitcoin Power Law Model. The Bitcoin Power Law model tries to capture and predict Bitcoin's price growth over time. It assumes that Bitcoin's price follows an exponential growth pattern, where the price increases over time according to a mathematical relationship.
By fitting a power law to historical data, the model creates a trend line that represents this growth. It then generates additional parallel lines (support and resistance lines) to show potential price boundaries, helping to visualize where Bitcoin’s price could move within certain ranges.
In simple terms, the model helps us understand Bitcoin's general growth trajectory and provides a framework to visualize how its price could behave over the long term.
 The Bitcoin Power Law has the following function: 
 Power Law = 10^(a + b * log10(d)) 
Consisting of the following parameters:
 
 a:  Power Law Intercept  (default: -17.668).
 b:  Power Law Slope  (default: 5.926).
 d:  Number of days  since a reference point(calculated by counting bars from the reference point with an offset).
 
 Explanation of the a and b parameters: 
Roughly explained, the optimal values for the a and b parameters are determined through a process of linear regression on a log-log scale (after applying a logarithmic transformation to both the x and y axes). On this log-log scale, the power law relationship becomes linear, making it possible to apply linear regression. The best fit for the regression is then evaluated using metrics like the R-squared value, residual error analysis, and visual inspection. This process can be quite complex and is beyond the scope of this post.
 Applying vertical shifts to generate the other lines: 
Once the initial power-law is created, additional lines are generated by applying a vertical shift. This shift is achieved by adding a specific number of days (or years in case of this script) to the d-parameter. This creates new lines perfectly parallel to the initial power law with an added vertical shift, maintaining the same slope and intercept.
In the case of this script, shifts are made by adding +365 days, +2 * 365 days, +3 * 365 days, +4 * 365 days, and +5 * 365 days, effectively introducing one to five years of shifts. This results in a total of six Power Law lines, as outlined below (From lowest to highest):
 
 Base Power Law Line (no shift)
 1-year shifted line
 2-year shifted line
 3-year shifted line
 4-year shifted line
 5-year shifted line 
 
 The six power law lines: 
 Bitcoin Power Law Oscillator 
This publication also includes the oscillator version of the Bitcoin Power Law. This version applies a logarithmic transformation to the price, Base Power Law Line, and 5-year shifted line using the formula:   log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed Base Power Law Line and 5-year shifted line with the formula:
 normalized price = log(close) - log(Base Power Law Line) / log(5-year shifted line) - log(Base Power Law Line) 
Finally, the normalized price was multiplied by 5 to map its value between 0 and 5, aligning with the shifted lines.
 Interpretation of the Bitcoin Power Law Model: 
The shifted Power Law lines provide a framework for predicting Bitcoin's future price movements based on historical trends. These lines are created by applying a vertical shift to the initial Power Law line, with each shifted line representing a future time frame (e.g., 1 year, 2 years, 3 years, etc.).
By analyzing these shifted lines, users can make predictions about  minimum price levels  at specific future dates. For example, the 5-year shifted line will act as the main support level for Bitcoin’s price in 5 years, meaning that Bitcoin’s price should not fall below this line, ensuring that Bitcoin will be valued at least at this level by that time. Similarly, the 2-year shifted line will serve as the support line for Bitcoin's price in 2 years, establishing that the price should not drop below this line within that time frame.
On the other hand, the 5-year shifted line also functions as an  absolute resistance , meaning Bitcoin's price will not exceed this line prior to the 5-year mark. This provides a prediction that Bitcoin cannot reach certain price levels before a specific date. For example, the price of Bitcoin is unlikely to reach $100,000 before 2021, and it will not exceed this price before the 5-year shifted line becomes relevant. After 2028, however, the price is predicted to  never fall below  $100,000, thanks to the support established by the shifted lines.
In essence, the shifted Power Law lines offer a way to predict both the minimum price levels that Bitcoin will hit by certain dates and the  earliest dates  by which certain price points will be reached. These lines help frame Bitcoin's potential future price range, offering insight into long-term price behavior and providing a guide for investors and analysts. Lets examine some examples:
 Example 1: 
In Example 1 it can be seen that point A on the 5-year shifted line acts as  major resistance . Also it can be seen that 5 years later this price level now corresponds to the Base Power Law Line and acts as a  major support  at point B(Note: Vertical yearly grid lines have been added for this purpose👍).
 Example 2: 
In Example 2, the price level at point C on the 3-year shifted line becomes a  major support  three years later at point D, now aligning with the Base Power Law Line.
Finally, let's explore some future price predictions, as this script provides projections on the weekly timeframe :
 Example 3: 
In Example 3, the Bitcoin Power Law indicates that Bitcoin's price cannot surpass approximately $808K before 2030 as can be seen at point E, while also ensuring it will be at least $224K by then (point F).
Yearly History Calendar-Aligned Price up to 10 Years)Overview  
This indicator helps traders compare historical price patterns  from the past 10 calendar years with the current price action. It overlays translucent lines (polylines) for each year’s price data on the same calendar dates, providing a visual reference for recurring trends. A dynamic table at the top of the chart summarizes the active years, their price sources, and history retention settings. 
Key Features  
    Historical Projections    
        Displays price data from the last 10 years (e.g., January 5, 2023 vs. January 5, 2024).  
               
    Price Source Selection    
        Choose from Open, Low, High, Close, or HL2 ((High + Low)/2) for historical alignment.  
        The selected source is shown in the legend table.
         
    Bulk Control Toggles    
        Show All Years : Display all 10 years simultaneously.  
        Keep History for All : Preserve historical lines on year transitions.  
        Hide History for All : Automatically delete old lines to update with current data.
         
    Individual Year Settings    
        Toggle visibility for each year (-1 to -10) independently.  
        Customize color and line width for each year.  
        Control whether to keep or delete historical lines for specific years.
         
    Visual Alignment Aids    
        Vertical lines mark yearly transitions for reference.  
        Polylines are semi-transparent for clarity.
         
    Dynamic Legend Table    
        Shows active years, their price sources, and history status (On/Off).  
        Updates automatically when settings change.
        
   
How to Use  
    Configure Settings    
        Projection Years : Select how many years to display (1–10).  
        Price Source : Choose Open, Low, High, Close, or HL2 for historical alignment.  
        History Precision : Set granularity (Daily, 60m, or 15m).  
            Daily (D)  is recommended for long-term analysis (covers 10 years).  
            60m/15m  provides finer precision but may only cover 1–3 years due to data limits.
             
        
    Adjust Visibility & History    
        Show Year -X : Enable/disable specific years for comparison.  
        Keep History for Year -X : Choose whether to retain historical lines or delete them on new year transitions.
         
    Bulk Controls    
        Show All Years : Display all 10 years at once (overrides individual toggles).  
        Keep History for All / Hide History for All : Globally enable/disable history retention for all years.
         
    Customize Appearance    
        Line Width : Adjust polyline thickness for better visibility.  
        Colors : Assign unique colors to each year for easy identification.
         
    Interpret the Legend Table    
        The table shows:  
            Year : Label (e.g., "Year -1").  
            Source : The selected price type (e.g., "Close", "HL2").  
            Keep History : Indicates whether lines are preserved (On) or deleted (Off).
             
         
   
Tips for Optimal Use  
    Use Daily Timeframes for Long-Term Analysis :  
        Daily (1D) allows 10+ years of data. Smaller timeframes (60m/15m) may have limited historical coverage.
         
    Compare Recurring Patterns :  
        Look for overlaps between historical polylines and current price to identify potential support/resistance levels.
         
    Customize Colors & Widths :  
        Use contrasting colors for years you want to highlight. Adjust line widths to avoid clutter.
         
    Leverage Global Toggles :  
        Enable Show All Years for a quick overview. Use Keep History for All to maintain continuity across transitions.
         
     
Example Workflow  
    Set Up :   
        Select Projection Years = 5.  
        Choose Price Source = Close.  
        Set History Precision = 1D for long-term data.
         
    Customize :   
        Enable Show Year -1 to Show Year -5.  
        Assign distinct colors to each year.  
        Disable Keep History for All to ensure lines update on year transitions.
         
    Analyze :   
        Observe how the 2023 close prices align with 2024’s price action.  
        Use vertical lines to identify yearly boundaries.
         
     
Common Questions  
    Why are some years missing?    
        Ensure the chart has sufficient historical data (e.g., daily charts cover 10 years, 60m/15m may only cover 1–3 years).
         
    How do I update the data?    
        Adjust the Price Source or toggle years/history settings. The legend table updates automatically.
         
         
     
Bitcoin Monthly Seasonality [Alpha Extract]The Bitcoin Monthly Seasonality indicator analyzes historical Bitcoin price performance across different months of the year, enabling traders to identify seasonal patterns and potential trading opportunities. This tool helps traders: 
 
 Visualize which months historically perform best and worst for Bitcoin.
 Track average returns and win rates for each month of the year. 
 Identify seasonal patterns to enhance trading strategies.
 Compare cumulative or individual monthly performance.
 
🔶 CALCULATION
The indicator processes historical Bitcoin price data to calculate monthly performance metrics
 Monthly Return Calculation 
Inputs: 
 
 Monthly open and close prices. 
 User-defined lookback period (1-15 years).
 Return Types: 
 Percentage: (monthEndPrice / monthStartPrice - 1) × 100 
 Price: monthEndPrice - monthStartPrice
 
 Statistical Measures 
 
 Monthly Averages: ◦ Average return for each month calculated from historical data.
 Win Rate: ◦ Percentage of positive returns for each month.
 Best/Worst Detection: ◦ Identifies months with highest and lowest average returns.
 
 Cumulative Option 
 
 Standard View: Shows discrete monthly performance.
 Cumulative View: Shows compounding effect of consecutive months.
 
Example Calculation (Pine Script):
 monthReturn = returnType == "Percentage" ? 
              (monthEndPrice / monthStartPrice - 1) * 100 : 
              monthEndPrice - monthStartPrice
calcWinRate(arr) =>
    winCount = 0
    totalCount = array.size(arr)
    if totalCount > 0
        for i = 0 to totalCount - 1
            if array.get(arr, i) > 0
                winCount += 1
        (winCount / totalCount) * 100
    else
        0.0 
🔶 DETAILS
 Visual Features 
 
 Monthly Performance Bars: ◦ Color-coded bars (teal for positive, red for negative returns). ◦ Special highlighting for best (yellow) and worst (fuchsia) months.
 Optional Trend Line: ◦ Shows continuous performance across months.
 Monthly Axis Labels: ◦ Clear month names for easy reference.
 Statistics Table: ◦ Comprehensive view of monthly performance metrics. ◦ Color-coded rows based on performance.
 
 Interpretation
 
 
 Strong Positive Months: Historically bullish periods for Bitcoin.
 Strong Negative Months: Historically bearish periods for Bitcoin.
 Win Rate Analysis: Higher win rates indicate more consistently positive months.
 Pattern Recognition: Identify recurring seasonal patterns across years.
 Best/Worst Identification: Quickly spot the historically strongest and weakest months.
 
🔶 EXAMPLES
The indicator helps identify key seasonal patterns
 
 Bullish Seasons: Visualize historically strong months where Bitcoin tends to perform well, allowing traders to align long positions with favorable seasonality.
 Bearish Seasons: Identify historically weak months where Bitcoin tends to underperform, helping traders avoid unfavorable periods or consider short positions.
 Seasonal Strategy Development: Create trading strategies that capitalize on recurring monthly patterns, such as entering positions in historically strong months and reducing exposure during weak months.
 Year-to-Year Comparison: Assess how current year performance compares to historical seasonal patterns to identify anomalies or confirmation of trends.
 
  
🔶 SETTINGS
Customization Options
 
 Lookback Period: Adjust the number of years (1-15) used for historical analysis.
 Return Type: Choose between percentage returns or absolute price changes.
 Cumulative Option: Toggle between discrete monthly performance or cumulative effect.
 Visual Style Options: Bar Display: Enable/disable and customize colors for positive/negative bars, Line Display: Enable/disable and customize colors for trend line, Axes Display: Show/hide reference axes.
 Visual Enhancement: Best/Worst Month Highlighting: Toggle special highlighting of extreme months, Custom highlight colors for best and worst performing months.
 
The Bitcoin Monthly Seasonality indicator provides traders with valuable insights into Bitcoin's historical performance patterns throughout the year, helping to identify potentially favorable and unfavorable trading periods based on seasonal tendencies.
Monthly Drawdowns and Moves UP This script allows users to analyze the performance of a specific month across multiple years, focusing on maximum drawdowns and maximum upward moves within the selected month. The script offers the following features:
 Dynamic Month Selection : Choose any month to analyze using an intuitive dropdown menu.
 Maximum Drawdown and Upward Move Calculations :
Calculate the largest percentage drop (drawdown) and rise (move up) for the selected month each year.
 Visual Highlights :
The selected month is visually highlighted on the chart with a semi-transparent overlay.
Dynamic Labels:
Labels display the maximum drawdown and upward move directly on the chart for better visualization.
Comprehensive Table Summary:
A table provides a year-by-year summary of the maximum drawdowns and upward moves for the selected month, making it easy to spot trends over time.
Customizable Display Options:
Toggle the visibility of drawdown labels, move-up labels, and the summary table for a clutter-free experience.
This tool is perfect for traders and analysts looking to identify seasonal patterns, assess risk and opportunity, and gain deeper insights into monthly performance metrics across years. Customize, explore, and make informed decisions with this powerful Pine Script indicator.






















