Pearson Correlation Best MA [victhoreb]Pearson Correlation Best MA is an innovative indicator designed to dynamically select the moving average that best aligns with price action based on the Pearson correlation coefficient. Here’s what it does:
- Multiple MA Evaluation: The indicator computes eight different moving averages — SMA, EMA, DEMA, TEMA, LSMA, RMA, WMA, and VWMA — using a user-defined period.
- Correlation Analysis: For each moving average, it calculates the Pearson correlation with the price (using the average of high and low) over a specified correlation length, then identifies the one with the highest correlation.
- Optional Smoothing: Users can opt to further smooth the selected best moving average for an even more refined signal.
- Visual Cues: The indicator plots the “Best MA” on the chart, colors it based on its direction (bullish or bearish), and also displays the correlation value. Additionally, it can color the price candles to reflect the trend indicated by the best moving average.
- Customizability: All key parameters such as moving average length, correlation length, smoothing options, and color settings are fully customizable.
This tool helps traders by automatically adapting to market conditions—highlighting the moving average that is most in sync with current price trends, potentially improving trade timing and decision-making.
Statistics
ALN Sessions - for NQ2/24/25 - v1
This script does not calculate any stats.
It uses the sessions and stats from NQStats/ALNSessions
Option to draw boxes around the session times.
Options to adjust the table text/background colors/position.
The logic will determine how the Asia and London sessions interact.
Once the New York session starts (8am), it will then display the appropriate stats.
Script quirk...fyi. The script removes the stats table at 6PM.
That's just how it works. I used grok to assist with the code, and it got funky. It works, so I left it that way.
The appropriate stats table will then be displayed when the next New York session begins.
---
There is another table I used just for troubleshooting to show the values of the Asia/London session highs/lows. This can just be ignored.
3/3/25 - republished.
US Yield Curve (2-10yr)US Yield Curve (2-10yr) by oonoon
2-10Y US Yield Curve and Investment Strategies
The 2-10 year US Treasury yield spread measures the difference between the 10-year and 2-year Treasury yields. It is a key indicator of economic conditions.
Inversion (Spread < 0%): When the 2-year yield exceeds the 10-year yield, it signals a potential recession. Investors may shift to long-term bonds (TLT, ZROZ), gold (GLD), or defensive stocks.
Steepening (Spread widening): A rising 10-year yield relative to the 2-year suggests economic expansion. Investors can benefit by shorting bonds (TBT) or investing in financial stocks (XLF). The Amundi US Curve Steepening 2-10Y ETF can be used to profit from this trend.
Monitoring the curve: Traders can track US10Y-US02Y on TradingView for real-time insights and adjust portfolios accordingly.
Gioteen-Norm** Gioteen-Norm : A Versatile Normalization Indicator**
This indicator applies a normalization technique to closing prices, providing a standardized view of price action that can be helpful for identifying overbought and oversold conditions.
**Key Features: **
* **Normalization:** Transforms closing prices into a z-score by subtracting a moving average and dividing by the standard deviation. This creates a standardized scale where values above zero represent prices above the average, and values below zero represent prices below the average.
* **Customizable Moving Average:** Choose from four different moving average methods (SMA, EMA, WMA, VWMA) and adjust the period to suit your trading style.
* **Visual Clarity:** The indicator displays the normalized values as a red line, making it easy to identify potential turning points.
* **Optional Moving Average:** You can choose to display a moving average of the normalized values as a green dashed line, which can help to filter out noise and identify trends.
**Applications:**
* **Overbought/Oversold Identification:** Look for extreme values in the normalized data to identify potential overbought and oversold conditions.
* **Divergence Analysis:** Compare the price action with the normalized values to spot potential divergences, which can signal trend reversals.
* **Trading System Integration:** This indicator can be integrated into various trading systems as a building block for generating trading signals.
**This indicator was a popular tool on the MT4 platform, and now it's available on TradingView!**
**Contact:**
If you have any questions or feedback, feel free to reach out to me at admin@fxcorner.net .
Giotee-Norm**Gioteen-Norm: A Versatile Normalization Indicator**
This indicator applies a normalization technique to closing prices, providing a standardized view of price action that can be helpful for identifying overbought and oversold conditions.
**Key Features:**
* **Normalization:** Transforms closing prices into a z-score by subtracting a moving average and dividing by the standard deviation. This creates a standardized scale where values above zero represent prices above the average, and values below zero represent prices below the average.
* **Customizable Moving Average:** Choose from four different moving average methods (SMA, EMA, WMA, VWMA) and adjust the period to suit your trading style.
* **Visual Clarity:** The indicator displays the normalized values as a red line, making it easy to identify potential turning points.
* **Optional Moving Average:** You can choose to display a moving average of the normalized values as a green dashed line, which can help to filter out noise and identify trends.
**Applications:**
* **Overbought/Oversold Identification:** Look for extreme values in the normalized data to identify potential overbought and oversold conditions.
* **Divergence Analysis:** Compare the price action with the normalized values to spot potential divergences, which can signal trend reversals.
* **Trading System Integration:** This indicator can be integrated into various trading systems as a building block for generating trading signals.
**This indicator was a popular tool on the MT4 platform, and now it's available on TradingView!**
**Contact:**
If you have any questions or feedback, feel free to reach out to me at admin@fxcorner.net .
Autocorrelation Price Forecasting [The Quant Science]Discover how to predict future price movements using autocorrelation and linear regression models to identify potential trading opportunities.
An advanced model to predict future price movements using autocorrelation and linear regression. This script helps identify recurring market cycles and calculates potential gains, with clear visual signals for quick and informed decisions.
Main function
This script leverages an autocorrelation model to estimate the future price of an asset based on historical price relationships. It also integrates linear regression on percentage returns to provide more accurate predictions of price movements.
Insights types
1) Red label on a green candle: Bearish forecast and swing trading opportunity.
2) Red label on a red candle: Bearish forecast and trend-following opportunity.
3) Green label on a red candle: Bullish forecast and swing trading opportunity.
4) Green label on a green candle: Bullish forecast and trend-following opportunity.
IMPORTANT!
The indicator displays a future price forecast. When negative, it estimates a future price drop.
When positive, it estimates a future price increase.
Key Features
Customizable inputs
Analysis Length: number of historical bars used for autocorrelation calculation. Adjustable between 1 and 200.
Forecast Colors: customize colors for bullish and bearish signals.
Visual insights
Labels: hypothetical gains or losses are displayed as labels above or below the bars.
Dynamic coloring: bullish (green) and bearish (red) signals are highlighted directly on the chart.
Forecast line: A continuous line is plotted to represent the estimated future price values.
Practical applications
Short-term Trading: identify repetitive market cycles to anticipate future movements.
Visual Decision-making: colored signals and labels make it easier to visualize potential profit or loss for each trade.
Advanced Customization: adjust the data length and colors to tailor the indicator to your strategies.
Limitations
Prediction price models have some limitations. Trading decisions should be made with caution, considering additional market factors and risk management strategies.
Estimare preț - Proiecție 10 intervaleFuture price 10 intervals
This indicator uses linear regression on the last 20 bars to project the price evolution over the next 10 ranges. The indicator calculates the current regression value and predicts the future value using the built-in ta.linreg() function, then draws a forecast dotted line that updates dynamically. The result is a clear graphical representation of the predicted trend, useful for identifying potential entry and exit points in the market.
TASHAEntry Trigger
Parabolic SAR (PSAR): This indicator helps identify potential trend reversals. A sell signal might occur when the PSAR is above the price, indicating a downtrend. When developing your strategy, look for PSAR dots to switch positions relative to the price chart.
Confluence Indicators:
MACD (Moving Average Convergence Divergence): Look for bearish crossovers (when the MACD line crosses below the signal line) to confirm your entry signal from PSAR.
Stochastic Oscillator: A reading above 80 can indicate overbought conditions. Confirmation here would include the %K line crossing below the %D line.
ZLEMA (Zero-Lag Exponential Moving Average): Use this to identify the trend's direction. A downward slope or the price being below the ZLEMA could confirm a bearish bias.
Accumulation Distribution Line (ADL): This technical indicator can confirm the trend's strength. If the ADL is declining while price moves upwards, it can confirm that the upward move may not be sustainable.
Exit Trigger
Parabolic SAR (PSAR): Use the PSAR flip (when it moves below the price) as an exit signal, indicating a potential trend reversal to the upside.
Confirmation Indicators:
RSI (Relative Strength Index): Look for overbought conditions, typically above 70, to confirm an exit signal.
Stochastic Oscillator: A reading above 80, combined with a crossover (where %K crosses below %D), can signal a good opportunity to exit a trade.
VWAP (Volume Weighted Average Price): If the price crosses below the VWAP, it may indicate a shift in sentiment from bullish to bearish.
PPS (Pivots Points Standard): Look for price action around pivot levels. If the price is failing to hold above a key pivot level, it could be a reason to exit.
Price AltimeterThis indicator should help visualize the price, inspired by a Digital Altimeter in a Pilots HUD.
It's by default calibrated to Bitcoin, with the small levels showing every $100 and the larger levels setup to display on every $1000. But you can change this to whatever you want by changing the settings for: Small and Large Level Increments.
The default colors are grey, but can be changed to whatever you want, and there are two cause if you want they work as a gradient.
There are options to fade as the values go away from the current price action.
There are options for Forward and Backward Offsets, 0 is the current price and each value represents a candle on whatever time frame your currently on.
Other Options include the Fade Ratio, the Line Width and Style, which are all self explanatory.
Hope you Enjoy!
Backtest it in fast mode to see it in action a little better...
Known Issues:
For some reason it bug's out when either or are displaying more than 19 lines, unsure why so its limited to that for now.
Extra Note on what this may be useful for: I always wanted to make this, but didn't realize how to put things in front of the price action... Offset! Duh! Anyways, I thought of this one because I often it's hard on these charts to really get an idea for absolute price amounts across different time frames, this in an intuitive, at a glance way to see it because the regular price thing on the right always adds values between values when you zoom in and you can sometimes get lost figuring out the proportions of things.
Could also be useful for Scalping?
ATH & 52-Week High Tracker### **Indicator Name: ATH & 52-Week High Tracker**
📌 **Description:**
This indicator provides a **real-time table** displaying key stock statistics to help traders analyze price levels relative to historical highs. It includes:
✔️ **All-Time High (ATH)** price
✔️ **% Change from ATH**
✔️ **52-Week High** price
✔️ **% Change from 52-Week High**
By using this indicator, traders can quickly identify how far a stock has retraced from its **historical peaks**, which can be useful for momentum trading, breakout strategies, and trend analysis.
📊 **What You Get with This Indicator:**
✅ A clear **visual table** with important stock data
✅ Quick reference to **historical price levels**
✅ Helps in identifying potential **breakout or recovery zones**
✅ Useful for both **intraday and swing traders**
⚠️ **Disclaimer:**
This indicator is for **informational purposes only** and should not be considered **financial advice, a trading strategy, or a buy/sell signal.** Always conduct your own analysis and risk management before making trading decisions. 🚀📈
Let me know if you need any refinements! 😊
EMA Alignment & Spread Monitor (Sang Youn)Overview
The EMA Alignment & Spread Monitor is a dynamic trading script designed to monitor EMA (Exponential Moving Average) alignments, track spread deviations, and provide real-time alerts when significant conditions are met. This script allows traders to customize their EMA periods, analyze market trends based on EMA positioning, and receive visual and audio alerts when key spread conditions occur.
🔹 Key Features
✅ Customizable EMA Periods – Users can input their own EMA lengths to adapt the script to various market conditions. (Default: 5, 10, 20, 60, 120)
✅ EMA Alignment Detection – Identifies bullish alignment (all EMAs in ascending order) and bearish alignment (all EMAs in descending order).
✅ Spread Calculation & Monitoring – Computes the spread difference between each EMA and tracks the average spread over a user-defined period.
✅ Deviation Alerts – Notifies traders when:
Bullish Trend: The spread exceeds its average, indicating a potential strong uptrend.
Bearish Trend: The spread falls below its average, signaling a possible downtrend.
✅ Chart Annotations – Displays 📈 (green triangle) when bullish spread exceeds average and 📉 (red triangle) when bearish spread drops below average for easy visualization.
✅ Real-time Alerts – Sends alerts when spread conditions are met, helping traders react to market shifts efficiently.
✅ Spread Histogram – Visual representation of bullish and bearish spread levels for trend analysis.
🔹 How It Works
1️⃣ Set your EMA periods in the script settings (default: 5, 10, 20, 60, 120).
2️⃣ Define the spread average calculation length (default: 50 candles).
3️⃣ The script tracks EMA alignment to determine bullish or bearish trends.
4️⃣ If the spread deviates significantly from its average, the script:
Places a 📈 green triangle above candles in a bullish trend when spread > average.
Places a 📉 red triangle below candles in a bearish trend when spread < average.
Triggers an alert for timely decision-making.
5️⃣ Use the histogram & real-time alerts to stay ahead of market movements.
ICT Session by LasinsName: ICT Session by Lasins
Purpose: To visually identify and differentiate between the Asian, London, and New York trading sessions on the chart.
Features:
Highlights the background of the chart during each session.
Includes a mini dashboard in the top-right corner to show the active session.
Allows customization of time zones (exchange timezone or UTC).
Displays copyright and author information.
Key Components
Inputs:
useExchangeTimezone: A boolean input to toggle between using the exchange timezone or UTC for session times.
showDashboard: A boolean input to toggle the visibility of the mini dashboard.
Session Times:
The script defines three trading sessions:
Asian Session: 2000-0000 UTC (or adjusted for exchange timezone).
London Session: 0200-0500 UTC (or adjusted for exchange timezone).
New York Session: 0700-1000 UTC (or adjusted for exchange timezone).
Session Detection:
The is_session function checks if the current time falls within a specified session using the time function.
Background Coloring:
The bgcolor function is used to highlight the chart background during each session:
Asian Session: Red background.
London Session: Green background.
New York Session: Blue background.
Mini Dashboard:
A table is created in the top-right corner of the chart to display the active session and its corresponding color.
The dashboard includes:
A header row with "Session" and "Color".
Rows for each session (Asian, London, New York) with their respective colors.
Copyright and Author Information:
A label is added to the chart to display the copyright and author information ("© ICT Session by Lasins Raj").
How It Works
The script checks the current time and compares it to the predefined session times.
If the current time falls within a session, the chart background is highlighted with the corresponding color.
The mini dashboard updates to reflect the active session.
The copyright and author information is displayed at the bottom of the chart.
Customization
You can adjust the session times in the script to match your preferred timezone or trading hours.
The useExchangeTimezone input allows you to switch between UTC and the exchange timezone.
The showDashboard input lets you toggle the visibility of the mini dashboard.
Example Use Case
Traders who follow the ICT (Inner Circle Trader) methodology can use this indicator to identify key trading sessions and plan their trades accordingly.
The visual representation of sessions helps traders quickly recognize when major markets are open and active.
Market Snap Shot with Pine ScreenerMarket Snap Shot
The Market Snap Shot is a comprehensive technical analysis tool designed to track and display key price metrics across multiple timeframes, including daily, weekly, monthly, quarterly, and yearly data. This script provides a range of essential calculations for traders and investors, enabling them to assess price action, volatility, and market trends at a glance.
Features:
Daily Metrics: Includes the daily percentage change, closing range relative to the daily high/low.
Weekly Metrics: Tracks weekly open, close, range, and calculates week-to-date performance for a broader market view.
Monthly Metrics: Provides similar calculations for monthly price action, offering insights into monthly performance.
Quarter-to-Date (QTD): Displays performance for the current quarter, offering insights into quarterly price movements.
Year-to-Date (YTD): Calculates year-to-date price change, helping users track performance relative to the start of the year.
52-Week High/Low: Displays the current price's distance from the 52-week high and low, giving context to long-term price levels.
Usage:
Traders can use this screener to quickly assess the current market position and make informed decisions based on short-term and long-term trends.
Investors can leverage the 52-week and YTD metrics to gauge the overall strength of an asset in the market.
The tool is versatile for both active traders looking for real-time performance data and for those focusing on longer-term market trends.
Instructions:
This script displays multiple metrics such as percentage changes and range data for daily, weekly, monthly, quarterly, and yearly timeframes. It is designed to be used as a screener tool to assess price action and monitor performance across these key time periods.
Warning:
The "Market Snap Shot" does not provide buy or sell signals but rather serves as a performance tracking tool. Users are encouraged to use this data in conjunction with other technical and fundamental analysis tools.
Trend Detector [victhoreb]Trend Detector is a streamlined indicator that uses the Pearson correlation coefficient between the average price and time to determine market trends. It measures how closely price movement follows the progression of time over a user-defined period, providing a clear gauge of trend direction on a scale from -1 to 1.
How It Works:
The indicator calculates the correlation between price and time. A positive correlation means that as time advances, the price generally rises—signaling an uptrend. Conversely, a negative correlation indicates that the price tends to fall over time, highlighting a downtrend.
With its simple yet effective approach, Trend Detector offers traders an immediate visual and quantitative insight into prevailing market trends.
Ceres Trader NYSE Tick Indicator With Threshold AlertsThe Ceres Trader NYSE Tick Indicator provides real-time alerts for significant shifts in the NYSE Tick, empowering traders to identify potential overbought and oversold market conditions. It displays labels directly on the chart when the Tick reaches predefined thresholds, offering a clear and immediate visual representation of market sentiment.
Key Features:
Threshold-Based Alerts:
Highlights "High Tick" and "Low Tick" conditions when the Tick exceeds user-defined thresholds (default: 400 and -400).
Identifies "Extreme High Tick" and "Extreme Low Tick" conditions for more significant shifts (adjusted default: 800 and -800).
Visual Labels:
Displays colored labels directly on the price chart, indicating the type of Tick event and its value.
Green labels signal potential overbought conditions, while red labels indicate potential oversold conditions.
Low tick labels are placed below the price bar, and high tick labels are placed above the price bar for improved visibility.
Real-Time Data:
Utilizes the NYSE Tick symbol ("TICK") to provide up-to-the-minute market data.
User-Friendly Design:
Simple and intuitive design, suitable for traders of all experience levels.
How to Use:
Add the "Ceres Trader NYSE Tick Indicator with Threshold Alerts" to your TradingView chart.
Observe the colored labels that appear when the Tick reaches the specified thresholds.
Use these alerts to identify potential trading opportunities based on overbought or oversold market conditions.
Consider adjusting the threshold values within the indicator settings to align with your specific trading strategy.
Global Liquidity Indicator in USDThis indicator aggregates the total central bank balance sheets and M2 money supply for the USA, Canada, China, European Union, Japan, and the UK, converting all values to USD and normalizing them to trillions for easy visualization. It plots three lines: Total Balance Sheet, Total M2, and Combined Total, providing a comprehensive view of global liquidity trends.
Key Features:
Dynamic Coloring: Customize line colors based on direction—green for upward trends, red for downward (or any colors you choose), with independent on/off toggles for each line.
Real-Time Currency Conversion: Uses live forex rates (e.g., USD/CNY, USD/EUR) for accurate USD conversions.
Nirmal Fair Value GapsICT Fair Value Gaps
Trade Wisely
How a Fair Value Gap Works
Formation:
A Fair Value Gap occurs when a strong price movement (usually from institutional orders) creates an imbalance between buyers and sellers.
This is typically seen in a three-candle pattern, where the middle candle has a large body, and the two surrounding candles have wicks but little overlap with the middle candle’s range.
Identification:
The FVG is marked between the high of the first candle and the low of the third candle (for bullish gaps).
For bearish gaps, it’s the low of the first candle and the high of the third candle.
Market Behavior Around FVG:
Price often retraces into the gap before resuming its original direction.
This happens because the market seeks to "fill" the imbalance where few trades occurred.
Traders use FVGs as potential entry zones for trend continuation trades.
Trading Fair Value Gaps
In an Uptrend:
Look for bullish fair value gaps as potential support zones for buy entries.
Price may dip into the gap and then continue upward.
In a Downtrend:
Look for bearish fair value gaps as potential resistance zones for sell entries.
Price may retrace into the gap and then drop further.
Confluence Factors:
FVGs work best when combined with other strategies like order blocks, liquidity zones, or key Fibonacci levels.
Futures Open/High/Low TablesAdds (up to) 3 tables to a chart, displaying Open/High/Low data for today (RTH and extended hours), yesterday, and the current week / month -- to help with intraday analysis of a futures ticker.
The tables only appear on intraday charts (5min, 30min, etc). On a Daily/Weekly/etc chart they are not calculated or shown.
In addition to Open/High/Low, the "Current" table in the top-right shows a live measurement of # of points from the open, the RTH open, and the highs/lows.
Lastly, the 9:30am ET open and the 4pm RTH close are by default marked with a shaded background (on intraday charts) for easy visual reference, and also to help with adjusting the session time to accommodate time zone issues if they occur.
Tested on ES in Eastern Time Zone, but should work on any futures instrument and any time zone by adjusting the Session Time setting.
Celestial Pair Spread Hello friends, after a very long time!
Today, I tried to put into code an idea that came to my mind spontaneously and suddenly.
Note :
This script is experimental and improvable.
I haven't had a chance to try it yet.
TIMEFRAME : 1D (Daily Bars)
CELESTIAL SPREAD
The spread moves in a very limited area and is consistent within itself, especially on days far from the end of the contract.
That's why there is a reassuring sky atmosphere. That's why this name was given completely improvised.
Basic logic of the script
We enter the name of the CME Futures contract we want to enter:
Ex : CL1! , ES1! , ZC1! , NQ1!
The script creates us a pair trade parity divided into secondary contracts.
Example : ES1!/ES2!
What is pair trading?
I will explain briefly here.
For users who are wondering:
www.investopedia.com
Let's get back to our topic.
Now we have created a parity that does not actually exist.
This parity is the manifestation of the relative movements of two contracts.
When the parity rises, ES1! increased,ES2! has fallen.
In the opposite case, We can say: ES1! Contract has been dropped ES2! has increased.
Pair trading is generally a trade that needs to be kept in mind from time to time.
It is a method preferred by professionals who can process very quickly.
Market risk is minimal, but since 2 contracts are purchased, more money is paid and very low percentage profits are made.
It is very expensive to do pair trading, especially with oil and its derivatives and interest security derivatives.
The contract we are considering has micros. (small-item contracts tied to the same value)
So when we switch to our broker MES1!/MES2! We will trade.
For all CME futures :
www.cmegroup.com
Anyway, let's continue:
The script created the parity showing its relationship with the next contract and plotted it as bars.
Celestial bands are just like Bollinger bands, but they consist of 3 bands based on percentage changes rather than standard deviation.
The middle band is obtained from moving averages.
The upper and lower bands are the middle band subjected to a threshold value.
The threshold value can be changed.
0.15 percent was charged for this script.
CAUTION :
As can be seen in the example below;
The most important thing is not to make any transactions when the contract switch dates are approaching.
Therefore, it is recommended to use it just below the main chart.
The blue bars in the parity are
Values that outside the upper and lower threshold values are colored blue.
For this condition
Alerts has been added.
Don't forget to add alert and edit.
MAIN PURPOSE
It is aimed to start a pair trade when such conditions come and to quickly close the trades when the parity basis reaches the value.
OTHER IMPORTANT POINTS
Other issues are broker related issues.
Difference between initial margins and maintanence margins of contracts (between 1! and 2!)
It shouldn't be too high.
The commission should not be too high.
Leverage must be high because the profit percentage is very low.
To calculate leverage you must divide your contract size by the relevant margin requirement.
Sample margin requirement table:
www.interactivebrokers.com
RISKS
It is an experimental and intellectual script,
the risk of contract price differences (maybe it will not leave a profit except for very extreme values)
I remind you of the quickness risk that comes from a two-legged trade.
Alerts definitely synchronized with an audible alert sent to a smartphone as an e-mail notification and displayed on the locked screen for quick action.
Best regards!
DCSessionStatsOHLC_v1.0DCSessionStatsOHLC_v1.0
© dc_77 | Pine Script™ v6 | Licensed under Mozilla Public License 2.0
This indicator overlays customizable session-based OHLC (Open, High, Low, Close) statistics on your TradingView chart. It tracks price action within user-defined sessions, calculates average manipulation and distribution levels based on historical data, and visually projects these levels with lines and labels. Additionally, it provides a session count table to monitor bullish and bearish sessions.
Key Features:
Session Customization: Define session time (e.g., "0000-1600") and time zone (e.g., UTC, America/New_York). Analyze up to 20 historical sessions.
Anchor Line: Displays a vertical line at session start with customizable style, color, and optional label.
Session Open Line: Plots a horizontal line at the session’s opening price with adjustable appearance and label.
Manipulation Levels: Calculates and projects average price extensions (high/low relative to open) for manipulative moves, shown as horizontal lines with labels.
Distribution Levels: Displays average price ranges (high/low beyond open) for distribution phases, with customizable lines and labels.
Visual Flexibility: Adjust line styles (solid, dashed, dotted), colors, widths, label sizes, and projection offsets (bars beyond session start).
Session Stats Table: Optional table showing counts of bullish (close > open) and bearish (close < open) sessions, with configurable position and size.
How It Works:
Tracks OHLC data within each session and identifies session start/end based on the specified time range.
Computes averages for manipulation (e.g., low below open in bullish sessions) and distribution (e.g., high above open) levels from past sessions.
Projects these levels forward as horizontal lines, extending them by a user-defined offset for easy reference.
Updates a table with real-time bullish/bearish session counts.
Use Case:
Ideal for traders analyzing intraday or custom session behavior, identifying key price levels, and gauging market sentiment over time.
Toggle individual elements on/off and fine-tune visuals to suit your trading style.
SuperTrend + Relative Volume (Kernel Optimized)Introducing our new KDE Optimized Supertrend + Relative Volume Indicator!
This innovative indicator combines the power of the Supertrend indicator along with Relative Volume. It utilizes the Kernel Density Estimation (KDE) to estimate the probability of a candlestick marking a significant trend break or reversal.
❓How to Interpret the KDE %:
The KDE % is a crucial metric that reflects the likelihood that the current candlestick represents a true break in the SuperTrend line, supported by an increase in relative volume. It estimates the probability of a trend shift or continuation based on historical SuperTrend breaks and volume patterns:
Low KDE %: A lower probability that the current break is significant. Price action is less likely to reverse, and the trend may continue.
Moderate KDE - High KDE %: An increased possibility that a trend reversal or consolidation could occur. Traders should start watching for confirmation signals.
📌How Does It Work?
The SuperTrend indicator uses the Average True Range (ATR) to determine the direction of the trend and identifies when the price crosses the SuperTrend line, signaling a potential trend reversal. Here's how the KDE Optimized SuperTrend Indicator works:
SuperTrend Calculation: The SuperTrend indicator is calculated, and when the price breaks above (bullish) or below (bearish) the SuperTrend line, it is logged as a significant event.
Relative Volume: For each break in the SuperTrend line, we calculate the relative volume (current volume vs. the average volume over a defined period). High relative volume can suggest stronger confirmation of the trend break.
KDE Array Calculation: KDE is applied to the break points and relative volume data:
Define the KDE options: Bandwidth, Number of Steps, and Array Range (Array Max - Array Min).
Create a density range array using the defined number of steps, corresponding to potential break points.
Apply a Gaussian kernel function to the break points and volume data to estimate the likelihood of the trend break being significant.
KDE Value and Signal Generation: The KDE array is updated as each break occurs. The KDE % is calculated for the breakout candlestick, representing the likelihood of the trend break being significant. If the KDE value exceeds the defined activation threshold, a darker bullish or bearish arrow is plotted after bar confirmation. If the KDE value falls below the threshold, a more transparent arrow is drawn, indicating a possible but lower probability break.
⚙️Settings:
SuperTrend Settings:
ATR Length: The period over which the Average True Range (ATR) is calculated.
Multiplier: The multiplier applied to the ATR to determine the SuperTrend threshold.
KDE Settings:
Bandwidth: Determines the smoothness of the KDE function and the width of the influence of each break point.
Number of Bins (Steps): Defines the precision of the KDE algorithm, with higher values offering more detailed calculations.
KDE Threshold %: The level at which relative volume is considered significant for confirming a break.
Relative Volume Length: The number of historic candles used in calculating KDE %
DynamicMALibrary "DynamicMA"
Dynamic Moving Averages Library
Introduction
The Dynamic Moving Averages Library is a specialized collection of custom built functions designed to calculate moving averages dynamically, beginning from the first available bar. Unlike standard moving averages, which rely on fixed length lookbacks, this library ensures that indicators remain fully functional from the very first data point, making it an essential tool for analysing assets with short time series or limited historical data.
This approach allows traders and developers to build robust indicators that do not require a preset amount of historical data before generating meaningful outputs. It is particularly advantageous for:
Newly listed assets with minimal price history.
High-timeframe trading, where large lookback periods can lead to delayed or missing data.
By eliminating the constraints of fixed lookback periods, this library enables the seamless construction of trend indicators, smoothing functions, and hybrid models that adapt instantly to market conditions.
Comprehensive Set of Custom Moving Averages
The library includes a wide range of custom dynamic moving averages, each designed for specific analytical use cases:
SMA (Simple Moving Average) – The fundamental moving average, dynamically computed.
EMA (Exponential Moving Average) – Adaptive smoothing for better trend tracking.
DEMA (Double Exponential Moving Average) – Faster trend detection with reduced lag.
TEMA (Triple Exponential Moving Average) – Even more responsive than DEMA.
WMA (Weighted Moving Average) – Emphasizes recent price action while reducing noise.
VWMA (Volume Weighted Moving Average) – Accounts for volume to give more weight to high-volume periods.
HMA (Hull Moving Average) – A superior smoothing method with low lag.
SMMA (Smoothed Moving Average) – A hybrid approach between SMA and EMA.
LSMA (Least Squares Moving Average) – Uses linear regression for trend detection.
RMA (Relative Moving Average) – Used in RSI-based calculations for smooth momentum readings.
ALMA (Arnaud Legoux Moving Average) – A Gaussian-weighted MA for superior signal clarity.
Hyperbolic MA (HyperMA) – A mathematically optimized averaging method with dynamic weighting.
Each function dynamically adjusts its calculation length to match the available bar count, ensuring instant functionality on all assets.
Fully Optimized for Pine Script v6
This library is built on Pine Script v6, ensuring compatibility with modern TradingView indicators and scripts. It includes exportable functions for seamless integration into custom indicators, making it easy to develop trend-following models, volatility filters, and adaptive risk-management systems.
Why Use Dynamic Moving Averages?
Traditional moving averages suffer from a common limitation: they require a fixed historical window to generate meaningful values. This poses several problems:
New Assets Have No Historical Data - If an asset has only been trading for a short period, traditional moving averages may not be able to generate valid signals.
High Timeframes Require Massive Lookbacks - On 1W or 1M charts, a 200-period SMA would require 200 weeks or months of data, making it unusable on newer assets.
Delayed Signal Initialization - Standard indicators often take dozens of bars to stabilize, reducing effectiveness when trading new trends.
The Dynamic Moving Averages Library eliminates these issues by ensuring that every function:
Starts calculation from bar one, using available data instead of waiting for a lookback period.
Adapts dynamically across timeframes, making it equally effective on low or high timeframes.
Allows smoother, more responsive trend tracking, particularly useful for volatile or low-liquidity assets.
This flexibility makes it indispensable for custom script developers, quantitative analysts, and discretionary traders looking to build more adaptive and resilient indicators.
Final Summary
The Dynamic Moving Averages Library is a versatile and powerful set of functions designed to overcome the limitations of fixed-lookback indicators. By dynamically adjusting the calculation length from the first bar, this library ensures that moving averages remain fully functional across all timeframes and asset types, making it an essential tool for traders and developers alike.
With built-in adaptability, low-lag smoothing, and support for multiple moving average types, this library unlocks new possibilities for quantitative trading and strategy development - especially for assets with short price histories or those traded on higher timeframes.
For traders looking to enhance signal reliability, minimize lag, and build adaptable trading systems, the Dynamic Moving Averages Library provides an efficient and flexible solution.
SMA(sourceData, maxLength)
Dynamic SMA
Parameters:
sourceData (float)
maxLength (int)
EMA(src, length)
Dynamic EMA
Parameters:
src (float)
length (int)
DEMA(src, length)
Dynamic DEMA
Parameters:
src (float)
length (int)
TEMA(src, length)
Dynamic TEMA
Parameters:
src (float)
length (int)
WMA(src, length)
Dynamic WMA
Parameters:
src (float)
length (int)
HMA(src, length)
Dynamic HMA
Parameters:
src (float)
length (int)
VWMA(src, volsrc, length)
Dynamic VWMA
Parameters:
src (float)
volsrc (float)
length (int)
SMMA(src, length)
Dynamic SMMA
Parameters:
src (float)
length (int)
LSMA(src, length, offset)
Dynamic LSMA
Parameters:
src (float)
length (int)
offset (int)
RMA(src, length)
Dynamic RMA
Parameters:
src (float)
length (int)
ALMA(src, length, offset_sigma, sigma)
Dynamic ALMA
Parameters:
src (float)
length (int)
offset_sigma (float)
sigma (float)
HyperMA(src, length)
Dynamic HyperbolicMA
Parameters:
src (float)
length (int)
DCStatCalcs_v0.1DCStatCalcs_v0.1 - Session-Based Statistical Projections
This Pine Script indicator overlays customizable horizontal lines on your chart to visualize a session's opening price and its statistical projections based on historical standard deviation (SD). Designed for traders who want to analyze price behavior within defined time sessions, it calculates and plots the session open price along with optional projection lines at 0.5, 1.0, 1.5, 2.0, and 2.5 standard deviations above and below the open, derived from past session data.
Key Features:
Customizable Sessions: Define your session time (e.g., 0600-1500) and timezone (e.g., America/New_York).
Historical Analysis: Uses a user-specified number of past sessions (default: 20) to compute the standard deviation of price movements relative to the session open.
Projection Lines: Displays toggleable lines at multiple SD levels with adjustable styles, colors, and widths for easy visualization.
Flexible Display: Extend lines beyond the current bar with an offset setting, and adjust label sizes for clarity.
Real-Time Updates: Lines dynamically extend as the session progresses, keeping projections relevant to the current bar.
How It Works:
At the start of each user-defined session, the indicator records the opening price and calculates the SD based on price deviations from the open across historical sessions. It then plots the open price line and, if enabled, projection lines at the specified SD intervals. These lines help traders identify potential support, resistance, or volatility zones based on statistical norms.
Use Case:
Ideal for day traders or analysts working with intraday charts to gauge price ranges and volatility within specific trading sessions, such as market opens or key economic hours.
Published under the Mozilla Public License 2.0. Created by dc_77.