Econometrica by [SS]This is Econometrica, an indicator that aims to bridge a big gap between the resources available for analysis of fundamental data and its impact on tickers and price action.
I have noticed a general dearth of available indicators that offer insight into how fundamentals impact a ticker and provide guidance on how they these economic factors influence ticker behaviour.
Enter Econometrica. Econometrica is a math based indicator that aims to co-integrate and model indicator price action in relation to critical economic metrics.
Econometrica supports the following US based economic data:
CPI
Non-Farm Payroll
Core Inflation
US Money Supply
US Central Bank Balance Sheet
GDP
PCE
Let's go over the functions of Econometrica.
Creating a Regression Cointegrated Model
The first thing Econometrica does is creates a co-integrated regression, as you see in the main chart, predicting ticker value ranges from fundamental economic data.
You can visualize this in the main chart above, but here are some other examples:
SPY vs Core Inflation:
BA vs PCE:
QQQ vs US Balance Sheet:
The band represents the anticipated range the ticker should theoretically fall in based on the underlying economic value. The indicator will breakdown the relationship between the economic indicator and the ticker more precisely. In the images above, you can see how there are some metrics provided, including Stationairty, lagged correlation, Integrated Correlation and R2. Let's discuss these very briefly:
Stationarity: checks to ensure that the relationship between the economic indicator and ticker is stationary. Stationary data is important for making unbiased inferences and projections, so having data that is stationary is valuable.
Lagged Correlation: This is a very interesting metric. Lagged correlation means whether there is a delay in the economic indicator and the response of the ticker. Typically, you will observed a lagged correlation between an economic indicator and price of a ticker, as it can take some time for economic changes to reach the market. This lagged correlation will provide you with how long it takes for the economic indicator to catch up with the ticker in months.
Integrated Correlation: This metric tells you how good of a fit the regression bands are in relation to the ticker price. A higher correlation, means the model is better at consistent and accurate information about the anticipated range for the ticker in relation to the economic indicator.
R2: Provides information on the variance and degree of model fit. A high R2 value means that the model is capable of explaining a large amount of variance between the economic indicator and the ticker price action.
Explaining the Relationship
Owning to the fact that the indicator is a bit on the mathy side (it has to be to do this kind of task), I have included ability for the indicator to explain and make suggestions based on the underlying data. It can assess the model's fit and make suggestions for tweaking. It can also explain the implications of the data being presented in the model.
Here is an example with QQQ and the US Balance Sheet:
This helps to simplify and interpret the results you are looking at.
Forecasting the Economic Indicator
In addition to assessing the economic indicator's impact on the ticker, the indicator is also capable of forecasting out the economic indicator over the next 25 releases.
Here is an example of the CPI forecast:
Overall use of the indicator
The indicator is meant to bridge the gap between Technical Analysis and Fundamental Analysis.
Any trader who is attune to fundamentals would benefit from this, as this provides you with objective data on how and to what extent fundamental and economic data impacts tickers.
It can help affirm hypothesis and dispel myths objectively.
It also omits the need from having to perform these types of analyses outside of Tradingview (i.e. in excel, R or Python), as you can get the data in just a few licks of enabling the indicator.
Conclusion
I have tried to make this indicator as user friendly as possible. Though it uses a lot of math, it is fairly straight forward to interpret.
The band plotted can be considered the fair market value or FMV of the ticker based on the underlying economic data, provided the indicator tells you that the relationship is significant (and it will blatantly give you this information verbatim, you don't have to interpret the math stuff).
This is US economic data only. It does not pull economic data from other countries. You can absolutely see how US economic data impacts other markets like the TSX, BANKNIFTY, NIFTY, DAX etc. but the indicator is only pulling US economic data.
That is it!
I hope you enjoy it and find this helpful!
Thanks everyone and safe trades as always 🚀🚀🚀
Statistics
MACD + RSI + ADX + EMA Strategy PROThis strategy combines MACD crossovers, RSI momentum, ADX trend strength, EMA trend bias, and ATR-based filters to generate high-quality entries. It includes risk-based position sizing, trailing stops, and optional higher-timeframe confirmation for smarter, cleaner trades. Great for crypto, forex, and trending markets on intraday timeframes.
Estrategia de Bitcoin con 5 Rangos de Precio# 🚀 "Bitcoin Dynamic Ranges" Strategy 🚀
## Why will this strategy make you stand out in the market?
This revolutionary Bitcoin strategy combines **five specific price ranges** with **smart capital allocation** and an **automatic profit protection system**, designed to maximize your profits while reducing risk.
### ✅ Main Features:
1. **Inverse Capital Allocation** - Higher investment at low prices, lower at high prices:
- Lower ranges: 30% of your capital
- Intermediate ranges: 25%, 20%, 15%
- Higher ranges: only 10% of your capital
2. **Validation every 8 hours** - No need to be glued to the screen: the strategy automatically checks entry conditions three times a day.
3. **Smart Trailing Stop Loss** - Automatically protects your profits:
- Triggered when the price rises $5,000 above your entry point
- Dynamically adjusts as the price continues to rise
- Always maintains $1,000 as a safety margin
4. **Buy at Lows** - The strategy automatically identifies when the price falls below all your ranges, allowing you to buy at the best moments.
### 🔍 How does it work?
Imagine you buy Bitcoin at $50,000. When the price rises to $55,000, a stop loss is automatically triggered at $54,000. If the price continues to rise to $60,000, your stop loss is adjusted to $59,000, ensuring you capture at least $9,000 of profit, no matter what happens.
### 💰 Benefits:
- **Reduce risk** - Invest less capital at higher prices
- **Maximize profits** - Buy more when the price is low
- **Save time** - The strategy executes automatically
- **Preserves capital** - Trailing stop protects your profits
- **Fully customizable** - Adjust price ranges based on your market analysis
## 📊 Apply this strategy today and take your Bitcoin trading to the next level! 📊
Next Bar CountdownLittle script to show a countdown for the next candle (or the close of the actual candle) on the bottom right corner of the chart.
There is a countdown integrated in the scale, but it always changes the vertical position and sometimes it is hard to find between labels and often is cover by the mouse cursor etc. ...
I want a fixed position for that to reduce "mental overhead".
It is driven by ticks, if there are no ticks the counter will not update. This a limitation in the tv pine script. (at least this is what claude.ai says ;-) )
Avg.ROC TableThis indicator calculates the average Rate of Change (ROC) for up to 30 user-selected assets over a specified number of candles. It then ranks the assets—assigning rank 1 to the asset with the highest average ROC (strongest momentum) and rank 30 to the asset with the lowest. The results are displayed in a clean, easy-to-read table split into two stacks of 15 assets each, allowing you to quickly see which assets are performing best.
Trade Ladder Pro: Compounding & Risk ManagerTrade Ladder Pro: Compounding & Risk Manager
Inspired by the popular $20 to $52,000 trading challenge, this tool is designed to help you scale your trading account using systematic compounding and enhanced risk management techniques. Whether you’re aiming for disciplined growth or fine-tuning your risk/reward, Trade Ladder Pro offers a flexible approach to visualizing your trade levels.
How to Use:
Inputs:
Compounding Mode:
Set your starting balance, final balance goal, number of trades, and current trade level. You can move to the next trade after a successful trade in settings. The entries are not signals. They are there to help manage risk.
The script calculates the necessary compounding factor to grow your balance across the defined trades.
Risk Management Mode:
In addition to the above, specify a risk percentage and risk/reward ratio.
Input an entry price (or leave it at 0 to use the current price) to automatically compute the stop loss and take profit levels.
Display Options:
Choose the table’s position on the chart (e.g., Top Right, Top Left, Bottom Right, Bottom Left).
Pick between a vertical or horizontal layout for a display that suits your workflow.
Results:
The table will display the trade level, starting balance, risk amount, entry price, take profit, and (if in Risk Management mode) stop loss along with the projected ending balance.
Community & Feedback:
Your feedback is invaluable! Please share any tips or report any errors you encounter so we can continue to improve this tool. Happy trading!
Smart % Levels📈 Smart % Levels – Visualize Significant Percentage Moves
What it does:
This indicator plots horizontal levels based on a percentage change from the previous day's close (or open, if selected). It allows traders to visualize price movements relative to meaningful thresholds like ±1%, ±2%, etc.
What makes it different:
Unlike other level indicators, Smart % Levels only displays the relevant levels based on current price action. This avoids clutter by showing only the levels that are being approached or crossed by the current price. It's a clean and dynamic way to visualize key price zones for intraday analysis.
How it works:
- Select between using the previous day's Close or Open as the reference
- Choose the percentage spacing between levels (e.g., 1%, 0.5%, etc.)
- Enable optional labels to see the exact percentage of each level
- Automatically filters levels to only show those between yesterday's price and today's current price
- Includes customization for colors, line styles, widths, and opacity
Best for:
Day traders and scalpers who want a quick, clean view of how far the current price has moved from yesterday’s reference, without being overwhelmed by unnecessary lines.
Extra notes:
- The levels are recalculated each day at the market open
- All graphics reset at the start of each session to maintain clarity
- This script avoids repainting by only plotting levels relative to available historical data (no lookahead)
This tool is for informational purposes only and should not be considered as financial advice. Always do your own research before making trading decisions.
ATR & PTR TableThe ATR & PTR Table Indicator displays a dynamic table that provides Average True Range (measures market volatility over 1D, 1W, and 1M timeframes), Price trading range (difference between the high and low prices over the same periods) & percentage of the typical range that has been traded. This indicator will help traders identify potential breakout zones and assess volatility across multiple timeframes.
This had been optimized to show ATR and PTR on every time frame. The (1D) represents ATR on whatever timeframe you are currently on.
ML Deep Regression Pro (TechnoBlooms)ML Deep Regression Pro is a machine-learning-inspired trading indicator that integrates Polynomial Regression, Linear Regression and Statistical Deviation models to provide a powerful, data-driven approach to market trend analysis.
Designed for traders, quantitative analysts and developers, this tool transforms raw market data into predictive trend insights, allowing for better decision-making and trend validation.
By leveraging statistical regression techniques, ML Deep Regression Pro eliminates market noise and identifies key trend shifts, making it a valuable addition to both manual and algorithmic trading strategies.
REGRESSION ANALYSIS
Regression is a statistical modeling technique used in machine learning and data science to identify patterns and relationships between variables. In trading, it helps detect price trends, reversals and volatility changes by fitting price data into a predictive model.
1. Linear Regression -
The most widely used regression model in trading, providing a best-fit plotted line to track price trends.
2. Polynomial Regression -
A more advanced form of regression that fits curved price structures, capturing complex market cycles and improving trend forecasting accuracy.
3. Standard Deviation Bands -
Based on regression calculations, these bands measure price dispersion and identify overbought/ oversold conditions, similar to Bollinger Bands. By default, these lines are hidden and user can make it visible through Settings.
KEY FEATURES :-
✅ Hybrid Regression Engine – Combines Linear and Polynomial Regression to detect market trends with greater accuracy.
✅ Dynamic Trend Bias Analysis – Identifies bullish & bearish market conditions using real-time regression models.
✅ Standard Deviation Bands – Measures price volatility and potential reversals with an advanced deviation model.
✅ Adaptive EMA Crossover Signals – Generates buy/sell signals when price momentum shifts relative to the regression trend.
Weight Convergence DivergenceWeight Convergence Divergence ⚖️
1. Introduction
The Weight Convergence Divergence (WCD) indicator applies principles of rotational equilibrium from classical physics to financial market analysis. By quantifying market momentum as a physical balance system, this indicator helps traders identify potential price reversals and continuation patterns through the visualization of market forces .
2. Theoretical Grounds 📚
The WCD draws inspiration from the physical concept of rotational equilibrium, where opposing forces create a balance or imbalance in a system (Giancoli, 2016, pp.247–249). In market analysis, this can be translated to the comparative measurement of bullish and bearish momentum (Bouchaud and Potters, 2003) . Lo and MacKinlay (1988) and Corbet and Katsiampa (2018) demonstrate that markets exhibit both mean-reverting and momentum characteristics, supporting the concept of opposing market forces that the WCD seeks to visualize. Bouchaud and Potters (2003) further highlight that principles from statistical physics can be applied to financial markets, providing a theoretical foundation for approaches like we are doing with the WCD.
3. Methodology 🧪
The WCD indicator quantifies market mass through the following approach:
Calculates mass by multiplying the candle's body (close-open) with volume mass = body * volume
Compares recent market mass (right side) with historical mass (left side)
Visualizes the equilibrium point with a dynamic balance line balance_ln
Generates signals when the balance shifts buy_signal = ta.crossover(right_mass, 0) and left_mass <= 0 and ly > middle_level
sell_signal = ta.crossunder(right_mass, 0) and left_mass >= 0 and ly < middle_level
4. Visual Elements 🎨
Balance Line: A tilting dashed line representing equilibrium between past and present market forces
🟩 Green Boxes: Positive market mass (bullishness)
🟥 Red Boxes: Negative market mass (bearishness)
▲ Buy Signals: When right mass turns positive while left mass is negative
▼ Sell Signals: When right mass turns negative while left mass is positive
5. Integrated Risk Management 🛡️
Automatic stop loss calculation based on Average True Range (ATR)
Dynamic profit targets calibrated to user-defined risk-reward ratios
Visual position management table to track entries, targets, and stops throughout trade duration
6. Parametrization ⚙️
Distance: Number of bars for mass calculation
ATR Length: Period for volatility calculation
ATR Factor: Multiplier applied to ATR for stop loss determination
Risk-Reward Ratio: Factor used for target calculation
7. Implementation Strategies 📈
7.1. Trend Reversal Strategy (More Risky) 🔄
Identify overextended market conditions
Wait for a counter-trend signal
Consider the calculated stop loss and take profit
7.2. Momentum Continuation Strategy (Less Risky) ➡️
Identify the prevailing trend
Look for multiple signals in the trend direction ( the balance line is not the trend! )
Wait for a second or third signal confirmation
Consider the calculated stop loss and take profit
8. Timeframe Flexibility: ⏱️
Lower timeframes (5-15m): Quick signals for scalping
Medium timeframes (30m-4h): Balanced for day trading
Higher timeframes (Daily+): Reliable signals for swing trading
9. References 📗
Bouchaud, J.-P. and Potters, M. (2003). Theory of Financial Risk and Derivative Pricing. doi: doi.org .
Corbet, S. and Katsiampa, P. (2018). Asymmetric mean reversion of Bitcoin price returns. International Review of Financial Analysis. doi: doi.org .
Giancoli, D.C. (2016). Physics : Principles with Applications. 7th ed. Harlow: Pearson Education, pp.247–249.
Lo, A.W. and MacKinlay, A.C. (1988). Stock Market Prices Do Not Follow Random Walks: Evidence from a Simple Specification Test. Review of Financial Studies, 1(1), pp.41–66. doi: doi.org .
Disclaimer ⚠️
The Weight Convergence Divergence indicator is designed for informational and educational purposes only. Past performance is not necessarily indicative of future results. Traders should conduct thorough analysis and employ proper risk management techniques. This tool does not constitute financial advice and should be used at the user's own discretion.
HBND ReferenceChart the HBND as an index based on weighting found on the HBND Etf website. For best results display the adjusted close since HBND is a high yielding fund. The weightings have to be updated manually.
There are three display options:
1. Normalize the index relative to the symbol on the chart (presumably HBND) and this is the default.
2. Percentage change relative to the first bar of the index
3. The raw value which will be the tlt price * tlt percentage weighting + vglt price * vglt percentage weighting + edv percentage weighting * edv price.
Buy on 5% dip strategy with time adjustment
This script is a strategy called "Buy on 5% Dip Strategy with Time Adjustment 📉💡," which detects a 5% drop in price and triggers a buy signal 🔔. It also automatically closes the position once the set profit target is reached 💰, and it has additional logic to close the position if the loss exceeds 14% after holding for 230 days ⏳.
Strategy Explanation
Buy Condition: A buy signal is triggered when the price drops 5% from the highest price reached 🔻.
Take Profit: The position is closed when the price hits a 1.22x target from the average entry price 📈.
Forced Sell Condition: If the position is held for more than 230 days and the loss exceeds 14%, the position is automatically closed 🚫.
Leverage & Capital Allocation: Leverage is adjustable ⚖️, and you can set the percentage of capital allocated to each trade 💸.
Time Limits: The strategy allows you to set a start and end time ⏰ for trading, making the strategy active only within that specific period.
Code Credits and References
Credits: This script utilizes ideas and code from @QuantNomad and jangdokang for the profit table and algorithm concepts 🔧.
Sources:
Monthly Performance Table Script by QuantNomad:
ZenAndTheArtOfTrading's Script:
Strategy Performance
This strategy provides risk management through take profit and forced sell conditions and includes a performance table 📊 to track monthly and yearly results. You can compare backtest results with real-time performance to evaluate the strategy's effectiveness.
The performance numbers shown in the backtest reflect what would have happened if you had used this strategy since the launch date of the SOXL (the Direxion Daily Semiconductor Bull 3x Shares ETF) 📅. These results are not hypothetical but based on actual performance from the day of the ETF’s launch 📈.
Caution ⚠️
No Guarantee of Future Results: The results are based on historical performance from the launch of the SOXL ETF, but past performance does not guarantee future results. It’s important to approach with caution when applying it to live trading 🔍.
Risk Management: Leverage and capital allocation settings are crucial for managing risk ⚠️. Make sure to adjust these according to your risk tolerance ⚖️.
ADX BoxDescription:
The ADX Box indicator provides traders with a quick and intuitive way to monitor the current trend strength based on the Average Directional Index (ADX), calculated with a customisable period (default: 7 periods).
This compact indicator neatly displays the current ADX value rounded to one decimal place, along with a clear directional arrow:
Green upward triangle (▲): Indicates that ADX is rising above its moving average, signaling increasing trend strength.
Red downward triangle (▼): Indicates that ADX is declining below its moving average, signaling weakening trend strength.
Key Features:
Small and clean visual representation.
Dynamically updates in real-time directly on the chart.
Ideal for quick trend strength assessment without cluttering your workspace.
Recommended Usage:
Quickly identifying whether market trends are strengthening or weakening.
Enhancing decision-making for trend-following or breakout trading strategies.
Complementing other indicators such as ATR boxes for volatility measurement.
Feel free to use, share, and incorporate this indicator into your trading setups for clearer insights and more confident trading decisions!
Correlation TableThis indicator displays a vertical table that shows the correlation between the asset currently loaded on the chart and up to 32 selected trading pairs. It offers the following features:
Chart-Based Correlation: Correlations are calculated based on the asset you have loaded in your chart, providing relevant insights for your current market focus.
Configurable Pairs: Choose from a list of 32 symbols (e.g., AUDUSD, EURUSD, GBPUSD, etc.) with individual checkboxes to include or exclude each pair in the correlation analysis.
Custom Correlation Length: Adjust the lookback period for the correlation calculation to suit your analysis needs.
Optional EMA Smoothing: Enable an Exponential Moving Average (EMA) on the price data, with a configurable EMA length, to smooth the series before calculating correlations.
Color-Coded Output: The table cells change color based on the correlation strength and direction—neutral, bullish (green), or bearish (red)—making it easy to interpret at a glance.
Clear Table Layout: The indicator outputs a neatly organized vertical table with headers for "Pair" and "Correlation," ensuring the information is displayed cleanly and is easy to understand.
Ideal for traders who want a quick visual overview of how different instruments correlate with their current asset, this tool supports informed multi-asset analysis
ITALIANO:
Questo indicatore visualizza una tabella verticale che mostra la correlazione tra l'asset attualmente caricato sul grafico e fino a 32 coppie di trading selezionate. Offre le seguenti funzionalità:
Correlazione basata sul grafico: le correlazioni vengono calcolate in base all'asset caricato nel grafico, fornendo informazioni pertinenti per il tuo attuale focus di mercato.
Coppie configurabili: scegli da un elenco di 32 simboli (ad esempio, AUDUSD, EURUSD, GBPUSD, ecc.) con caselle di controllo individuali per includere o escludere ciascuna coppia nell'analisi della correlazione.
Lunghezza di correlazione personalizzata: regola il periodo di lookback per il calcolo della correlazione in base alle tue esigenze di analisi.
Smoothing EMA opzionale: abilita una media mobile esponenziale (EMA) sui dati dei prezzi, con una lunghezza EMA configurabile, per smussare la serie prima di calcolare le correlazioni.
Output codificato a colori: le celle della tabella cambiano colore in base alla forza e alla direzione della correlazione, neutra, rialzista (verde) o ribassista (rosso), rendendola facile da interpretare a colpo d'occhio.
Clear Table Layout: l'indicatore genera una tabella verticale ordinatamente organizzata con intestazioni per "Coppia" e "Correlazione", assicurando che le informazioni siano visualizzate in modo chiaro e siano facili da comprendere.
Ideale per i trader che desiderano una rapida panoramica visiva di come diversi strumenti siano correlati con il loro asset corrente, questo strumento supporta un'analisi multi-asset informata
Standard Deviation (fadi)The Standard Deviation indicator uses standard deviation to map out price movements. Standard deviation measures how much prices stray from their average—small values mean steady trends, large ones mean wild swings. Drawing from up to 20 years of data, it plots key levels using customizable Fibonacci lines tied to that standard deviation, giving traders a snapshot of typical price behavior.
These levels align with a bell curve: about 68% of price moves stay within 1 standard deviation, 95% within roughly 2, and 99.7% within roughly 3. When prices break past the 1 StDev line, they’re outliers—only 32% of moves go that far. Prices often snap back to these lines or the average, though the reversal might not happen the same day.
How Traders Use It
If prices surge past the 1 StDev line, traders might wait for momentum to fade, then trade the pullback to that line or the average, setting a target and stop.
If prices dip below, they might buy, anticipating a bounce—sometimes a day or two later. It’s a tool to spot overstretched prices likely to revert and/or measure the odds of continuation.
Settings
Higher Timeframe: Sets the Higher Timeframe to calculate the Standard Deviation for
Show Levels for the Last X Days: Displays levels for the specified number of days.
Based on X Period: Number of days to calculate standard deviation (e.g., 20 years ≈ 5,040 days). Larger periods smooth out daily level changes.
Mirror Levels on the Other Side: Plots symmetric positive and negative levels around the average.
Fibonacci Levels Settings: Defines which levels and line styles to show. With mirroring, negative values aren’t needed.
Background Transparency: Turn on Background color derived from the level colors with the specified transparency
Overrides: Lets advanced users input custom standard deviations for specific tickers (e.g., NQ1! at 0.01296).
StatPivot- Dynamic Range Analyzer - indicator [PresentTrading]Hello everyone! In the following few open scripts, I would like to share various statistical tools that benefit trading. For this time, it is a powerful indicator called StatPivot- Dynamic Range Analyzer that brings a whole new dimension to your technical analysis toolkit.
This tool goes beyond traditional pivot point analysis by providing comprehensive statistical insights about price movements, helping you identify high-probability trading opportunities based on historical data patterns rather than subjective interpretations. Whether you're a day trader, swing trader, or position trader, StatPivot's real-time percentile rankings give you a statistical edge in understanding exactly where current price action stands within historical contexts.
Welcome to share your opinions! Looking forward to sharing the next tool soon!
█ Introduction and How it is Different
StatPivot is an advanced technical analysis tool that revolutionizes retracement analysis. Unlike traditional pivot indicators that only show static support/resistance levels, StatPivot delivers dynamic statistical insights based on historical pivot patterns.
Its key innovation is real-time percentile calculation - while conventional tools require new pivot formations before updating (often too late for trading decisions), StatPivot continuously analyzes where current price stands within historical retracement distributions.
Furthermore, StatPivot provides comprehensive statistical metrics including mean, median, standard deviation, and percentile distributions of price movements, giving traders a probabilistic edge by revealing which price levels represent statistically significant zones for potential reversals or continuations. By transforming raw price data into statistical insights, StatPivot helps traders move beyond subjective price analysis to evidence-based decision making.
█ Strategy, How it Works: Detailed Explanation
🔶 Pivot Point Detection and Analysis
The core of StatPivot's functionality begins with identifying significant pivot points in the price structure. Using the parameters left and right, the indicator locates pivot highs and lows by examining a specified number of bars to the left and right of each potential pivot point:
Copyp_low = ta.pivotlow(low, left, right)
p_high = ta.pivothigh(high, left, right)
For a point to qualify as a pivot low, it must have left higher lows to its left and right higher lows to its right. Similarly, a pivot high must have left lower highs to its left and right lower highs to its right. This approach ensures that only significant turning points are recognized.
🔶 Percentage Change Calculation
Once pivot points are identified, StatPivot calculates the percentage changes between consecutive pivot points:
For drops (when a pivot low is lower than the previous pivot low):
CopydropPercent = (previous_pivot_low - current_pivot_low) / previous_pivot_low * 100
For rises (when a pivot high is higher than the previous pivot high):
CopyrisePercent = (current_pivot_high - previous_pivot_high) / previous_pivot_high * 100
These calculations quantify the magnitude of each market swing, allowing for statistical analysis of historical price movements.
🔶 Statistical Distribution Analysis
StatPivot computes comprehensive statistics on the historical distribution of drops and rises:
Average (Mean): The arithmetic mean of all recorded percentage changes
CopyavgDrop = array.avg(dropValues)
Median: The middle value when all percentage changes are arranged in order
CopymedianDrop = array.median(dropValues)
Standard Deviation: Measures the dispersion of percentage changes from the average
CopystdDevDrop = array.stdev(dropValues)
Percentiles (25th, 75th): Values below which 25% and 75% of observations fall
Copyq1 = array.get(sorted, math.floor(cnt * 0.25))
q3 = array.get(sorted, math.floor(cnt * 0.75))
VaR95: The maximum expected percentage drop with 95% confidence
Copyvar95D = array.get(sortedD, math.floor(nD * 0.95))
Coefficient of Variation (CV): Measures relative variability
CopycvD = stdDevDrop / avgDrop
These statistics provide a comprehensive view of market behavior, enabling traders to understand the typical ranges and extreme moves.
🔶 Real-time Percentile Ranking
StatPivot's most innovative feature is its real-time percentile calculation. For each current price, it calculates:
The percentage drop from the latest pivot high:
CopycurrentDropPct = (latestPivotHigh - close) / latestPivotHigh * 100
The percentage rise from the latest pivot low:
CopycurrentRisePct = (close - latestPivotLow) / latestPivotLow * 100
The percentile ranks of these values within the historical distribution:
CopyrealtimeDropRank = (count of historical drops <= currentDropPct) / total drops * 100
This calculation reveals exactly where the current price movement stands in relation to all historical movements, providing crucial context for decision-making.
🔶 Cluster Analysis
To identify the most common retracement zones, StatPivot performs a cluster analysis by dividing the range of historical drops into five equal intervals:
CopyrangeSize = maxVal - minVal
For each interval boundary:
Copyboundaries = minVal + rangeSize * i / 5
By counting the number of observations in each interval, the indicator identifies the most frequently occurring retracement zones, which often serve as significant support or resistance areas.
🔶 Expected Price Targets
Using the statistical data, StatPivot calculates expected price targets:
CopytargetBuyPrice = close * (1 - avgDrop / 100)
targetSellPrice = close * (1 + avgRise / 100)
These targets represent statistically probable price levels for potential entries and exits based on the average historical behavior of the market.
█ Trade Direction
StatPivot functions as an analytical tool rather than a direct trading signal generator, providing statistical insights that can be applied to various trading strategies. However, the data it generates can be interpreted for different trade directions:
For Long Trades:
Entry considerations: Look for price drops that reach the 70-80th percentile range in the historical distribution, suggesting a statistically significant retracement
Target setting: Use the Expected Sell price or consider the average rise percentage as a reasonable target
Risk management: Set stop losses below recent pivot lows or at a distance related to the statistical volatility (standard deviation)
For Short Trades:
Entry considerations: Look for price rises that reach the 70-80th percentile range, indicating an unusual extension
Target setting: Use the Expected Buy price or average drop percentage as a target
Risk management: Set stop losses above recent pivot highs or based on statistical measures of volatility
For Range Trading:
Use the most common drop and rise clusters to identify probable reversal zones
Trade bounces between these statistically significant levels
For Trend Following:
Confirm trend strength by analyzing consecutive higher pivot lows (uptrend) or lower pivot highs (downtrend)
Use lower percentile retracements (20-30th percentile) as entry opportunities in established trends
█ Usage
StatPivot offers multiple ways to integrate its statistical insights into your trading workflow:
Statistical Table Analysis: Review the comprehensive statistics displayed in the data table to understand the market's behavior. Pay particular attention to:
Average drop and rise percentages to set reasonable expectations
Standard deviation to gauge volatility
VaR95 for risk assessment
Real-time Percentile Monitoring: Watch the real-time percentile display to see where the current price movement stands within the historical distribution. This can help identify:
Extreme movements (90th+ percentile) that might indicate reversal opportunities
Typical retracements (40-60th percentile) that might continue further
Shallow pullbacks (10-30th percentile) that might represent continuation opportunities in trends
Support and Resistance Identification: Utilize the plotted pivot points as key support and resistance levels, especially when they align with statistically significant percentile ranges.
Target Price Setting: Use the expected buy and sell prices calculated from historical averages as initial targets for your trades.
Risk Management: Apply the statistical measurements like standard deviation and VaR95 to set appropriate stop loss levels that account for the market's historical volatility.
Pattern Recognition: Over time, learn to recognize when certain percentile levels consistently lead to reversals or continuations in your specific market, and develop personalized strategies based on these observations.
█ Default Settings
The default settings of StatPivot have been carefully calibrated to provide reliable statistical analysis across a variety of markets and timeframes, but understanding their effects allows for optimal customization:
Left Bars (30) and Right Bars (30): These parameters determine how pivot points are identified. With both set to 30 by default:
A pivot low must be the lowest point among 30 bars to its left and 30 bars to its right
A pivot high must be the highest point among 30 bars to its left and 30 bars to its right
Effect on performance: Larger values create fewer but more significant pivot points, reducing noise but potentially missing important market structures. Smaller values generate more pivot points, capturing more nuanced movements but potentially including noise.
Table Position (Top Right): Determines where the statistical data table appears on the chart.
Effect on performance: No impact on analytical performance, purely a visual preference.
Show Distribution Histogram (False): Controls whether the distribution histogram of drop percentages is displayed.
Effect on performance: Enabling this provides visual insight into the distribution of retracements but can clutter the chart.
Show Real-time Percentile (True): Toggles the display of real-time percentile rankings.
Effect on performance: A critical setting that enables the dynamic analysis of current price movements. Disabling this removes one of the key advantages of the indicator.
Real-time Percentile Display Mode (Label): Chooses between label display or indicator line for percentile rankings.
Effect on performance: Labels provide precise information at the current price point, while indicator lines show the evolution of percentile rankings over time.
Advanced Considerations for Settings Optimization:
Timeframe Adjustment: Higher timeframes generally benefit from larger Left/Right values to identify truly significant pivots, while lower timeframes may require smaller values to capture shorter-term swings.
Volatility-Based Tuning: In highly volatile markets, consider increasing the Left/Right values to filter out noise. In less volatile conditions, lower values can help identify more potential entry and exit points.
Market-Specific Optimization: Different markets (forex, stocks, commodities) display different retracement patterns. Monitor the statistics table to see if your market typically shows larger or smaller retracements than the current settings are optimized for.
Trading Style Alignment: Adjust the settings to match your trading timeframe. Day traders might prefer settings that identify shorter-term pivots (smaller Left/Right values), while swing traders benefit from more significant pivots (larger Left/Right values).
By understanding how these settings affect the analysis and customizing them to your specific market and trading style, you can maximize the effectiveness of StatPivot as a powerful statistical tool for identifying high-probability trading opportunities.
Time Marker Pro: Vertical Line at Key Times)Smart Vertical Line at Specific Time (with Timezone, Color, and Width Controls)
This script draws a vertical line on your chart at a user-defined time once per day, based on the selected timezone.
🕒 Key Features:
Set your target hour and minute
Choose from a list of common timezones (Tehran, UTC, New York, etc.)
Customize the line color and thickness
Works across all intraday timeframes (1min, 5min, 15min, etc.)
Adjusts automatically to bar intervals — no need for exact time matching
This is perfect for traders who want to:
Highlight the start of a session
Mark specific news times, breakouts, or routine entries
Visualize key time-based levels on the chart
Correlation X macroeconomicsFind the correlation between financial assets and the main Brazilian macroeconomic variables:
SELIC rate (Red)
PIB (Green)
Inflation (Blue)
Employment and income (Yellow)
Unlike other indicators that measure the correlation between two assets, the indicator "Correlation X macroeconomics" measures, for example, the correlation that the VALE3 asset has with the SELIC rate.
The correlation is obtained by calculating the variation suffered by a given asset on the day a given Brazilian macroeconomic variable is released.
This indicator can be used on any financial asset.
Use time frame chart = 1 day.
To calculate the correlation, data published by IBGE and the Central Bank of Brazil over a period of time are used. This time period is different depending on the selected macroeconomic variable. Namely:
16 PIB disclosures (4 years)
24 SELIC rate disclosures (3 years)
24 disclosures of IPCA and employment and income data (2 years)
You can select one or more macroeconomic variables to check the effect of correlation separately on each of them.
This indicator "Correlation X macroeconomics" will be updated monthly, as detailed below:
At the end of the day on which the PIB is released
At the end of the day on which employment and income data are released
At the end of the day following the day on which the SELIC rate is published
On the last business day of the month if none of the aforementioned disclosures occur
BTC Dominance PercentageThis BTC Dominance Percentage indicator calculates Bitcoin's dominance relative to altcoins, excluding stablecoins.
🔹 Unlike the standard BTC.D metric, which includes all cryptocurrencies (including stablecoins like USDT, USDC, and DAI), this version focuses only on Bitcoin’s market share compared to altcoins.
🔹 It calculates BTC dominance relative to major altcoins (ETH, BNB, ADA, XRP, SOL) and the OTHERS.D index, which represents smaller-cap altcoins.
🔹 Stablecoins are excluded, providing a clearer view of Bitcoin’s actual strength against the altcoin market, without distortion from fiat-pegged assets.
🚀 This is a true BTC dominance metric for tracking Bitcoin’s market position against altcoins!
Multi-Faceted Analysis ToolHere’s a detailed description for the **Multi-Faceted Analysis Tool** TradingView indicator:
---
## Multi-Faceted Analysis Tool
### Overview
The **Multi-Faceted Analysis Tool** is a powerful TradingView indicator designed to enhance your technical analysis by combining several popular indicators: Simple Moving Average (SMA), Relative Strength Index (RSI), and Moving Average Convergence Divergence (MACD). This indicator provides traders with insightful market signals that can be tailored to fit various trading strategies and timeframes.
### Key Features
1. **Simple Moving Average (SMA)**:
- Plots a customizable SMA on the price chart. The length of the SMA can be adjusted to suit your analysis needs (default is set to 50). The SMA helps identify the overall trend direction.
2. **Relative Strength Index (RSI)**:
- Calculates and plots RSI values, providing insights into potential overbought or oversold market conditions. The user can customize the length of the RSI calculation (default is 14).
- Overbought (70) and oversold (30) levels are visually marked, helping traders identify potential reversal points.
3. **MACD**:
- Computes MACD values with customizable parameters for fast length, slow length, and signal length (defaults are 12, 26, and 9 respectively).
- The MACD histogram is displayed, highlighting the difference between the MACD line and the signal line, which can help traders visualize momentum shifts.
4. **Buy and Sell Signals**:
- Generates clear buy and sell signals based on RSI crossover with established thresholds (buy when RSI crosses above 30, sell when RSI crosses below 70). These signals are visually represented on the chart for easy decision-making.
5. **User-Friendly Customization**:
- All parameters are adjustable, allowing traders to set their preferred values based on individual strategies or market conditions. This flexibility ensures that the tool can cater to a wide range of trading styles.
CHG FROM OPEN %As an intraday trader, I'm more interested in seeing the CHG FROM OPEN % than the CHG % measured from yesterday's close. I overlay this script on a separate Volume pane so it doesn't hide my price chart, and I hide the line since the line isn't particularly useful to me.
This script shows the current real-time CHG FROM OPEN % when you hover outside of the chart during regular trading hours (all times NYC/EST). Hovering over the chart will show you the historical CHG FROM OPEN % and, if extended hours, the CHG FROM OPEN % at the previous close.
You can also find CHG FROM OPEN % in the stock screener, but having it in the chart is more convenient for me.
Share Value Indicator**Share Value Indicator**
This TradingView indicator allows traders to track the real-time total value of their stock holdings. Users can input the number of shares they own, and the script calculates the total value based on the current stock price. A horizontal ray is drawn at the last price level, and a label displays the total value of the shares. The indicator updates dynamically, ensuring only one ray and label are visible at a time. Ideal for traders who want to visualize their investment's real-time worth directly on the chart.
rate_of_changeLibrary "rate_of_change"
// @description: Applies ROC algorithm to any pair of values.
// This library function is used to scale change of value (price, volume) to a percentage value, just as the ROC indicator would do. It is good practice to scale arbitrary ranges to set boundaries when you try to train statistical model.
rateOfChange(value, base, hardlimit)
This function is a helper to scale a value change to its percentage value.
Parameters:
value (float)
base (float)
hardlimit (int)
Returns: per: A float comprised between 0 and 100
TradingView Financial Data ViewerTrading view provides request.security function to view the financial information of a script. The available sets of data is documented on below link
www.tradingview.com
The problem is there is no easy way to view this data as there are limitations to the # of unique requests that can be made. The limit is 40 for general paid accounts. So its makes it impossible to view the data in case you are looking to build a plugin related to some financial analysis.
So I came up with this trading view plugin which based on the documentation bifurcates the values available in the FQ, TTM and FY periods. Then you can select which period you would like to see. How many values you want to see at a time. And then next set of data can be viewed by increasing the Set # from 1 to which ever number keeps giving you the data.
Notes:
This is a data view only indicator and it will only display the latest data available for which quarter was there.
In case you want to view past data then you should go to replay mode and cut to the relative earning tags where you want to view the data
This is again for educational or study purpose only and is majorly helpful for those who want to create indicators based on Trading view supported financials and want to view what values are given for specific financial ids
The documentation reference and source of the plugin can be checked