Average Daily % Change by Weekday📊 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.
Statistics
Live 30-Point Horizontal Lines with Price LabelsLive 30-Point Horizontal Lines with Price Labels for upper and below current price
Correlation Coefficient with MA & BB中文版介紹
相關係數、移動平均線與布林帶指標 (Correlation Coefficient with MA & BB)
這個 Pine Script 指標是一款強大的工具,旨在幫助交易者和投資者深入分析兩個市場標的之間的關係強度與方向,並結合移動平均線 (MA) 和布林帶 (BB) 來進一步洞察這種關係的趨勢和波動性。
無論您是想尋找配對交易機會、管理投資組合風險,還是僅僅想更好地理解市場動態,這個指標都能提供有價值的見解。
指標特色與功能:
動態相關係數計算:
您可以選擇任何您想比較的股票、商品或加密貨幣代號(例如,預設為 GOOG)。
指標會自動計算當前圖表(主數據源,預設為收盤價)與您指定標的之間的相關係數。
相關係數值介於 -1 (完美負相關) 至 1 (完美正相關) 之間,0 表示無線性關係。
視覺化呈現相關係數線,並標示 1、0、-1 參考水平線,同時填充完美相關區間,讓您一目了然。
特別之處:程式碼中包含了 ticker.modify,確保比較標的數據考慮了股息調整或延長交易時段,使相關性分析更加精準。
相關係數的移動平均線 (MA):
為了平滑相關係數的短期波動,指標提供了多種移動平均線類型供您選擇,包括:SMA、EMA、WMA、SMMA。
您可以設定計算 MA 的週期長度(預設 20 週期)。
這條 MA 線有助於識別相關係數的長期趨勢,判斷兩者關係是趨於增強還是減弱。
相關係數的布林帶 (BB):
將布林帶應用於相關係數,以衡量其波動性和相對高低水平。
中軌與您選擇的移動平均線保持一致。
上軌和下軌則根據相關係數的標準差和您設定的 Z 值(預設 2.0 倍標準差)動態調整。
布林帶可以幫助您識別相關係數何時處於極端水平,可能預示著未來會回歸均值。
如何運用這個指標?
配對交易策略:當兩個通常高度相關的資產,其相關係數短期內顯著偏離平均水平(例如,一個資產價格上漲而另一個原地踏步),您可能可以考慮利用此「失衡」進行配對交易。
投資組合多元化:了解不同資產之間的相關性,有助於構建更穩健的投資組合,避免過度集中於同向變動的資產,有效分散風險。
市場趨勢洞察:透過觀察相關係數的趨勢和波動,您可以更好地理解不同市場板塊或資產類別之間的聯動性,為您的宏觀經濟分析提供數據支持。
請注意,相關性不等於因果性。使用此指標時,請結合您的整體交易策略、宏觀經濟分析以及其他技術指標進行綜合判斷。
English Version Introduction
Correlation Coefficient with Moving Average & Bollinger Bands Indicator (Correlation Coefficient with MA & BB)
This Pine Script indicator is a powerful tool designed to help traders and investors deeply analyze the strength and direction of the relationship between two market instruments. It integrates Moving Averages (MA) and Bollinger Bands (BB) to further insight into the trend and volatility of this relationship.
Whether you're looking for pair trading opportunities, managing portfolio risk, or simply aiming to better understand market dynamics, this indicator can provide valuable insights.
Indicator Features & Functionality:
Dynamic Correlation Coefficient Calculation:
You can select any symbol you wish to compare (e.g., default is GOOG), be it stocks, commodities, or cryptocurrencies.
The indicator automatically calculates the correlation coefficient between the current chart (main data source, default is close price) and your specified symbol.
Correlation values range from -1 (perfect negative correlation) to 1 (perfect positive correlation), with 0 indicating no linear relationship.
It visually plots the correlation line, marks 1, 0, -1 reference levels, and fills the perfect correlation zone for clear visualization.
Special Feature: The code includes ticker.modify, ensuring that the comparative symbol's data accounts for dividend adjustments or extended trading hours, leading to more precise correlation analysis.
Moving Average (MA) for Correlation:
To smooth out short-term fluctuations in the correlation coefficient, the indicator offers multiple MA types for you to choose from: SMA, EMA, WMA, SMMA.
You can set the length of the MA period (default 20 periods).
This MA line helps identify the long-term trend of the correlation coefficient, indicating whether the relationship between the two instruments is strengthening or weakening.
Bollinger Bands (BB) for Correlation:
Bollinger Bands are applied to the correlation coefficient itself to gauge its volatility and relative high/low levels.
The middle band aligns with your chosen Moving Average.
The upper and lower bands dynamically adjust based on the correlation coefficient's standard deviation and your set Z-score (default 2.0 standard deviations).
Bollinger Bands can help you identify when the correlation coefficient is at extreme levels, potentially signaling a future reversion to the mean.
How to Utilize This Indicator:
Pair Trading Strategies: When two typically highly correlated assets show a significant short-term deviation from their average correlation (e.g., one asset's price rises while the other stagnates), you might consider exploiting this "imbalance" for pair trading.
Portfolio Diversification: Understanding the correlation between different assets helps build a more robust investment portfolio, preventing over-concentration in co-moving assets and effectively diversifying risk.
Market Trend Insight: By observing the trend and volatility of the correlation coefficient, you can better understand the联动 (interconnectedness) between different market sectors or asset classes, providing data support for your macroeconomic analysis.
Please note that correlation does not imply causation. When using this indicator, combine it with your overall trading strategy, macroeconomic analysis, and other technical indicators for comprehensive decision-making.
Kase Convergence Divergence [BackQuant]Kase Convergence Divergence
The Kase Convergence Divergence is a sophisticated oscillator designed to measure directional market strength through the lens of volatility-adjusted log return structures. Inspired by Cynthia Kase’s work on statistical momentum and price projection ranges, this unique indicator offers a hybrid framework that merges signal processing, multi-length sweep logic, and adaptive smoothing techniques.
Unlike traditional momentum oscillators like MACD or RSI, which rely on static moving average differences, KCD introduces a dual-process system combining:
Kase-style statistical range projection (via log returns and volatility),
A sweeping loop of lookback lengths for robustness,
First and second derivative modes to capture both velocity and acceleration of price movement.
Core Logic & Computation
The KCD calculation is centered on two volatility-normalized transforms:
KSDI Up: Measures how far the current high has moved relative to a past low, normalized by return volatility.
KSDI Down: Measures how far the current low has moved relative to a past high, also normalized.
For every length in a user-defined sweep range (e.g., 25–35), both KSDI_up and KSDI_dn are computed, and their maximum values across the loop are retained. The difference between these two max values produces the raw signal:
KPO (Kase Projection Oscillator): Measures directional skew.
KCD (Kase Convergence Divergence): Defined as KPO – MA(KPO) — similar in spirit to MACD but structurally different.
Users can choose to visualize either the first derivative (KPO) , or the second derivative (KCD) , depending on market conditions or strategy style.
Key Features
✅ Multi-Length Sweep Logic: Improves signal reliability by aggregating statistical range projections across a set of lookbacks.
✅ Advanced Smoothing Modes: Supports DEMA, HMA, TEMA, LINREG, WMA and more for dynamic adaptation.
✅ Dual Derivative Modes: Choose between speed (first derivative) or smoothness (second derivative) to fit your trading regime.
✅ Color-Encoded Signal Bands: Heatmap-style oscillator coloring enhances visual feedback on trend strength.
✅ Candlestick Painting: Optional bar coloring makes it easy to spot trend shifts on the main chart.
✅ Adaptive Fill Zones: Green and red fills between the oscillator and zero line help distinguish bullish and bearish regimes at a glance.
Practical Applications
📈 Trend Confirmation: Use KCD as a secondary confirmation layer after breakout or pullback entries.
📉 Momentum Shifts: Crossover and crossunder of the zero line highlight potential regime changes.
📊 Strategy Filters: Incorporate into algos to avoid trendless or mean-reverting environments.
🧪 Derivative Switching: Flip between KPO and KCD modes depending on whether you want to measure acceleration or deceleration of price flow.
Alerts & Signals
Two built-in alerts help you catch regime shifts in real time:
Long Signal: Triggered when the selected oscillator crosses above zero.
Short Signal: Triggered when it crosses below zero.
These events can be used to generate entries, exits, or trend validation cues in multi-layer systems.
Conclusion
The Kase Convergence Divergence goes beyond traditional oscillators by offering a volatility-normalized, derivative-aware signal engine with enhanced visual dynamics. Its sweeping architecture and dynamic fill logic make it especially powerful for identifying trending environments, filtering chop, and adding statistical rigor to your trading toolkit.
Whether you’re a discretionary trader seeking precision, or a quant looking to model more robust return structures, KCD offers a creative yet analytically grounded solution.
Capitalife IndexCapitalife Index
Jahres Rendite seit 2008 basierend auf Backtesting & Live Ergebnisse
Digit Sum Mark (3/6/9 + Price ~33 ±15)This indicator highlights the price bars where the digit sum of high or low equals 3, 6, or 9, and the closing price is within a specific range (around ₹33 ±15, i.e., mod 100 ∈ ).
✨ Key Features:
Calculates digit sum of high and low values.
Adds +1 if the decimal portion > 0.50 (smart rounding logic).
Only activates when close price mod 100 is between 18 to 48, a zone inspired by the resonance around 33.
Marks the chart with green downward arrows (for high) and red upward arrows (for low) when digit sum = 3, 6, or 9.
📌 Inspired by Gann numerology and price vibration logic – especially the powerful influence of 3, 6, and 9 as noted by Nikola Tesla.
🚨 Best used on intraday or positional charts where price oscillates frequently around round figures.
🧠 Try pairing this with support/resistance tools for better accuracy!
ShadowStats vs Official CPI YoY%This chart visualizes and compares the year-over-year (YoY) percentage change in the Consumer Price Index (CPI) as calculated by the U.S. government versus the alternative methodology used by ShadowStats, which reflects pre-1980 inflation measurement techniques. The red line represents ShadowStats' CPI YoY% estimates, while the blue line shows the official CPI YoY% reported by government sources. This side-by-side view highlights the divergence in reported inflation rates over time, particularly from the 1980s onward, offering a visual representation of how different calculation methods can lead to vastly different interpretations of inflation and purchasing power loss.
Trading CalculatorTrading Calculator Indicator
VIBE CODED WITH GROK 3
The Trading Calculator is a Pine Script indicator designed to perform quick and useful trading-related calculations directly on your chart. It allows traders to execute basic arithmetic operations—such as addition, subtraction, multiplication, and division—as well as calculate percent change and average using either numerical values or trading variables (e.g., close, open, high, low, volume). The indicator displays its results in a table that resembles a calculator interface, making it both functional and visually intuitive. Unlike typical indicators, it does not overlay on the price chart but instead appears in a separate pane.
Inputs
Formula (new | old): First value or variable (e.g., 100, close, close ). Example: close uses the current closing price.
Operator: Mathematical operation (e.g., Plus, Minus, Multiply). Example: Plus adds the two inputs.
Second Input: Second value or variable (e.g., 50, open, close ). Example: open uses the current opening price.
Risk Distribution HistogramStatistical risk visualization and analysis tool for any ticker 📊
The Risk Distribution Histogram visualizes the statistical distribution of different risk metrics for any financial instrument. It converts risk data into histograms with quartile-based color coding, so that traders can understand their risk, tail-risks, exposure patterns and make data-driven decisions based on empirical evidence rather than assumptions.
The indicator supports multiple risk calculation methods, each designed for different aspects of market analysis, from general volatility assessment to tail risk analysis.
Risk Measurement Methods
Standard Deviation
Captures raw daily price volatility by measuring the dispersion of price movements. Ideal for understanding overall market conditions and timing volatility-based strategies.
Use case: Options trading and volatility analysis.
Average True Range (ATR)
Measures true range as a percentage of price, accounting for gaps and limit moves. Valuable for position sizing across different price levels.
Use case: Position sizing and stop-loss placement.
The chart above illustrates how ATR statistical distribution can be used by looking at the ATR % of price distribution. For example, 90% of the movements are below 5%.
Downside Deviation
Only considers negative price movements, making it ideal for checking downside risk and capital protection rather than capturing upside volatility.
Use case: Downside protection strategies and stop losses.
Drawdown Analysis
Tracks peak-to-trough declines, providing insight into maximum loss potential during different market conditions.
Use case: Risk management and capital preservation.
The chart above illustrates tale risk for the asset (TQQQ), showing that it is possible to have drawdowns higher than 20%.
Entropy-Based Risk (EVaR)
Uses information theory to quantify market uncertainty. Higher entropy values indicate more unpredictable price action, valuable for detecting regime changes.
Use case: Advanced risk modeling and tail-risk.
VIX Histogram
Incorporates the market's fear index directly into analysis, showing how current volatility expectations compare to historical patterns. The CAPITALCOM:VIX histogram is independent from the ticker on the chart.
Use case: Volatility trading and market timing.
Visual Features
The histogram uses quartile-based color coding that immediately shows where current risk levels stand relative to historical patterns:
Green (Q1): Low Risk (0-25th percentile)
Yellow (Q2): Medium-Low Risk (25-50th percentile)
Orange (Q3): Medium-High Risk (50-75th percentile)
Red (Q4): High Risk (75-100th percentile)
The data table provides detailed statistics, including:
Count Distribution: Historical observations in each bin
PMF: Percentage probability for each risk level
CDF: Cumulative probability up to each level
Current Risk Marker: Shows your current position in the distribution
Trading Applications
When current risk falls into upper quartiles (Q3 or Q4), it signals conditions are riskier than 50-75% of historical observations. This guides position sizing and portfolio adjustments.
Key applications:
Position sizing based on empirical risk distributions
Monitoring risk regime changes over time
Comparing risk patterns across timeframes
Risk distribution analysis improves trade timing by identifying when market conditions favor specific strategies.
Enter positions during low-risk periods (Q1)
Reduce exposure in high-risk periods (Q4)
Use percentile rankings for dynamic stop-loss placement
Time volatility strategies using distribution patterns
Detect regime shifts through distribution changes
Compare current conditions to historical benchmarks
Identify outlier events in tail regions
Validate quantitative models with empirical data
Configuration Options
Data Collection
Lookback Period: Control amount of historical data analyzed
Date Range Filtering: Focus on specific market periods
Sample Size Validation: Automatic reliability warnings
Histogram Customization
Bin Count: 10-50 bins for different detail levels
Auto/Manual Bin Width: Optimize for your data range
Visual Preferences: Custom colors and font sizes
Implementation Guide
Start with Standard Deviation on daily charts for the most intuitive introduction to distribution-based risk analysis.
Method Selection: Begin with Standard Deviation
Setup: Use daily charts with 20-30 bins
Interpretation: Focus on quartile transitions as signals
Monitoring: Track distribution changes for regime detection
The tool provides comprehensive statistics including mean, standard deviation, quartiles, and current position metrics like Z-score and percentile ranking.
Enjoy, and please let me know your feedback! 😊🥂
Dynamic Spot vs Perps Premium (Area Plot)This is a script to give you an easy overall view on the spot perp premium which could indicate the momentum is drove by spot or perps
MonthlyProfitTable# Monthly Profit Table Library
**Automatically create beautiful monthly profit/loss tables for your Pine Script strategies with just 3 lines of code!**
## 🎯 What It Does
This library automatically tracks your strategy's performance and displays it in a clean, professional monthly profit table similar to what you see in institutional trading reports. No manual calculations required - just import and use!
## ✨ Key Features
- **🚀 Super Easy Setup**: Just 3 lines of code to get started
- **📊 Automatic Tracking**: Monitors your strategy's P&L automatically
- **📅 Monthly & Yearly Breakdown**: Shows profits/losses by month and year
- **🎨 Customizable Colors**: Choose your own color scheme
- **📍 Flexible Positioning**: Place the table anywhere on your chart
- **💯 Percentage & Dollar Values**: Shows both absolute and percentage returns
- **🔄 Real-time Updates**: Updates automatically as your strategy runs
## 🛠️ How to Use
// Import the library
import your_username/MonthlyProfitTable/1 as mpt
// In your strategy:
// Step 1: Create a profit tracker
var profitData = mpt.newProfitData()
// Step 2: Update tracking data
profitData := mpt.updateProfitData(profitData)
// Step 3: Display the table
mpt.showSimpleProfitTable(profitData)
## 🎨 Customization Options
- **Precision**: Control decimal places for numbers
- **Colors**: Customize header, cell, positive, and negative colors
- **Position**: Place table in any corner of your chart
- **Styling**: Choose between simple or custom styling
## 💡 Perfect For
- Strategy backtesting analysis
- Performance monitoring
- Professional strategy presentations
- Trading journals and reports
- Risk management analysis
## 📈 Example Output
Creates a table showing:
- Monthly profits/losses for each month
- Yearly totals and percentages
- Color-coded positive (green) and negative (red) values
- Clean, professional appearance
Transform your strategy analysis from basic equity curves to professional-grade monthly breakdowns!
**Compatible with all Pine Script v6 strategies. Works with any timeframe and symbol.**
COBRA X Mastermind – Ultimate Smart Panel✅ COBRA X Mastermind – Ultimate Smart Panel
COBRA X Mastermind – Ultimate Panel | Structure, Volume, Signals & Smart Entry
📝 (Description):
COBRA X Mastermind is a precision smart panel for reading market structure, detecting high-quality entries and visualizing critical components in one screen:
Detect Break of Structure (BoS) and CHoCH with context
Auto-mark Order Blocks and Fair Value Gaps (FVGs)
Volume Spike & VWAP alignment for smart trend confirmation
Directional bias from EMA + Dynamic Flow analysis
Hidden divergence detection to anticipate trap moves
Built-in Signal Strength meter with real-time TP/SL suggestion
Each row in the panel reflects a real-time reading of price action, structure, volume, and entry risk.
🔍 How to use it:
Look for a valid signal only when structure + volume + divergence are in agreement. Use the panel strength bar to validate setups.
This script is open-source and optimized for 1m and 5m charts, especially on Gold and FX pairs.
Clean, non-repainting, and built for professional scalpers.
Daily, Weekly, Monthly Current/Average RangeThe "Daily, Weekly, Monthly Current/Average Range" calculates and displays current and average price ranges (high - low) for daily, weekly, and monthly timeframes in a customizable table.
Users can adjust the lookback period, table size, and font color, with the table updating on the last bar for efficiency.
When the current range exceeds the average for a timeframe, the corresponding cell highlights green, signaling price possibly reaching maximum expansion and potential retracement or consolidation may follow.
Adj Momentum (3M / 6M / 12M)Mirza Salman Volatility Adjusted Momentum.
The Volatility Adjusted Momentum Indicator distills a security’s recent performance into a single, decision-ready metric that captures both the velocity and the reliability of its trend. By simultaneously rewarding sustained price appreciation and discounting erratic fluctuations, the indicator highlights those stocks that are not only advancing but doing so with a consistent, low-volatility profile—attributes typically favoured by quantitative momentum and trend-following frameworks. A high positive reading points to instruments exhibiting strong, orderly upward trajectories, making them prime candidates for capital allocation in momentum-oriented portfolios. Conversely, muted or negative readings reveal markets whose returns have been lacklustre, unstable, or downward-sloping, signalling that they warrant caution or exclusion. In practice, this indicator enables portfolio managers and traders to rank broad watch-lists swiftly, focus due-diligence on the most robust price leaders, and enforce systematic discipline in scaling back exposure to choppier, less reliable names—all without resorting to subjective chart interpretation or ad-hoc volatility filters.
Alpha - Combined BreakoutThis Pine Script indicator, "Alpha - Combined Breakout," is a combination between Smart Money Breakout Signals and UT Bot Alert, The UT Bot Alert indicator was initially developer by Yo_adriiiiaan
The idea of original code belongs HPotter.
This Indicator helps you identify potential trading opportunities by combining two distinct strategies: Smart Money Breakout and a modified UT Bot (likely a variation of the Ultimate Trend Bot). It provides visual signals, draws lines for potential take profit (TP) and stop loss (SL) levels, and includes a dashboard to track performance metrics.
Tutorial:
Understanding and Using the "Alpha - Combined Breakout" Indicator
This indicator is designed for traders looking for confirmation of market direction and potential entry/exit points by blending structural analysis with a trend-following oscillator.
How it Works (General Concept)
The indicator combines two main components:
Smart Money Breakout: This part identifies significant breaks in market structure, which "smart money" traders often use to gauge shifts in supply and demand. It looks for higher highs/lows or lower highs/lows and flags when these structural points are broken.
UT Bot: This is a trend-following component that generates buy and sell signals based on price action relative to an Average True Range (ATR) based trailing stop.
You can choose to use these signals independently or combined to generate trading alerts and visual cues on your chart. The dashboard provides a quick overview of how well the signals are performing based on your chosen settings and display mode.
Parameters and What They Do
Let's break down each input parameter:
1. Smart Money Inputs
These settings control how the indicator identifies market structure and breakouts.
swingSize (Market Structure Time-Horizon):
What it does: This integer value defines the number of candles used to identify significant "swing" (pivot) points—highs and lows.
Effect: A larger swingSize creates a smoother market structure, focusing on longer-term trends. This means signals might appear less frequently and with some delay but could be more reliable for higher timeframes or broader market movements. A smaller swingSize will pick up more minor market structure changes, leading to more frequent but potentially noisier signals, suitable for lower timeframes or scalping.
Analogy: Think of it like a zoom level on your market structure map. Higher values zoom out, showing only major mountain ranges. Lower values zoom in, showing every hill and bump.
bosConfType (BOS Confirmation Type):
What it does: This string input determines how a Break of Structure (BOS) is confirmed. You have two options:
'Candle Close': A breakout is confirmed only if a candle's closing price surpasses the previous swing high (for bullish) or swing low (for bearish).
'Wicks': A breakout is confirmed if any part of the candle (including its wick) surpasses the previous swing high or low.
Effect: 'Candle Close' provides stronger, more conservative confirmation, as it implies sustained price movement beyond the structure. 'Wicks' provides earlier, more aggressive signals, as it captures momentary breaches of the structure.
Analogy: Imagine a wall. 'Candle Close' means the whole person must get over the wall. 'Wicks' means even a finger touching over the top counts as a breach.
choch (Show CHoCH):
What it does: A boolean (true/false) input to enable or disable the display of "Change of Character" (CHoCH) labels. CHoCH indicates the first structural break against the current dominant trend.
Effect: When true, it helps identify early signs of a potential trend reversal, as it marks where the market's "character" (its tendency to make higher highs/lows or lower lows/highs) first changes.
BULL (Bullish Color) & BEAR (Bearish Color):
What they do: These color inputs allow you to customize the visual appearance of bullish and bearish signals and lines drawn by the Smart Money component.
Effect: Purely cosmetic, helps with visual identification on the chart.
sm_tp_sl_multiplier (SM TP/SL Multiplier (ATR)):
What it does: A float value that acts as a multiplier for the Average True Range (ATR) to calculate the Take Profit (TP) and Stop Loss (SL) levels specifically when you're in "Smart Money Only" mode. It uses the ATR calculated by the UT Bot's nLoss_ut as its base.
Effect: A higher multiplier creates wider TP/SL levels, potentially leading to fewer trades but larger wins/losses. A lower multiplier creates tighter TP/SL levels, potentially leading to more frequent but smaller wins/losses.
2. UT Bot Alerts Inputs
These parameters control the behavior and sensitivity of the UT Bot component.
a_ut (UT Key Value (Sensitivity)):
What it does: This integer value adjusts the sensitivity of the UT Bot.
Effect: A higher value makes the UT Bot less sensitive to price fluctuations, resulting in fewer and potentially more reliable signals. A lower value makes it more sensitive, generating more signals, which can include more false signals.
Analogy: Like a noise filter. Higher values filter out more noise, keeping only strong signals.
c_ut (UT ATR Period):
What it does: This integer sets the look-back period for the Average True Range (ATR) calculation used by the UT Bot. ATR measures market volatility.
Effect: This period directly influences the calculation of the nLoss_ut (which is a_ut * xATR_ut), thus defining the distance of the trailing stop loss and take profit levels. A longer period makes the ATR smoother and less reactive to sudden price spikes. A shorter period makes it more responsive.
h_ut (UT Signals from Heikin Ashi Candles):
What it does: A boolean (true/false) input to determine if the UT Bot calculations should use standard candlestick data or Heikin Ashi candlestick data.
Effect: Heikin Ashi candles smooth out price action, often making trends clearer and reducing noise. Using them for UT Bot signals can lead to smoother, potentially delayed signals that stay with a trend longer. Standard candles are more reactive to raw price changes.
3. Line Drawing Control Buttons
These crucial boolean inputs determine which type of signals will trigger the drawing of TP/SL/Entry lines and flags on your chart. They act as a priority system.
drawLinesUtOnly (Draw Lines: UT Only):
What it does: If checked (true), lines and flags will only be drawn when the UT Bot generates a buy/sell signal.
Effect: Isolates UT Bot signals for visual analysis.
drawLinesSmartMoneyOnly (Draw Lines: Smart Money Only):
What it does: If checked (true), lines and flags will only be drawn when the Smart Money Breakout logic generates a bullish/bearish breakout.
Effect: Overrides drawLinesUtOnly if both are checked. Isolates Smart Money signals.
drawLinesCombined (Draw Lines: UT & Smart Money (Combined)):
What it does: If checked (true), lines and flags will only be drawn when both a UT Bot signal AND a Smart Money Breakout signal occur on the same bar.
Effect: Overrides both drawLinesUtOnly and drawLinesSmartMoneyOnly if checked. Provides the strictest entry criteria for line drawing, looking for strong confluence.
Dashboard Metrics Explained
The dashboard provides performance statistics based on the lines drawing control button selected. For example, if "Draw Lines: UT Only" is active, the dashboard will show stats only for UT Bot signals.
Total Signals: The total number of buy or sell signals generated by the selected drawing mode.
TP1 Win Rate: The percentage of signals where the price reached Take Profit 1 (TP1) before hitting the Stop Loss.
TP2 Win Rate: The percentage of signals where the price reached Take Profit 2 (TP2) before hitting the Stop Loss.
TP3 Win Rate: The percentage of signals where the price reached Take Profit 3 (TP3) before hitting the Stop Loss. (Note: TP1, TP2, TP3 are in order of distance from entry, with TP3 being furthest.)
SL before any TP rate: This crucial metric shows the number of times the Stop Loss was hit / the percentage of total signals where the stop loss was triggered before any of the three Take Profit levels were reached. This gives you a clear picture of how often a trade resulted in a loss without ever moving into profit target territory.
Short Tutorial: How to Use the Indicator
Add to Chart: Open your TradingView chart, go to "Indicators," search for "Alpha - Combined Breakout," and add it to your chart.
Access Settings: Once added, click the gear icon next to the indicator name on your chart to open its settings.
Choose Your Signal Mode:
For UT Bot only: Uncheck "Draw Lines: Smart Money Only" and "Draw Lines: UT & Smart Money (Combined)". Ensure "Draw Lines: UT Only" is checked.
For Smart Money only: Uncheck "Draw Lines: UT Only" and "Draw Lines: UT & Smart Money (Combined)". Ensure "Draw Lines: Smart Money Only" is checked.
For Combined Signals: Check "Draw Lines: UT & Smart Money (Combined)". This will override the other two.
Adjust Parameters:
Start with default settings. Observe how the signals appear on your chosen asset and timeframe.
Refine Smart Money: If you see too many "noisy" market structure breaks, increase swingSize. If you want earlier breakouts, try "Wicks" for bosConfType.
Refine UT Bot: Adjust a_ut (Sensitivity) to get more or fewer UT Bot signals. Change c_ut (ATR Period) if you want larger or smaller TP/SL distances. Experiment with h_ut to see if Heikin Ashi smoothing suits your trading style.
Adjust TP/SL Multiplier: If using "Smart Money Only" mode, fine-tune sm_tp_sl_multiplier to set appropriate risk/reward levels.
Interpret Signals & Lines:
Buy/Sell Flags: These indicate the presence of a signal based on your selected drawing mode.
Entry Line (Blue Solid): This is where the signal was generated (usually the close price of the signal candle).
SL Line (Red/Green Solid): Your calculated stop loss level.
TP Lines (Dashed): Your three calculated take profit levels (TP1, TP2, TP3, where TP3 is the furthest target).
Smart Money Lines (BOS/CHoCH): These lines indicate horizontal levels where market structure breaks occurred. CHoCH labels might appear at the first structural break against the prior trend.
Monitor Dashboard: Pay attention to the dashboard in the top right corner. This dynamically updates to show the win rates for each TP and, crucially, the "SL before any TP rate." Use these statistics to evaluate the effectiveness of the indicator's signals under your current settings and chosen mode.
*
Set Alerts (Optional): You can set up alerts for any of the specific signals (UT Bot Long/Short, Smart Money Bullish/Bearish, or the "Line Draw" combined signals) to notify you when they occur, even if you're not actively watching the chart.
By following this tutorial, you'll be able to effectively use and customize the "Alpha - Combined Breakout" indicator to suit your trading strategy.
Range Breakout Statistics [Honestcowboy]
⯁ Overview
The Range Breakout Statistics uses a very simple system to detect ranges/consolidating markets. The principle is simple, it looks for areas where the slope of a moving average is flat compared to past values. If the moving average is flat for X amount of bars that's a range and it will draw a box.
The statistics part of the script is a bit more complicated. The aim of this script is to expand analysis of trading signals in a different way than a regular backtest. It also highlights the polyline tool, one of my favorite drawing tools on the tradingview platform.
⯁ Statistics Methods
The script has 2 different modes of analyzing a trading signals strength/robustness. It will do that for 2 signals native to the script.
Upper breakout: first price breakout at top of box, before max bars (100 bars by default)
Lower breakout: first price breakout at bottom of box, before max bars
The analysis methods themselves are straightforward and it should be possible for tradingview community to expand this type of analysis to other trading signals. This script is a demo for this analysis, yet some might still find the native signals helpful in their trading, that's why the script includes alerts for the 2 native signals. I've also added a setting to disable any data gathering, which makes script run faster if you want to automate it.
For both of the analysis methods it uses the same data, just with different calculations and drawing methods. The data set is all past price action reactions to the signals saved in a matrix. Below a chart for explaining this visually.
⯁ Method 1: Averages Projection
The idea behind this is that just showing all price action that happened after signal does not give actionable insights. It's more a spaghetti jumble mess of price action lines. So instead the script averages the data out using 3 different approaches, all selectable in the settings menu.
Geometric Average: useful as it accurately reflects compound returns over time, smoothing out the impact of large gains or losses. Accounts for volatility drift.
Arithmetic Average: a standard average calculation, can be misleading in trading due to volatility drift. It is the most basic form of averaging so I included it.
Median: useful as any big volatility huge moves after a signal does not really impact the mean as it's just the middle value of all values.
These averages are the 2 lines you will find in the middle of the projection. Having a clear difference between a lower break average and upper break average price reaction can signal significance of the trading signal instead of pure chaos.
Outside of this I also included calculations for the maximum and minimum values in the dataset. This is useful for seeing price reactions range to the signal, showing extreme losses or wins are possible. For this range I also included 2 matrices of highs and lows data. This makes it possible to draw a band between the range based on closing price and the one using high/low data.
Below is a visualisation of how the averages data is shown on chart.
⯁ Method 2: Equity Simulation
This method will feel closer to home for traders as it more closely resembles a backtest. It does not include any commissions however and also is just a visualisation of price reaction to a signal. This method will simulate what would happen if you would buy at the breakout point and hold the trade for X amount of bars. With 0 being sell at same bar close. To test robustness I've given the option to visualise Equity simulation not just for 1 simulation but a bunch of simulations.
On default settings it will draw the simulations for 0 bars holding all the way to 10 bars holding. The idea behind it is to check how stable the effect is, to have further confirmation of the significance of the signal. If price simulation line moves up on average for 0 bars all the way to 10 bars holding time that means the signal is steady.
Below is a visualisation of the Equity Simulation.
⯁ Signal filtering
For the boxes themselves where breakouts come from I've included a simple filter based on the size of the box in ATR or %. This will filter out all the boxes that are larger top to bottom than the ATR or % value you setup.
⯁ Coloring of Script
The script includes 5 color themes, each carefully created using color themes from the pantone color institute. There are no color settings or other visual settings in the script, the script themes are simple and always have colors that work well together. Equity simulation uses a gradient based on lightness to color the different lines so it's easier to differentiate them while still upper breaks having a different color than lower breaks.
This script is not created to be used in conjunction with other scripts, it will force you into a background color that matches the theme. It's purpose is a research tool for systematic trading, to analyse signals in more depth.
Metaverse color theme:
⯁ Conclusion
I hope this script will help traders get a deeper understanding of how different assets react to their assets. It should be possible to convert this script into other signals if you know how to code on the platform. It is my intention to make more publications that include this type of analysis. It is especially useful when dealing with signals that do not happen often enough, so a regular backtest is not enough to test their significance.
Bullish/Bearish Average Wicks & Range (1 Month)This Indicator indicates the average upper and lower wick and the average body size of candles for the previous 20 periods. This indicator though separates the bullish and the bearish data from one another.
BTC Breakout Bot (TP/SL + Alerts)📈 BTC Breakout Bot (TP/SL + Alerts)
This strategy is designed for Bitcoin (BTC/USDT) on breakout trades. It detects price breakouts using recent highs and lows, and automatically handles:
✅ Long and short entries
✅ Take Profit and Stop Loss levels
✅ Built-in alert system (compatible with Telegram/webhook)
✅ Customizable lookback, TP, and SL settings
Strategy logic:
Enters a long position when price breaks above the highest high of the last N candles.
Enters a short position when price breaks below the lowest low of the last N candles.
Each trade includes a dynamic Take Profit and Stop Loss based on a % of entry price.
Alerts are triggered for every breakout trade (long or short).
Parameters:
Breakout Lookback: Number of candles to check for breakouts (default: 20)
Take Profit (%): TP level based on percentage from entry (default: 5%)
Stop Loss (%): SL level based on percentage from entry (default: 2%)
Floor and Roof Indicator with SignalsFloor and Roof Indicator with Trading Signals
A comprehensive support and resistance indicator that identifies premium and discount zones with automated signal generation.
Key Features:
Dynamic Support/Resistance Zones: Calculates floor (support) and roof (resistance) levels using price action and volatility
Premium/Discount Zone Identification: Highlights areas where price may find resistance or support
Customizable Signal Frequency: Control how often signals are displayed (every Nth occurrence)
Visual Signal Table: Optional table showing the last 5 long and short signal prices
Multiple Timeframe Compatibility: Works across all timeframes
Technical Details:
Uses ATR-based calculations for dynamic zone width adjustment
Combines Bollinger Bands with highest/lowest price analysis
Smoothing options for cleaner signal generation
Fully customizable colors and display options
How to Use:
Floor Zones (Blue): Potential support areas where long positions may be considered
Roof Zones (Pink): Potential resistance areas where short positions may be considered
Signal Crosses: Visual markers when price interacts with key levels
Signal Table: Track recent signal prices for analysis
Settings:
Length: Period for calculations (default: 200)
Smooth: Smoothing factor for cleaner signals
Zone Width: Adjust the thickness of support/resistance zones
Signal Frequency: Control signal display frequency
Visual Options: Customize colors and table position
Alerts Available:
Long signal alerts when price touches discount zones
Short signal alerts when price reaches premium zones
Educational Purpose: This indicator is designed to help traders identify potential support and resistance areas. Always combine with proper risk management and additional analysis.
This description focuses on the technical aspects and educational value while avoiding any language that could be interpreted as financial advice or guaranteed profits.
Jumping watermark# Jumping watermark
## Function description
- Dynamic watermark: Mainly used to add dynamic watermarks to prevent theft and transfer when recording videos.
- Static watermark: Sharing opinions can easily include information such as trading pairs, cycles, current time, and individual signatures.
### Static watermark:
Display the watermark related to the current trading pair in the center of the chart.
- Configuration items:
- You can choose to configure the display content: current trading pair code and name, cycle, date, time, and individual signature content
### Dynamic watermark
Display the configured watermark content in a dynamic random position.
- Configuration items:
- Turn on or off the display of watermark jumping
- Modify the display text content and style by yourself
----- 中文简介-----
# 跳动水印
## 功能描述
- 动态水印: 主要可用于视频录制时添加动态水印防盗、防搬运。
- 静态水印:观点分享是可方便的带上交易对、周期、当前时间、个签等信息。
### 静态水印:
在图表中心位置显示当前交易对相关信息水印。
- 配置项:
- 可选择配置显示内容:当前交易对代码及名称、周期、日期、时间、个签内容
### 动态水印
动态随机位置显示配置水印内容。
- 配置项:
- 开启或关闭显示水印跳动
- 自行修改配置显示文字内容和样式
Kelly Optimal Leverage IndicatorThe Kelly Optimal Leverage Indicator mathematically applies Kelly Criterion to determine optimal position sizing based on market conditions.
This indicator helps traders answer the critical question: "How much capital should I allocate to this trade?"
Note that "optimal position sizing" does not equal the position sizing that you should have. The Optima position sizing given by the indicator is based on historical data and cannot predict a crash, in which case, high leverage could be devastating.
Originally developed for gambling scenarios with known probabilities, the Kelly formula has been adapted here for financial markets to dynamically calculate the optimal leverage ratio that maximizes long-term capital growth while managing risk.
Key Features
Kelly Position Sizing: Uses historical returns and volatility to calculate mathematically optimal position sizes
Multiple Risk Profiles: Displays Full Kelly (aggressive), 3/4 Kelly (moderate), 1/2 Kelly (conservative), and 1/4 Kelly (very conservative) leverage levels
Volatility Adjustment: Automatically recommends appropriate Kelly fraction based on current market volatility
Return Smoothing: Option to use log returns and smoothed calculations for more stable signals
Comprehensive Table: Displays key metrics including annualized return, volatility, and recommended exposure levels
How to Use
Interpret the Lines: Each colored line represents a different Kelly fraction (risk tolerance level). When above zero, positive exposure is suggested; when below zero, reduce exposure. Note that this is based on historical returns. I personally like to increase my exposure during market downturns, but this is hard to illustrate in the indicator.
Monitor the Table: The information panel provides precise leverage recommendations and exposure guidance based on current market conditions.
Follow Recommended Position: Use the "Recommended Position" guidance in the table to determine appropriate exposure level.
Select Your Risk Profile: Conservative traders should follow the Half Kelly or Quarter Kelly lines, while more aggressive traders might consider the Three-Quarter or Full Kelly lines.
Adjust with Volatility: During high volatility periods, consider using more conservative Kelly fractions as recommended by the indicator.
Mathematical Foundation
The indicator calculates the optimal leverage (f*) using the formula:
f* = μ/σ²
Where:
μ is the annualized expected return
σ² is the annualized variance of returns
This approach balances potential gains against risk of ruin, offering a scientific framework for position sizing that maximizes long-term growth rate.
Notes
The Full Kelly is theoretically optimal for maximizing long-term growth but can experience significant drawdowns. You should almost never use full kelly.
Most practitioners use fractional Kelly strategies (1/2 or 1/4 Kelly) to reduce volatility while capturing most of the growth benefits
This indicator works best on daily timeframes but can be applied to any timeframe
Negative Kelly values suggest reducing or eliminating market exposure
The indicator should be used as part of a complete trading system, not in isolation
Enjoy the indicator! :)
P.S. If you are really geeky about the Kelly Criterion, I recommend the book The Kelly Capital Growth Investment Criterion by Edward O. Thorp and others.