VIX Composite MeterThe VIX Composite Meter is a custom trading indicator designed to help identify potential buy and sell signals based on market volatility, specifically through VIX options. The VIX, also known as the "fear gauge," measures market expectations of future volatility. This meter combines several factors — the VIX-to-SPX ratio, moving average deviation, Z-score, and momentum oscillators — to create a single, easy-to-read score that guides trading decisions.
How It Works
Composite Score: The meter calculates a composite score that ranges from 0 to 1 by weighing four metrics:
VIX/SPX Ratio: Indicates relative volatility compared to the S&P 500.
Moving Average Deviation: Shows how far the VIX is from its typical range.
Z-Score: Measures how extreme the current VIX value is relative to its historical average.
Momentum Oscillator (RSI): Helps identify overbought or oversold conditions in the VIX.
Color-Coded Signals:
Green Background: If the score drops below 0.3, the meter suggests buying VIX calls, indicating a low-volatility environment with potential for increase.
Red Background: If the score rises above 0.7, the meter suggests buying VIX puts, indicating a high-volatility environment likely to decrease.
Use Cases
Buy VIX Calls: When the meter turns green, signaling potential future volatility spikes.
Buy VIX Puts: When the meter turns red, suggesting current high volatility is expected to revert lower.
By using the VIX Composite Meter, traders can better time their entries and exits in VIX options, aligning with market conditions for potential profits in periods of changing volatility.
Statistics
Stationarity Test: Dickey-Fuller & KPSS [Pinescriptlabs]
📊 Kwiatkowski-Phillips-Schmidt-Shin Model Indicator & Dickey-Fuller Test 📈
This algorithm performs two statistical tests on the price spread between two selected instruments: the first from the current chart and the second determined in the settings. The purpose is to determine if their relationship is stationary. It then uses this information to generate **visual signals** based on how far the current relationship deviates from its historical average.
⚙️ Key Components:
• 🧪 ADF Test (Augmented Dickey-Fuller):** Checks if the spread between the two instruments is stationary.
• 🔬 KPSS Test (Kwiatkowski-Phillips-Schmidt-Shin):** Another test for stationarity, complementing the ADF test.
• 📏 Z-Score Calculation:** Measures how many standard deviations the current spread is from its historical mean.
• 📊 Dynamic Threshold:** Adjusts the trading signal threshold based on recent market volatility.
🔍 What the Values Mean:
The indicator displays several key values in a table:
• 📈 ADF Stationarity:** Shows "Stationary" or "Non-Stationary" based on the ADF test result.
• 📉 KPSS Stationarity:** Shows "Stationary" or "Non-Stationary" based on the KPSS test result.
• 📏 Current Z-Score:** The current Z-score of the spread.
• 🔗 Hedge Ratio:** The relationship coefficient between the two instruments.
• 🌐 Market State:** Describes the current market condition based on the Z-score.
📊 How to Interpret the Chart:
• The main chart displays the Z-score of the spread over time.
• The green and red lines represent the upper and lower thresholds for trading signals.
• The area between the **Z-score** and the thresholds is filled when a trading signal is active.
• Additional charts show the **statistics of the ADF and KPSS tests** and their critical values.
**📉 Practical Example: NVIDIA Corporation (NVDA)**
Looking at the chart for **NVIDIA Corporation (NVDA)**, we can see how the indicator applies in a real case:
1. **Main Chart (Top):**
• Shows the **historical price** of NVIDIA on a weekly scale.
• A general **uptrend** is observed with periods of consolidation.
2. **KPSS & ADF Indicator (Bottom):**
• The lower chart shows the KPSS & ADF Model indicator applied to NVIDIA.
• The **green line** represents the Z-score of the spread.
• The **green shaded areas** indicate periods where the Z-score exceeded the thresholds, generating trading signals.
3. **📋 Current Values in the Table:**
• **ADF Stationarity:** Non-Stationary
• **KPSS Stationarity:** Non-Stationary
• **Current Z-Score:** 3.45
• **Hedge Ratio:** -164.8557
• **Market State:** Moderate Volatility
4. **🔍 Interpretation:**
• A Z-score of **3.45** suggests that NVIDIA’s price is significantly above its historical average relative to **EURUSD**.
• Both the **ADF** and **KPSS** tests indicate **non-stationarity**, suggesting **caution** when using mean reversion signals at this moment.
• The market state "Moderate Volatility" indicates noticeable deviation, but not extreme.
---
**💡 Usage:**
• **When Both Tests Show Stationarity:**
• **🔼 If Z-score > Upper Threshold:** Consider **buying the first instrument** and **selling the second**.
• **🔽 If Z-score < Lower Threshold:** Consider **selling the first instrument** and **buying the second**.
• **When Either Test Shows Non-Stationarity:**
• Wait for the relationship to become **stationary** before trading.
• **Market State:**
• Use this information to evaluate **general market conditions** and adjust your trading strategy accordingly.
**Mirror Comparison of the Same as Symbol 2 🔄📊**
**📊 Table Values:**
• **Extreme Volatility Threshold:** This value is displayed when the **Z-score** exceeds **100%**, indicating **extreme deviation**. It signals a potential **trading opportunity**, as the spread has reached unusually high or low levels, suggesting a **reversion or correction** in the market.
• **Mean Reversion Threshold:** Appears when the **Z-score** begins returning towards the mean after a period of **high or extreme volatility**. It indicates that the spread between the assets is returning to normal levels, suggesting a phase of **stabilization**.
• **Neutral Zone:** Displayed when the **Z-score** is near **zero**, signaling that the spread between assets is within expected limits. This indicates a **balanced market** with no significant volatility or clear trading opportunities.
• **Low Volatility Threshold:** Appears when the **Z-score** is below **70%** of the dynamic threshold, reflecting a period of **low volatility** and market stability, indicating fewer trading opportunities.
Español:
📊 Indicador del Modelo Kwiatkowski-Phillips-Schmidt-Shin & Prueba de Dickey-Fuller 📈
Este algoritmo realiza dos pruebas estadísticas sobre la diferencia de precios (spread) entre dos instrumentos seleccionados: el primero en el gráfico actual y el segundo determinado en la configuración. El objetivo es determinar si su relación es estacionaria. Luego utiliza esta información para generar señales visuales basadas en cuánto se desvía la relación actual de su promedio histórico.
⚙️ Componentes Clave:
• 🧪 Prueba ADF (Dickey-Fuller Aumentada): Verifica si el spread entre los dos instrumentos es estacionario.
• 🔬 Prueba KPSS (Kwiatkowski-Phillips-Schmidt-Shin): Otra prueba para la estacionariedad, complementando la prueba ADF.
• 📏 Cálculo del Z-Score: Mide cuántas desviaciones estándar se encuentra el spread actual de su media histórica.
• 📊 Umbral Dinámico: Ajusta el umbral de la señal de trading en función de la volatilidad reciente del mercado.
🔍 Qué Significan los Valores:
El indicador muestra varios valores clave en una tabla:
• 📈 Estacionariedad ADF: Muestra "Estacionario" o "No Estacionario" basado en el resultado de la prueba ADF.
• 📉 Estacionariedad KPSS: Muestra "Estacionario" o "No Estacionario" basado en el resultado de la prueba KPSS.
• 📏 Z-Score Actual: El Z-score actual del spread.
• 🔗 Ratio de Cobertura: El coeficiente de relación entre los dos instrumentos.
• 🌐 Estado del Mercado: Describe la condición actual del mercado basado en el Z-score.
📊 Cómo Interpretar el Gráfico:
• El gráfico principal muestra el Z-score del spread a lo largo del tiempo.
• Las líneas verdes y rojas representan los umbrales superior e inferior para las señales de trading.
• El área entre el Z-score y los umbrales se llena cuando una señal de trading está activa.
• Los gráficos adicionales muestran las estadísticas de las pruebas ADF y KPSS y sus valores críticos.
📉 Ejemplo Práctico: NVIDIA Corporation (NVDA)
Observando el gráfico para NVIDIA Corporation (NVDA), podemos ver cómo se aplica el indicador en un caso real:
Gráfico Principal (Superior): • Muestra el precio histórico de NVIDIA en escala semanal. • Se observa una tendencia alcista general con períodos de consolidación.
Indicador KPSS & ADF (Inferior): • El gráfico inferior muestra el indicador Modelo KPSS & ADF aplicado a NVIDIA. • La línea verde representa el Z-score del spread. • Las áreas sombreadas en verde indican períodos donde el Z-score superó los umbrales, generando señales de trading.
📋 Valores Actuales en la Tabla: • Estacionariedad ADF: No Estacionario • Estacionariedad KPSS: No Estacionario • Z-Score Actual: 3.45 • Ratio de Cobertura: -164.8557 • Estado del Mercado: Volatilidad Moderada
🔍 Interpretación: • Un Z-score de 3.45 sugiere que el precio de NVIDIA está significativamente por encima de su promedio histórico en relación con EURUSD. • Tanto la prueba ADF como la KPSS indican no estacionariedad, lo que sugiere precaución al usar señales de reversión a la media en este momento. • El estado del mercado "Volatilidad Moderada" indica una desviación notable, pero no extrema.
💡 Uso:
• Cuando Ambas Pruebas Muestran Estacionariedad:
• 🔼 Si Z-score > Umbral Superior: Considera comprar el primer instrumento y vender el segundo.
• 🔽 Si Z-score < Umbral Inferior: Considera vender el primer instrumento y comprar el segundo.
• Cuando Alguna Prueba Muestra No Estacionariedad:
• Espera a que la relación se vuelva estacionaria antes de operar.
• Estado del Mercado:
• Usa esta información para evaluar las condiciones generales del mercado y ajustar tu estrategia de trading en consecuencia.
Comparativo en Espejo del Mismo Como Símbolo 2 🔄📊
📊 Valores de la Tabla:
• Umbral de Volatilidad Extrema: Este valor se muestra cuando el Z-score supera el 100%, indicando desviación extrema. Señala una posible oportunidad de trading, ya que el spread entre los activos ha alcanzado niveles inusualmente altos o bajos, lo que podría indicar una reversión o corrección en el mercado.
• Umbral de Reversión a la Media: Aparece cuando el Z-score comienza a volver hacia la media tras un período de alta o extrema volatilidad. Indica que el spread entre los activos está regresando a niveles normales, sugiriendo una fase de estabilización.
• Zona Neutral: Se muestra cuando el Z-score está cerca de cero, señalando que el spread entre activos está dentro de lo esperado. Esto indica un mercado equilibrado con ninguna volatilidad significativa ni oportunidades claras de trading.
• Umbral de Baja Volatilidad: Aparece cuando el Z-score está por debajo del 70% del umbral dinámico, reflejando un período de baja volatilidad y estabilidad del mercado, indicando menos oportunidades de trading.
Correlation with AveragesThe "Correlation with Averages" indicator is designed to visualize and analyze the correlation between a selected asset's price and a base symbol's price, such as the S&P 500 (SPY). This indicator allows users to evaluate how closely an asset’s price movements align with those of the base symbol over various time periods, providing insights into market trends and potential portfolio adjustments.
Key Features:
Base Symbol and Correlation Period:
Users can specify the base symbol (default is SPY) and the period for correlation measurement (default is 252 trading days, approximating one year).
Correlation Calculation:
The indicator computes the correlation between the asset’s closing price and the base symbol’s closing price for the defined period.
Visualization:
The correlation value is plotted on the chart, with conditional background colors indicating the strength and direction of the correlation:
Red for negative correlation (below -0.5)
Green for positive correlation (above 0.5)
Yellow for neutral correlation (between -0.5 and 0.5)
Average Correlation Over Time:
Average correlations are calculated and displayed for various periods: one week, one month, one year, and five years.
A table on the chart provides dynamic updates of these average values with color-coded backgrounds to indicate correlation strength.
The Role of Correlation in Portfolio Management
Correlation is a crucial concept in portfolio management because it measures the degree to which two securities move in relation to each other. Understanding correlation helps investors construct diversified portfolios that balance risk and return. Here's why correlation is important:
Diversification:
By including assets with low or negative correlation in a portfolio, investors can reduce overall portfolio volatility and risk. For instance, if one asset is negatively correlated with another, when one performs poorly, the other may perform well, thus smoothing the overall returns.
Risk Management:
Correlation analysis helps in identifying the potential impact of one asset’s performance on the entire portfolio. Assets with high correlation can lead to concentrated risk, while those with low correlation offer better risk management.
Performance Analysis:
Correlation measures the degree to which asset returns move together. This can inform strategic decisions, such as whether to adjust positions based on expected market conditions.
Scientific References
Markowitz, H. M. (1952). "Portfolio Selection." Journal of Finance, 7(1), 77-91.
This foundational paper introduced Modern Portfolio Theory, highlighting the importance of diversification and correlation in reducing portfolio risk.
Jorion, P. (2007). Financial Risk Manager Handbook. Wiley.
This handbook provides an in-depth exploration of risk management techniques, including the use of correlation in portfolio management.
Elton, E. J., Gruber, M. J., Brown, S. J., & Goetzmann, W. N. (2014). Modern Portfolio Theory and Investment Analysis. Wiley.
This book elaborates on the concepts of correlation and diversification, offering practical insights into portfolio construction and risk management.
By utilizing the "Correlation with Averages" indicator, traders and portfolio managers can make informed decisions based on the relationship between asset prices and the base symbol, ultimately enhancing their investment strategies.
FXN1 COT Net Positions + OscillatorThe FXN1 COT Net Positions Oscillator is a versatile tool designed for traders to analyze Commitment of Traders (COT) data with both raw net positions and oscillator-style visualization. This script allows users to visualize the net positions of Commercials, Large Speculators, and Retailers Small Speculators to identify potential market turning points or trends based on the positioning of different market participants.
Key Features:
1. Customizable Time Frame:
The script allows users to select the number of months (6 months, 12 months, 18 months, or 24 months) for calculating the COT net positions. This flexibility helps in analyzing longer or shorter-term trends in the market.
2. Oscillator and Raw Net Positions View:
- Users can choose to view the net positions as a normalized oscillator (scaled between 0 and 100) or as raw net positions. The oscillator view helps to identify overbought and oversold conditions, while the raw view provides direct insights into the net positioning of each group.
- The oscillator is created using a stochastic-like normalization, where the net position is plotted relative to its high/low over the selected time period.
3. Toggle Between Oscillator and Raw Data:
- A simple input toggle allows users to switch between the oscillator and raw net positions view with ease.
- In oscillator mode, overbought and oversold levels are displayed to help identify potential reversal points in the market.
4. Clear Visualization:
- Commercials Net: Shown in blue, representing the positions of commercial traders (hedgers).
- Large Speculators Net: Shown in red, indicating the positions of large institutional traders (fund managers).
- Retailers Small Speculators Net: Shown in yellow, representing the positions of small retail traders.
- Overbought and oversold levels in oscillator mode are customizable, allowing for more flexible trading signals.
5. Overbought and Oversold Levels:
- In oscillator mode, the script includes customizable overbought and oversold levels, making it easier to spot extreme conditions that may signal a market reversal.
- These levels are hidden when the raw net position view is active, offering a clean and clear visualization.
6. Works Across Multiple Markets:
The script is designed to work with a wide variety of futures markets, adapting to different symbols with automatic COT data adjustments based on the root symbol.
How It Works:
COT Data Sources: The script pulls commercial, large speculator, and small speculator data from the Legacy COT report.
Net Positions: It calculates the net long positions by subtracting the short positions from the long positions for each group.
Oscillator Mode: The net positions are normalized to oscillate between 0 and 100, where 100 represents the most extreme net long position and 0 represents the most extreme net short position over the selected time period.
Raw Mode: The net positions are plotted directly, providing the actual number of net positions held by each group without normalization.
Use Cases:
Trend Identification: Analyze the positioning of commercial traders (hedgers) vs. large speculators (fund managers) and retail traders to identify potential trend reversals or continuations.
Reversal Signals: In oscillator mode, overbought and oversold conditions can provide potential signals for market reversals.
Sentiment Analysis: Gauge market sentiment by comparing the positions of different market participants and using the insights to build contrarian strategies or confirm trend-following strategies.
Parameters:
Number of Months: Choose between 6, 12, 18, and 24 months for the calculation period.
Overbought Level: Customizable level to define when the market may be considered overbought in oscillator mode (default: 80).
Oversold Level: Customizable level to define when the market may be considered oversold in oscillator mode (default: 20).
Show Net Positions as Oscillator: Toggle to switch between raw net positions and oscillator view.
This script is a powerful tool for traders who want to incorporate COT data into their analysis in a more flexible and customizable way. Whether you're a swing trader looking for reversal points or a trend follower analyzing market sentiment, the FXN1 COT Net Positions Oscillator provides deep insights into the behavior of different market participants.
Bull/Bear Ratio By Month Table [MsF]Japanese below / 日本語説明は英文の後にあります。
-------------------------
This is an indicator that shows monthly bull-bear ratio in a table.
By specifying the start year and end year, the ratio will be calculated and showed based on the number of bullish and bearish lines in the monthly bar. It allows you to analyze the trend of each symbol and month (bullish / bearish). Up to 10 symbols can be specified.
You can take monthly bull-bear ratio for the past 10 or 20 years on the web, but with this indicator, you can narrow it down to the period in which you want to see the symbols you want to see. It is very convenient because you can take statistics at will.
Furthermore, if the specified ratio is exceeded, the font color can be changed to any color, making it very easy to read.
=== Parameter description ===
- From … Year of start of aggregation
- To … Year of end of aggregation
- Row Background Color … Row title background color
- Col Background Color … Column title background color
- Base Text Color … Text color
- Background Color … Background Color
- Border Color … Border Color
- Location … Location
- Text Size … Text Size
- Highlight Threshold … Ratio threshold, and color
- Display in counter? … Check if you want to show the number of times instead of the ratio
-------------------------
月別陰陽確率をテーブル表示するインジケータです。
開始年から終了年を指定することで、月足における陽線数および陰線数を元に確率を計算して表示します。
この機能により各シンボルおよび各月の特徴(買われやすい/売られやすい)を認識することができアノマリー分析が可能です。
シンボルは10個まで指定可能です。
過去10年、20年の月別陰陽確率は、Web上でよく見かけますが、このインジケータでは見たいシンボルを見たい期間に絞って、
自由自在に統計を取ることができるため大変便利です。
なお、指定した確率を上回った場合、文字色を任意の色に変更することができるため、大変見やすくなっています。
=== パラメータの説明 ===
- From … 集計開始年
- To … 集計終了年
- Row Background Color … 行タイトルの背景色
- Col Background Color … 列タイトルの背景色
- Base Text Color … テキストカラー
- Background Color … 背景色
- Border Color … 区切り線の色
- Location … 配置
- Text Size … テキストサイズ
- Highlight Threshold … 色変更する確率の閾値、および色
- Display in counter? … 確率ではなく回数表示する場合はチェックする
Smoothed Wma Z-score | viResearchSmoothed Wma Z-score | viResearch
Conceptual Foundation and Innovation
The "Smoothed Wma Z-score" indicator from viResearch integrates the Weighted Moving Average (WMA) with Z-score analysis, providing traders with a precise tool for identifying market extremes and potential reversions. The WMA gives more weight to recent data, making it highly responsive to short-term price fluctuations, while the Z-score standardizes this price action relative to its historical mean and volatility. By smoothing the WMA and applying Z-score analysis, this indicator helps traders detect when the market is either overbought or oversold, offering actionable signals for mean reversion or trend continuation strategies.
The combination of WMA smoothing and Z-score analysis allows traders to better evaluate the strength of market trends while pinpointing moments when price may be stretched beyond its typical range.
Technical Composition and Calculation
The "Smoothed Wma Z-score" script consists of two primary components: the Weighted Moving Average (WMA) and the Z-score. The WMA is calculated using a user-defined period, applying more weight to recent price data to provide a smoothed representation of the price trend. The Z-score is then derived by measuring how far the current WMA deviates from its historical mean, normalized by its standard deviation over a specified lookback period. This calculation gives a standardized measure of price extremes, allowing traders to determine whether the current price is statistically far from its norm.
The script compares the Z-score with customizable threshold levels to generate buy and sell signals. A Z-score exceeding the upper threshold suggests potential overbought conditions, while a Z-score below the lower threshold may indicate oversold conditions. Additionally, the script highlights areas where price is in the "mean reversion zone," helping traders anticipate when price might revert back to its average.
Features and User Inputs
The "Smoothed Wma Z-score" script offers several customizable inputs, enabling traders to tailor the indicator to their specific trading strategies. The WMA Length determines the sensitivity of the WMA to price changes, while the Lookback Period controls the range over which the mean and standard deviation of the WMA are calculated for the Z-score. Traders can also adjust the thresholds to define the sensitivity of overbought and oversold conditions. Furthermore, the script includes alert conditions that notify traders when trend shifts occur, allowing for timely responses to market movements.
Practical Applications
The "Smoothed Wma Z-score" indicator is designed for traders who focus on identifying price extremes and potential mean reversion opportunities. By combining WMA smoothing with Z-score analysis, this tool can be particularly effective for detecting points of overextension in the market, where a reversion to the mean is likely. The indicator is valuable for traders who seek to capitalize on:
Detecting Overbought and Oversold Conditions: The Z-score measures how far the price has deviated from its norm, allowing traders to identify overbought or oversold conditions with precision. Timing Market Reversals: The indicator provides early signals of potential market reversals by highlighting when the price has moved too far away from its average, helping traders anticipate reversion opportunities. Improving Trend Continuation Strategies: The WMA’s responsiveness to recent price changes, combined with the Z-score’s ability to measure deviations, offers traders a clearer understanding of whether a trend is likely to continue or if it’s overextended.
Advantages and Strategic Value
The "Smoothed Wma Z-score" script provides significant value by integrating WMA smoothing with Z-score analysis, delivering a powerful combination for traders seeking to identify extreme price movements. The ability to smooth price data while detecting statistically significant deviations ensures that traders are better equipped to spot reversals or continuation signals. This dual approach helps reduce noise in price data while offering a robust method for timing entries and exits, making the "Smoothed Wma Z-score" a versatile tool for both mean reversion and trend-following strategies.
Alerts and Visual Cues
The script includes alert conditions that notify traders when key thresholds are crossed. The "Smoothed Wma Z-score Long" alert is triggered when the Z-score moves above the upper threshold, signaling potential overbought conditions. The "Smoothed Wma Z-score Short" alert is activated when the Z-score drops below the lower threshold, indicating possible oversold conditions. Visual cues, such as color changes in the Z-score plot and highlighted mean reversion zones, help traders quickly identify critical market conditions and make timely decisions.
Summary and Usage Tips
The "Smoothed Wma Z-score | viResearch" indicator provides traders with a powerful tool for analyzing price extremes and identifying mean reversion opportunities. By incorporating this script into your trading strategy, you can improve your ability to spot overbought and oversold conditions, timing market reversals with greater accuracy. The "Smoothed Wma Z-score" is a reliable and customizable solution for traders focused on both mean reversion and trend-following strategies in volatile market environments.
Note: Backtests are based on past results and are not indicative of future performance.
Solar System in 3D [Astro Tool w/ Zodiac]Hello Traders and Developers,
I am excited to announce my latest Open Source indicator. At the core, this is a demonstration of PineScript’s capabilities in Rendering 3D Animations, while at the same time being a practical tool for Financial Astrologists.
This 3D Engine dynamically renders all the major celestial bodies with their individual orbits, rotation speeds, polar inclinations and astrological aspects, all while maintaining accurate spatial relationships and perspective.
This is a Geocentric model of the solar system (viewed from the perspective of Earth), since that is what most Astrologists use. Thanks to the AstroLib Library created by @BarefootJoey, this model uses the real coordinates of cosmic bodies for every timestamp.
This script truly comes to life when using the “Bar Replay” mode in TradingView, as you can observe the relationships between planets and price action as time progresses, with the full animation capabilities as mentioned above.
In addition to what I have described, this indicator also displays the orbital trajectories for each cosmic body, and has labels for everything. I have also added the ability to hover on all the labels, and see a short description of what they imply in Astrology.
Optional Planetary Aspect Computation
This indicator supports all the Major Planetary Aspects, with an accuracy defined by the user (1° by default).
Conjunction: 0° Alignment. This draws a RED line starting from the center, and going through both planets.
Sextile: 60° Alignment. This draws three YELLOW lines, connecting the planets to each other and to the center.
Square: 90° Alignment. This draws three BLUE lines, connecting the planets to each other and to the center.
Trine: 120° Alignment. This draws three PURPLE lines, connecting the planets to each other and to the center.
Opposition: 180° Alignment. This draws a GREEN line starting from one planet, passing through the center and ending on the second planet.
The below image depicts a Top-Down view of the system, with the Moon in Opposition to Venus and with Mars in Square with Neptune .
Retrograde Computation
This indicator also displays when a planet enters Retrograde (Apparent Backward Motion) by making its orbital trajectory dashed and the planet name getting a red background.
The image below displays an example of Jupiter, Saturn, Neptune and Pluto in Retrograde Motion, from the camera perspective of a 65 degree inclination.
Optional Zodiac Computation (Tropical and Sidereal)
Zodiac represents the relatively stationary star formations that rest along the ecliptic plane, with planets transitioning from one to the next, each with a 30° separation (making 12 in total). I have implemented the option to switch between Tropical mode (where these stars were 2,000 years ago) and Sidereal (where these stars are today).
The image below displays the Zodiac labels with clear lines denoting where each planet falls into.
While this indicator is deployed in a separate pane, it is trivial to transfer it onto your price chart, just by clicking and dragging the graphics. After that, you can adjust the visuals by dragging the scale on the side, or optimizing model settings. You can also drag the model above or below the price, as shown in the following image:
Of course, there are a lot of options to customize this planetary model to your tastes and analytical needs. Aside from visual changes for the labels, colors or resolution you can also disable certain planets that don’t meet your needs as shown below:
Once can also infer the current lunar phases using the Aspects between the Sun and Moon. When the Moon is Opposite the Sun that is a Full Moon, while when they are Conjunct that is a New Moon (and sometimes Eclipse).
—---------------------------------------------------------------------------
I have made this indicator open source to help PineScript programmers understand how to approach 3D graphics rendering, enabling them to develop ever more capable scripts and continuously push the boundaries of what's possible on TradingView.
The code is well documented with comments and has a clear naming convention for functions and variables, to aid developers understand how everything operates.
For financial astrologists, this indicator offers a new way to visualize and correlate planetary movements, adding depth and ease to astrological market analysis.
Regards,
Hawk
[DarkTrader] Swing OrderflowSwing Orderflow is a indicator that helps traders detect key swing highs and lows in price action. It is designed to enhance your charting experience by highlighting important support and resistance levels while providing clear visual cues on market structure changes. By tracking swing pivots and price trends, this indicator enables traders to make more informed decisions regarding potential entry and exit points in the market.
This indicator is inspired by @Fractalyst Indicator :
The core functionality of the script revolves around detecting swing highs and lows based on a customizable swing period. It identifies these pivots by comparing price movements over a specific time window, marking the points where price either peaks or bottoms out. Swing highs are plotted as resistance levels when the price breaks above a certain threshold, while swing lows are plotted as support levels when price breaks below it. These key points are represented with dotted lines and labels on the chart for easy reference.
Indicator In Use :
Swing High Calculation
A swing high occurs when the high of a specific bar (or candle) is greater than the highs of the surrounding bars within a defined range (called the swing period).
Function used to find the highest price within a specified range : ta.highest(period)
If the current price is greater than the highest price of this period, it's marked as a potential swing high.
A swing high generally represents a resistance level, where the price has reached a peak before declining.
Swing Low Calculation
A swing low occurs when the low of a specific bar is lower than the lows of the surrounding bars within the swing period.
Function used to find the lowest price within a specified range : ta.lowest(period)
If the current price is lower than this lowest price, it's identified as a swing low.
Swing lows represent support levels, where the price reaches a bottom before bouncing back.
These points are plotted on the chart, and the script also tracks whether price breaks above the swing high or below the swing low to determine trends or possible reversals.
BSL (Buy Side Liquidity)
BSL represents the Buy Side Liquidity, where traders are expected to have their buy orders (usually stop-loss orders for short positions).
When the price reaches a swing high, traders who are short may have stop orders placed above this level. Once these levels are breached, the script identifies this as a liquidity area where stop orders get triggered, causing potential upward price movement.
The script marks the swing high with a "BSL" label and line to indicate this key resistance and liquidity zone.
SSL (Sell Side Liquidity)
SSL refers to the Sell Side Liquidity, where traders place sell orders (usually stop-loss orders for long positions).
Swing lows are important levels where traders holding long positions place their stop orders. When the price drops below a swing low, it triggers these sell orders, causing potential downward price movement.
The script marks the swing low with an "SSL" label and line, signaling this key support and liquidity zone.
In essence, BSL and SSL represent areas where liquidity is pooled, making them critical points in price action. These liquidity areas, when breached, often lead to aggressive price moves, allowing traders to anticipate trends.
[ALGOA+] Markov Chains Library by @metacamaleoLibrary "MarkovChains"
Markov Chains library by @metacamaleo. Created in 09/08/2024.
This library provides tools to calculate and visualize Markov Chain-based transition matrices and probabilities. This library supports two primary algorithms: a rolling window Markov Chain and a conditional Markov Chain (which operates based on specified conditions). The key concepts used include Markov Chain states, transition matrices, and future state probabilities based on past market conditions or indicators.
Key functions:
- `mc_rw()`: Builds a transition matrix using a rolling window Markov Chain, calculating probabilities based on a fixed length of historical data.
- `mc_cond()`: Builds a conditional Markov Chain transition matrix, calculating probabilities based on the current market condition or indicator state.
Basically, you will just need to use the above functions on your script to default outputs and displays.
Exported UDTs include:
- s_map: An UDT variable used to store a map with dummy states, i.e., if possible states are bullish, bearish, and neutral, and current is bullish, it will be stored
in a map with following keys and values: "bullish", 1; "bearish", 0; and "neutral", 0. You will only use it to customize your own script, otherwise, it´s only for internal use.
- mc_states: This UDT variable stores user inputs, calculations and MC outputs. As the above, you don´t need to use it, but you may get features to customize your own script.
For example, you may use mc.tm to get the transition matrix, or the prob map to customize the display. As you see, functions are all based on mc_states UDT. The s_map UDT is used within mc_states´s s array.
Optional exported functions include:
- `mc_table()`: Displays the transition matrix in a table format on the chart for easy visualization of the probabilities.
- `display_list()`: Displays a map (or array) of string and float/int values in a table format, used for showing transition counts or probabilities.
- `mc_prob()`: Calculates and displays probabilities for a given number of future bars based on the current state in the Markov Chain.
- `mc_all_states_prob()`: Calculates probabilities for all states for future bars, considering all possible transitions.
The above functions may be used to customize your outputs. Use the returned variable mc_states from mc_rw() and mc_cond() to display each of its matrix, maps or arrays using mc_table() (for matrices) and display_list() (for maps and arrays) if you desire to debug or track the calculation process.
See the examples in the end of this script.
Have good trading days!
Best regards,
@metacamaleo
-----------------------------
KEY FUNCTIONS
mc_rw(state, length, states, pred_length, show_table, show_prob, table_position, prob_position, font_size)
Builds the transition matrix for a rolling window Markov Chain.
Parameters:
state (string) : The current state of the market or system.
length (int) : The rolling window size.
states (array) : Array of strings representing the possible states in the Markov Chain.
pred_length (int) : The number of bars to predict into the future.
show_table (bool) : Boolean to show or hide the transition matrix table.
show_prob (bool) : Boolean to show or hide the probability table.
table_position (string) : Position of the transition matrix table on the chart.
prob_position (string) : Position of the probability list on the chart.
font_size (string) : Size of the table font.
Returns: The transition matrix and probabilities for future states.
mc_cond(state, condition, states, pred_length, show_table, show_prob, table_position, prob_position, font_size)
Builds the transition matrix for conditional Markov Chains.
Parameters:
state (string) : The current state of the market or system.
condition (string) : A string representing the condition.
states (array) : Array of strings representing the possible states in the Markov Chain.
pred_length (int) : The number of bars to predict into the future.
show_table (bool) : Boolean to show or hide the transition matrix table.
show_prob (bool) : Boolean to show or hide the probability table.
table_position (string) : Position of the transition matrix table on the chart.
prob_position (string) : Position of the probability list on the chart.
font_size (string) : Size of the table font.
Returns: The transition matrix and probabilities for future states based on the HMM.
Investments Follower Table
🔸 Investments Follower Table is a useful tool to visualize the performance of your investments, regardless of which graph you are viewing.
🔸 By entering the name and the quantities of the stock you own, and your average purchase price, you can view the percentage changes and the profit/loss of your investments, regardless of the graph you’re viewing.
🔸 This indicator allows you to follow 4 stocks at the same time.
🔸 When you first open the indicator, you won’t see the table until you’ll fill the fields necessary to show the data.
🔸 Explanation of the menu:
- % TABLE toggle: Turns On and Off the table
- $ TABLE toggle: This function removes the column of the profit or loss in $. The percentage one will be kept.
- TICKER 1/2/3/4: It’s the part of the settings in which you put the name of the share you own.
- ONLY VALUES toggle: Reduces the table by removing the name of the ticker.
- REDUCED TABLE toggle: Removes all the rows of the table associated to the single investment, to just keep the summery of all the investments active
🔸If you turn off a toggle, but keeping some values inside the menu, the table will also consider that values in the calculation of the summery into the table. To avoid this, you just need to put in the A.P.P. and in the QTY the value “0”.
🔸If you want to reset the indicator, you just have to click “Defaults” in the bottom left corner, and then “Reset settings”.
Stoch RSI Time StatisticsThe “Stochastic RSI Time Statistics” is a comprehensive tool designed to enhance your trading decisions by combining the traditional Stochastic RSI with additional metrics and visual aids. This indicator can be used to detect overbought and oversold conditions, issue long and short alerts based on crossovers, and help you analyse market movements by providing detailed statistical insights.
The Stochastic RSI is an open source script that was developed by Tushar Chande and Stanley Kroll and introduced in their book "The New Technical Trader" in 1994. It combines two popular indicators: the “Relative Strength Index (RSI)” and the “Stochastic Oscillator”.
The “Stochastic RSI Time Statistics” uses the stochastic RSI calculations and additionally calculates various probability and frequency statistics to better understand the momentum oscillator’s behaviour and guide our strategies and risk management.
Statistics & Probabilities:
The indicator calculates important time and frequency-based metrics that provide deeper insight into the behaviour of the Stochastic RSI. These are displayed in a text box on the indicator panel, including:
Avg Long: The average number of bars between the last long signal before exiting the critical zone and the next short signal in the overbought critical zone, including the standard deviation and the sample size within the relevant time frame.
Avg Short: The average number of bars between the last short signal before exiting the critical zone and the next long signal in the oversold critical zone, including the standard deviation and the sample size within the relevant time frame.
Avg Consecutive Longs: The average number of consecutive long signals before the first proceeding short signal occurs, with standard deviation.
Avg Consecutive Shorts: The average number of consecutive short signals before the first proceeding long signal occurs, with standard deviation.
Time in Oversold: The average time (in bars/candle sticks) that the Stochastic RSI lines (K & D Lines both in critical zone) spends in the oversold region (below the buy signal level) after entering the oversold region and until both K & D lines depart from the oversold region, along with the standard deviation.
Time in Overbought: The average time (in bars/candle sticks) that the Stochastic RSI lines (K & D Lines both in critical zone) spends in the overbought region (above the sell signal level), after entering the overbought region and until both K & D lines depart from the overbought region, along with the standard deviation.
Signal Frequency: It calculates the percentage of a single, double, triple, and more than triple long or short signals that occur consecutively within the critical zone before the opposing signal occurs (e.g., 1Long: 40.54%, 2 Long:28.55%, 3Long 17.4%, >3 Long:13.51%, 1Short:36.15%, 2Short:30.41%, 3Short:17.57%, >3Short:15.88%).
Key Features:
Oversold: When the Stochastic RSI is below 20, it indicates that the RSI is in a low range, and the asset may be oversold, potentially signalling a buying opportunity.
Overbought: When the Stochastic RSI is above 80, it suggests the RSI is in a high range, meaning the asset may be overbought and a downturn might be near.
The Stochastic RSI Slope indicates the prominent trend direction within a relevant time period.
Customizable Buy Signal Level (typically below 20-25 percentile) to detect oversold conditions. Customizable Sell Signal Level (typically above 75-80 percentile) to detect overbought conditions. These levels help you spot potential reversal zones where long or short trades might be initiated.
Crossover Alerts:
The indicator tracks crossovers between the K and D lines, generating long signals when a crossover occurs below the buy signal level (indicating oversold conditions) and short signals when a cross under occurs above the sell signal level (indicating overbought conditions). The signals are visualized as labels on the chart:
**L** for potential long (buy) signals: Marked below the bars when the K line crosses above the D line.
**S** for potential short (sell) signals: Marked above the bars when the K line crosses below the D line.
Visual Alerts are generated based on these signals.
Risk Management
Although the Stochastic RSI is typically regarded as presenting trend direction and overbought and oversold conditions when in the extreme zones, the RSI can linger and cross over or under numerous times while in the critical zone. The statistics added to the Stochastic RSI indicator allows one to assess the statistical probability of numerous crossover signals occurring on an asset or at various time frames. Signal levels, or preferred definitions of the critical zones can be adjusted while the statistics are automatically updated to the relevant ticker or time frame. Colours and Signal shapes are adjustable to suite your visual preferences.
By using this indicator, you acknowledge and agree that:
No Guarantees: The indicator is provided "as-is" without any warranties or guarantees of accuracy, completeness, or fitness for a particular purpose. The outcomes or performance of trades executed using this indicator are not guaranteed to be successful or profitable.
User Responsibility: You are solely responsible for any trading decisions you make based on the use of this indicator. All trading and investment activities involve risk, and it is essential to conduct your own research, analysis, and due diligence before making any financial decisions.
No Liability: The creator of this indicator is not responsible for any financial losses, direct or indirect, incurred as a result of using this indicator. This includes, but is not limited to, loss of profits, loss of capital, or any other negative financial outcomes.
Market Risks: Markets are volatile, and prices may fluctuate significantly. Trading and investing carry inherent risks, and there is always the potential for loss. You should only trade with capital that you can afford to lose.
Independent Advice: It is strongly recommended that you seek independent financial advice from a qualified and licensed professional before making any trading or investment decisions based on the use of this indicator.
By using this indicator, you acknowledge that you fully understand and accept the risks involved, and you agree to indemnify and hold harmless the creator of this indicator from any claims, damages, or liabilities arising from its use.
The author of this script has made every effort to ensure that the code is an original interpretation and application of the open-source Stochastic RSI, as developed by the original authors, Tushar Chande and Stanley Kroll. The script reflects a unique adaptation aimed at enhancing trading strategies through advanced statistical analysis and trade management features. The author does not claim any proprietary rights over the foundational concepts of the Stochastic RSI and does not intend to infringe upon any existing copyrights. Should any copyright infringement be identified, the author commits to removing the indicator immediately and forfeits any rights to further or intended financial gain from its use.
OrderFlow [Adjustable] | FractalystWhat's the indicator's purpose and functionality?
This indicator is designed to assist traders in identifying real-time probabilities of buyside and sellside liquidity .
It allows for an adjustable pivot level , enabling traders to customize the level they want to use for their entries.
By doing so, traders can evaluate whether their chosen entry point would yield a positive expected value over a large sample size, optimizing their strategy for long-term profitability.
For advanced traders looking to enhance their analysis, the indicator supports the incorporation of up to 7 higher timeframe biases .
Additionally, the higher timeframe pivot level can be adjusted according to the trader's preferences,
Offering maximum adaptability to different strategies and needs, further helping to maximize positive EV.
EV=(P(Win)×R(Win))−(P(Loss)×R(Loss))
-----
What's the purpose of these levels? What are the underlying calculations?
1. Understanding Swing highs and Swing Lows
Swing High: A Swing High is formed when there is a high with 2 lower highs to the left and right.
Swing Low: A Swing Low is formed when there is a low with 2 higher lows to the left and right.
2. Understanding the purpose and the underlying calculations behind Buyside, Sellside and Pivot levels.
3. Identifying Discount and Premium Zones.
4. Importance of Risk-Reward in Premium and Discount Ranges
----
How does the script calculate probabilities?
The script calculates the probability of each liquidity level individually. Here's the breakdown:
1. Upon the formation of a new range, the script waits for the price to reach and tap into pivot level level. Status: "⏸" - Inactive
2. Once pivot level is tapped into, the pivot status becomes activated and it waits for either liquidity side to be hit. Status: "▶" - Active
3. If the buyside liquidity is hit, the script adds to the count of successful buyside liquidity occurrences. Similarly, if the sellside is tapped, it records successful sellside liquidity occurrences.
4. Finally, the number of successful occurrences for each side is divided by the overall count individually to calculate the range probabilities.
Note: The calculations are performed independently for each directional range. A range is considered bearish if the previous breakout was through a sellside liquidity. Conversely, a range is considered bullish if the most recent breakout was through a buyside liquidity.
----
What does the multi-timeframe functionality offer?
In the adjustable version of the orderflow indicator, you can incorporate up to 7 higher timeframe probabilities directly into the table.
This feature allows you to analyze the probabilities of buyside and sellside liquidity across multiple timeframes, without the need to manually switch between them.
By viewing these higher timeframe probabilities in one place, traders can spot larger market trends and refine their entries and exits with a better understanding of the overall market context.
This multi-timeframe functionality helps traders:
1. Simplify decision-making by offering a comprehensive view of multiple timeframes at once.
2. Identify confluence between timeframes, enhancing the confidence in trade setups.
3. Adapt strategies more effectively, as the higher timeframe pivot levels can be customized to meet individual preferences and goals.
----
What are the multi-timeframe underlying calculations?
The script uses the same calculations (mentioned above) and uses security function to request the data such as price levels, bar time, probabilities and booleans from the user-input timeframe.
----
How does the Indicator Identifies Positive Expected Values?
OrderFlow indicator instantly calculates whether a trade setup has the potential for positive expected value (EV) in the long run.
To determine a positive EV setup, the indicator uses the formula:
EV=(P(Win)×R(Win))−(P(Loss)×R(Loss))
where:
P(Win) is the probability of a winning trade.
R(Win) is the reward or return for a winning trade, determined by the current risk-to-reward ratio (RR).
P(Loss) is the probability of a losing trade.
R(Loss) is the loss incurred per losing trade, typically assumed to be -1.
By calculating these values based on historical data and the current trading setup, the indicator helps you understand whether your trade has a positive expected value over a large sample size.
----
How can I know that the setup I'm going to trade with has a postive EV?
If the indicator detects that the adjusted pivot and buy/sell side probabilities have generated positive expected value (EV) in historical data, the risk-to-reward (RR) label within the range box will be colored blue and red .
If the setup does not produce positive EV, the RR label will appear gray.
This indicates that even the risk-to-reward ratio is greater than 1:1, the setup is not likely to yield a positive EV because, according to historical data, the number of losses outweighs the number of wins relative to the RR gain per winning trade.
----
What is the confidence level in the indicator, and how is it determined?
The confidence level in the indicator reflects the reliability of the probabilities calculated based on historical data. It is determined by the sample size of the probabilities used in the calculations. A larger sample size generally increases the confidence level, indicating that the probabilities are more reliable and consistent with past performance.
----
How does the confidence level affect the risk-to-reward (RR) label?
The confidence level (★) is visually represented alongside the probability label. A higher confidence level indicates that the probabilities used to determine the RR label are based on a larger and more reliable sample size.
----
How can traders use the confidence level to make better trading decisions?
Traders can use the confidence level to gauge the reliability of the probabilities and expected value (EV) calculations provided by the indicator. A confidence level above 95% is considered statistically significant and indicates that the historical data supporting the probabilities is robust. This high confidence level suggests that the probabilities are reliable and that the indicator’s recommendations are more likely to be accurate.
In data science and statistics, a confidence level above 95% generally means that there is less than a 5% chance that the observed results are due to random variation. This threshold is widely accepted in research and industry as a marker of statistical significance. Studies such as those published in the Journal of Statistical Software and the American Statistical Association support this threshold, emphasizing that a confidence level above 95% provides a strong assurance of data reliability and validity.
Conversely, a confidence level below 95% indicates that the sample size may be insufficient and that the data might be less reliable . In such cases, traders should approach the indicator’s recommendations with caution and consider additional factors or further analysis before making trading decisions.
----
How does the sample size affect the confidence level, and how does it relate to my TradingView plan?
The sample size for calculating the confidence level is directly influenced by the amount of historical data available on your charts. A larger sample size typically leads to more reliable probabilities and higher confidence levels.
Here’s how the TradingView plans affect your data access:
Essential Plan
The Essential Plan provides basic data access with a limited amount of historical data. This can lead to smaller sample sizes and lower confidence levels, which may weaken the robustness of your probability calculations. Suitable for casual traders who do not require extensive historical analysis.
Plus Plan
The Plus Plan offers more historical data than the Essential Plan, allowing for larger sample sizes and more accurate confidence levels. This enhancement improves the reliability of indicator calculations. This plan is ideal for more active traders looking to refine their strategies with better data.
Premium Plan
The Premium Plan grants access to extensive historical data, enabling the largest sample sizes and the highest confidence levels. This plan provides the most reliable data for accurate calculations, with up to 20,000 historical bars available for analysis. It is designed for serious traders who need comprehensive data for in-depth market analysis.
PRO+ Plans
The PRO+ Plans offer the most extensive historical data, allowing for the largest sample sizes and the highest confidence levels. These plans are tailored for professional traders who require advanced features and significant historical data to support their trading strategies effectively.
For many traders, the Premium Plan offers a good balance of affordability and sufficient sample size for accurate confidence levels.
----
What is the HTF probability table and how does it work?
The HTF (Higher Time Frame) probability table is a feature that allows you to view buy and sellside probabilities and their status from timeframes higher than your current chart timeframe.
Here’s how it works:
Data Request : The table requests and retrieves data from user-defined higher timeframes (HTFs) that you select.
Probability Display: It displays the buy and sellside probabilities for each of these HTFs, providing insights into the likelihood of price movements based on higher timeframe data.
Detailed Tooltips: The table includes detailed tooltips for each timeframe, offering additional context and explanations to help you understand the data better.
----
What do the different colors in the HTF probability table indicate?
The colors in the HTF probability table provide visual cues about the expected value (EV) of trading setups based on higher timeframe probabilities:
Blue: Suggests that entering a long position from the HTF user-defined pivot point, targeting buyside liquidity, is likely to result in a positive expected value (EV) based on historical data and sample size.
Red: Indicates that entering a short position from the HTF user-defined pivot point, targeting sellside liquidity, is likely to result in a positive expected value (EV) based on historical data and sample size.
Gray: Shows that neither long nor short trades from the HTF user-defined pivot point are expected to generate positive EV, suggesting that trading these setups may not be favorable.
----
How to use the indicator effectively?
For Amateur Traders:
Start Simple: Begin by focusing on one timeframe at a time with the pivot level set to the default (50%). This helps you understand the basic functionality of the indicator.
Entry and Exit Strategy: Focus on entering trades at the pivot level while targeting the higher probability side for take profit and the lower probability side for stop loss.
Use simulation or paper trading to practice this strategy.
Adjustments: Once you have a solid understanding of how the indicator works, you can start adjusting the pivot level to other values that suit your strategy.
Ensure that the RR labels are colored (blue or red) to indicate positive EV setups before executing trades.
For Advanced Traders:
1. Select Higher Timeframe Bias: Choose a higher timeframe (HTF) as your main bias. Start with the default pivot level and ensure the confidence level is above 95% to validate the probabilities.
2. Align Lower Timeframes: Switch between lower timeframes to identify which ones align with your predefined HTF bias. This helps in synchronizing your trading decisions across different timeframes.
3. Set Entries with Current Pivot Level: Use the current pivot level for trade entries. Ensure the HTF status label is active, indicating that the probabilities are valid and in play.
4. Target HTF Liquidity Level: Aim for liquidity levels that correspond to the higher timeframe, as these levels are likely to offer better trading opportunities.
5. Adjust Pivot Levels: As you gain experience, adjust the pivot levels to further optimize your strategy for high EV. Fine-tune these levels based on the aggregated data from multiple timeframes.
6. Practice on Paper Trading: Test your strategies through paper trading to eliminate discretion and refine your approach without financial risk.
7. Focus on Trade Management: Ultimately, effective trade management is crucial. Concentrate on managing your trades well to ensure long-term success. By aiming for setups that produce positive EV, you can position yourself similarly to how a casino operates.
----
🎲 Becoming the House (Gaining Edge Over the Market):
In American roulette, the house has a 5.26% edge due to the 0 and 00. This means that while players have a 47.37% chance of winning on even-money bets, the true odds are 50%. The discrepancy between the true odds and the payout ensures that, statistically, the casino will win over time.
From the Trader's Perspective: In trading, you gain an edge by focusing on setups with positive expected value (EV). If you have a 55.48% chance of winning with a 1:1 risk-to-reward ratio, your setup has a higher probability of profitability than the losing side. By consistently targeting such setups and managing your trades effectively, you create a statistical advantage, similar to the casino’s edge.
----
🎰 Applying the Concept to Trading:
Just as casinos rely on their mathematical edge, you can achieve long-term success in trading by focusing on setups with positive EV. By ensuring that your probabilities and risk-to-reward (RR) ratios are in your favor, you create an edge similar to that of the house.
And by systematically targeting trades with favorable probabilities and managing your trades effectively, you improve your chances of profitability over the long run. Which is going to help you “become the house” in your trading, leveraging statistical advantages to enhance your overall performance.
----
What makes this indicator original?
Real-Time Probability Calculations: The indicator provides real-time calculations of buy and sell probabilities based on historical data, allowing traders to assess the likelihood of positive expected value (EV) setups instantly.
Adjustable Pivot Levels: It features an adjustable pivot level that traders can modify according to their preferences, enhancing the flexibility to align with different trading strategies.
Multi-Timeframe Integration: The indicator supports up to 7 higher timeframes, displaying their probabilities and biases in a single view, which helps traders make informed decisions without switching timeframes.
Confidence Levels: It includes confidence levels based on sample sizes, offering insights into the reliability of the probabilities. Traders can gauge the strength of the data before making trades.
Dynamic EV Labels: The indicator provides color-coded EV labels that change based on the validity of the setup. Blue indicates positive EV in a long bias, red indicates positive EV in a short bias and gray signals caution, making it easier for traders to identify high-quality setups.
HTF Probability Table: The HTF probability table displays buy and sell probabilities from user-defined higher timeframes, helping traders integrate broader market context into their decision-making process.
----
Terms and Conditions | Disclaimer
Our charting tools are provided for informational and educational purposes only and should not be construed as financial, investment, or trading advice. They are not intended to forecast market movements or offer specific recommendations. Users should understand that past performance does not guarantee future results and should not base financial decisions solely on historical data.
Built-in components, features, and functionalities of our charting tools are the intellectual property of @Fractalyst use, reproduction, or distribution of these proprietary elements is prohibited.
By continuing to use our charting tools, the user acknowledges and accepts the Terms and Conditions outlined in this legal disclaimer and agrees to respect our intellectual property rights and comply with all applicable laws and regulations.
Ema Z-score | viResearchEma Z-score | viResearch
Conceptual Foundation and Innovation
The "Ema Z-score" indicator introduces a novel method of analyzing price deviations from the mean by combining the Exponential Moving Average (EMA) with a Z-score calculation. The Z-score is a statistical measure that quantifies how far a value deviates from the mean in terms of standard deviations. By applying the Z-score to an EMA, this indicator provides traders with insights into the strength and momentum of price movements relative to a smoothed average. This enables better detection of overbought and oversold conditions, as well as potential trend reversals.
The use of the Z-score helps filter out noise and provides more robust signals by highlighting extreme deviations from the mean, allowing traders to make more informed decisions in both trending and ranging markets.
Technical Composition and Calculation
The "Ema Z-score" script consists of two main components: the Exponential Moving Average (EMA) and the Z-score calculation. The EMA is calculated over a user-defined length, smoothing price movements to provide a clearer trend line. The Z-score is then derived by measuring the deviation of the current EMA value from the mean of the EMA over a lookback period, divided by the standard deviation of the EMA during that same period.
For the Z-score calculation, the script first computes the mean EMA over the lookback period using the ta.ema function. It then calculates the standard deviation of the EMA over the same period using the ta.stdev function. The Z-score is determined by subtracting the mean EMA from the current EMA value and dividing by the standard deviation, producing a normalized measure of deviation from the average.
Features and User Inputs
The "Ema Z-score" script offers several customizable inputs that allow traders to adjust the indicator according to their strategies. The EMA Length controls the smoothing period of the EMA, while the Lookback Period defines how far back the script looks when calculating the mean and standard deviation for the Z-score. Customizable thresholds allow traders to define when the Z-score signals potential uptrends or downtrends, based on their chosen levels of deviation.
Practical Applications
The "Ema Z-score" indicator is designed for traders who want to better understand price deviations from the mean and use those insights to identify potential trading opportunities. This tool is particularly effective for:
Identifying Overbought and Oversold Conditions: The Z-score provides a quantitative measure of how far the price has deviated from the mean, helping traders spot extreme conditions that could lead to reversals. Detecting Trend Reversals: By monitoring when the Z-score crosses certain thresholds, traders can identify potential trend reversals early and adjust their positions accordingly. Confirming Trend Strength: The Z-score can help confirm whether a price move is backed by momentum or is likely to revert to the mean, providing additional context for trade entries and exits.
Advantages and Strategic Value
The "Ema Z-score" script offers a significant advantage by combining the smoothing effect of the EMA with the precision of Z-score analysis. This approach reduces the impact of market noise while highlighting meaningful deviations from the norm. The ability to quantify deviations in terms of standard deviations gives traders a statistical edge in identifying overbought or oversold conditions and potential trend shifts. This makes the "Ema Z-score" an effective tool for both trend-following and contrarian strategies.
Alerts and Visual Cues
The script includes alert conditions to notify traders of key Z-score threshold crossings. The "Ema Z-score Long" alert is triggered when the Z-score exceeds the upper threshold, signaling a potential upward trend. Conversely, the "Ema Z-score Short" alert signals a possible downward trend when the Z-score falls below the lower threshold. Visual cues such as color changes in the bar chart and Z-score plot help traders easily identify these conditions on the chart.
Summary and Usage Tips
The "Ema Z-score | viResearch" indicator offers a unique combination of EMA smoothing and Z-score analysis, giving traders a statistical measure of price deviations and improving their ability to detect overbought or oversold conditions, trend reversals, and trend confirmations. By incorporating this script into your trading strategy, you can better quantify price extremes and make more informed decisions in both volatile and stable markets. Whether you're focused on spotting early reversals or confirming ongoing trends, the "Ema Z-score" provides a reliable and customizable solution.
Note: Backtests are based on past results and are not indicative of future performance.
Forex Macro Metrics [MacroGlide]"Forex Macro Metrics " is a powerful tool for analyzing macroeconomic metrics, designed to help traders make more informed decisions in the forex market. This indicator displays key economic indicators such as interest rates, money supply (M1 and M2), unemployment rate, and government debt for various currencies and their pairs, allowing users to assess the macroeconomic differences between the base and quote currencies.
Key Features:
• Interest Rates Display: Includes interest rates for major world currencies with the ability to show the differential between the base and quote currencies.
• Money Supply Analysis (M1 and M2): Displays the money supply for both the base and quote currencies, including differential calculations.
• Unemployment Rate: Compares the unemployment rates between currencies, showing the differences on the chart.
• Government Debt: Shows government debt levels for the base and quote currencies with differential calculations.
• Customizable Options: Enable/disable specific metrics and adjust colors for better visual clarity.
How to Use:
• Select a Currency Pair: Apply the indicator to your chart and choose the desired currency pair. The indicator will automatically load the relevant data for the base and quote currencies.
• Adjust Display Settings: Use the indicator settings to enable or disable specific metrics and their differentials.
• Analyze the Data: Compare the economic conditions of the two currencies through the charts and identify potential trading opportunities based on macroeconomic differences.
Methodology:
The indicator uses economic data available through TradingView tickers to calculate the values of the base and quote currencies. Differentials are calculated by subtracting the values of the quote currency from the base currency, allowing for a visual assessment of their differences. The displayed data includes historical changes, helping to identify trends and potential reversal points.
Originality and Usefulness:
"Forex Macro Metrics " is a unique tool that combines several key macroeconomic indicators into one comprehensive indicator. This simplifies the analysis process for traders looking to understand the fundamental differences between currencies. Using this approach provides an advantage in assessing long-term trends and potential shifts in currency pairs driven by changes in macroeconomic conditions.
Charts:
The indicator displays data in the form of lines and areas on the chart, with interest rates shown as lines for the base and quote currencies, accompanied by an area representing the differential. For money supply (M1 and M2), lines are drawn for each currency, with areas highlighting the differences. Similarly, the unemployment rate and government debt are displayed with clear visual separation of the data and their differentials, making it easy to compare and analyze the macroeconomic conditions of the currencies involved.
Enjoy the game!
Kalman PSaR [BackQuant]Kalman PSaR
Overview and Innovation
The Kalman PSaR combines the well-known Parabolic SAR (PSaR) with the advanced smoothing capabilities of the Kalman Filter . This innovative tool aims to enhance the traditional PSaR by integrating Kalman filtering, which reduces noise and improves trend detection. The Kalman PSaR adapts dynamically to price movements, making it a highly effective indicator for spotting trend shifts while minimizing the impact of false signals caused by market volatility.
Please Find the Basic Kalman Here:
Kalman Filter Dynamics
The Kalman Filter is a powerful algorithm for estimating the true value of a system amidst noisy data. In the Kalman PSaR, this filter is applied to the high, low, and closing prices, resulting in a smoother and more accurate representation of price action. The filter’s parameters—process noise and measurement noise—are customizable, allowing traders to fine-tune the sensitivity of the indicator to market conditions. By reducing the impact of noise, the Kalman-filtered PSaR offers clearer signals for identifying trend reversals and continuations.
Enhanced PSaR Calculation
The traditional Parabolic SAR is a popular trend-following indicator that highlights potential entry and exit points based on price acceleration. In the Kalman PSaR, this calculation is enhanced by the Kalman-filtered prices, providing a smoother and more reliable signal. The indicator continuously updates based on the acceleration factor and max step values, while the Kalman filter ensures that sudden price spikes or market noise do not trigger false signals.
Min Step and Max Step: These settings control the sensitivity of the PSaR. The Min Step sets the initial acceleration factor, while the Max Step limits how fast the PSaR adapts to price changes, helping traders fine-tune the indicator’s responsiveness.
Optional Smoothing Techniques To further enhance the signal clarity, the Kalman PSaR includes an optional smoothing feature. Traders can choose from various smoothing methods, such as SMA, Hull, EMA, WMA, TEMA, and more, to reduce short-term fluctuations and emphasize the underlying trend. The smoothing period is customizable, allowing traders to adjust the indicator’s behavior according to their preferred trading style and timeframe.
Color-Coded Candle Painting The Kalman PSaR features color-coded candles that change according to the trend direction. When the price is above the PSaR, candles are painted green to indicate a long trend, and when the price is below the PSaR, candles are painted red to signal a short trend. This visual representation makes it easy to interpret market sentiment at a glance, improving decision-making speed during fast-moving markets.
Key Features and Customization
Kalman Filter Customization: The process noise and measurement noise parameters allow traders to adjust how aggressively the filter adapts to price changes, making it suitable for both volatile and stable markets.
Smoothing Options: A variety of moving average types, such as SMA, Hull, EMA, and more, can be applied to smooth the PSaR values, ensuring that the signal remains clear even in choppy markets.
Dynamic Trend Detection: The Kalman PSaR dynamically updates based on price movements, helping traders spot trend reversals early while filtering out false signals caused by short-term volatility.
Bar Coloring and PSaR Plotting: Traders can choose to color candles based on trend direction or plot the PSaR directly on the chart for additional visual clarity.
Practical Applications
Trend-Following Strategies: The Kalman PSaR excels in trend-following strategies by providing timely signals of trend changes. The dynamic nature of the indicator allows traders to capture significant price movements while avoiding market noise.
Reversal Identification: The indicator’s ability to filter out noise and provide smoother signals makes it ideal for identifying reversals in volatile markets.
Risk Management: By plotting clear stop levels based on the PSaR, traders can use this indicator to effectively manage risk, placing stop-loss orders at key points based on the trend direction.
Conclusion
The Kalman PSaR is a fusion of the classic Parabolic SAR and the Kalman filter, offering enhanced trend detection with reduced noise. Its customizable filtering and smoothing options, combined with dynamic trend-following capabilities, make it a versatile tool for traders seeking to improve their timing and signal accuracy. The adaptive nature of the Kalman filter, combined with the robust PSaR logic, helps traders stay on the right side of the market and manage risk more effectively.
Fisher Divergence Overlay [BackQuant]Fisher Divergence Overlay
You can find the other Fisher Script Here !
Overlay Adaptation The Fisher Divergence Overlay is a newly enhanced version of the original Fisher Transformation indicator, designed specifically to be plotted directly on price charts. This adaptation allows traders to visualize Fisher Transform signals, divergences, and trend shifts directly over the price action, offering a more intuitive way to monitor market trends and potential reversals without the need for separate indicator windows. The overlay structure is particularly useful for spotting divergences and shifts in momentum as they relate to key price levels.
Why Turn the Fisher into an Overlay?
By transforming the Fisher Divergence indicator into an overlay, traders gain a more direct view of the relationship between price movements and the Fisher Transformation's signals. Divergences and midline crossovers, key components of the Fisher strategy, can now be clearly seen relative to the current price action. The decision to integrate this functionality as an overlay allows for a cleaner and more insightful trading experience, helping traders make quicker, more informed decisions based on market dynamics.
Midline Cross Signals : The overlay makes it easy to see when the Fisher Transform crosses above or below the midline, a critical signal for potential trend reversals.
Divergence Signals : Both regular and hidden divergences are plotted directly over price bars, offering immediate visual confirmation of potential trend shifts.
Key Features of the Overlay Version
Kaufman Adaptive Moving Average (KAMA): The Fisher Transformation in this overlay version can be adapted using Kaufman’s Adaptive Moving Average (KAMA). This enhances the Fisher's responsiveness to current market volatility, smoothing out price data while maintaining the accuracy of trend signals.
Divergence Detection: The overlay includes both regular and hidden bullish and bearish divergence detection, with these divergences plotted directly on the price chart. This visual feedback makes it easier for traders to spot when the momentum of the Fisher Transform deviates from the actual price movement, often signaling potential reversals.
Dynamic Bar Coloring: The bars are color-coded based on either the Fisher trend or divergences, allowing traders to visually interpret market sentiment without additional analysis. Green bars signal an upward trend or bullish divergence, while red bars indicate a downward trend or bearish divergence.
Take Profit Hues: In conjunction with a normalized RSI, the overlay includes background hues for overbought and oversold conditions, providing additional context for exit points or potential reversals.
How to Use the Fisher Overlay Traders can use this overlay to streamline their workflow by having both the Fisher signals and price action in the same visual space. The key signals include:
Midline Cross Signals: A crossover of the Fisher Transform above the midline often indicates a shift toward bullish momentum, while a cross below suggests bearish momentum.
Divergences: Regular and hidden divergences, displayed directly on the chart, help traders identify moments when the momentum of the Fisher Transform is in contrast with price movements, signaling potential reversals.
RSI Confluence: Overbought and oversold signals, provided by the integrated RSI, give further insight into potential exhaustion points in the market, marked by background color changes on the chart.
Strategic Value of the Fisher Divergence Overlay
This overlay offers a streamlined, efficient way to interpret Fisher Transform signals, divergences, and confluence signals like RSI in real-time. The visual integration of these signals with price action enhances decision-making by providing immediate context, making it easier to spot high-probability trade setups.
Trend Confirmation: The overlay version helps confirm trends by visually aligning Fisher Transform signals with price levels. Traders can use this feature to strengthen their conviction before entering or exiting a trade.
Adaptability: With the option to use KAMA for adaptive price smoothing, this overlay remains responsive across different market environments, making it suitable for both trending and volatile markets.
Summary and Interpretation Tips
It enhances the traditional Fisher Transform with visual elements like divergence detection, RSI confluence, and midline cross signals. By overlaying these elements directly on the price chart, traders can quickly interpret key signals and make better trading decisions.
Use this indicator to identify trend shifts and potential reversals by focusing on midline crossovers and divergences. The visual cues—bar colors, divergence labels, and background hues—make it easy to spot actionable moments without cluttering the chart. For best results, combine this overlay with other trend-following tools to confirm your trades and maximize the utility of Fisher Transform signals.
Multi-Kernel CCI [BackQuant]Multi-Kernel CCI
Conceptual Foundation and Innovation
It offers a fresh take on the Commodity Channel Index (CCI) by integrating three distinct kernel functions—Exponential Decay, Gaussian Decay, and Cosine Decay—to create a more robust and adaptive momentum indicator. The use of these kernel functions allows the CCI calculation to be more responsive to price changes while smoothing out noise, providing traders with clearer trend signals and reducing false alerts in varying market conditions.
Technical Composition and Calculation
The core of this indicator is a multi-kernel approach to calculating the CCI, where three different decay kernels are applied to the price source. Each kernel provides a unique weighting mechanism for price data over a user-defined lookback period. The result is an average of these three kernel calculations, which serves as the foundation for the CCI calculation. This innovative approach makes the Multi-Kernel CCI more adaptive to different market conditions compared to traditional CCI calculations.
Exponential Decay Kernel: Applies an exponential weighting to recent price data, giving more importance to recent values while smoothing out older data.
Gaussian Decay Kernel: Weights data using a Gaussian function, ensuring smooth transitions between price points and reducing outliers' impact.
Cosine Decay Kernel: Utilizes a cosine function to apply a unique oscillating weight to the data, capturing cyclical market movements more effectively.
Adaptive Thresholding: Like the Adaptive Momentum Oscillator, this indicator adjusts its long and short thresholds dynamically using percentile-based calculations over historical CCI values.
Features and User Inputs The Multi-Kernel CCI offers a wide range of customization options for traders:
Kernel Calculation Length & Alpha: Traders can fine-tune the sensitivity of the CCI by adjusting the length of the kernel calculation and the alpha parameter for the Exponential Decay Kernel.
Adaptive Thresholds: The indicator provides percentile-based thresholds for both long and short signals, allowing traders to dynamically adjust their signals based on historical data.
Extreme Value Detection: This feature highlights extreme overbought and oversold conditions with customizable thresholds and background hues, visually aiding in identifying high-probability reversal zones.
Divergence Detection: The script includes a divergence detection feature, identifying regular and hidden bullish or bearish divergences to help traders spot potential trend reversals.
Practical Applications The Multi-Kernel CCI excels in markets where adaptive trend detection and momentum confirmation are critical. Traders can leverage this tool in several ways:
Adaptive Trend Following: The dynamically adjusting thresholds allow traders to capture trends more effectively while avoiding false signals during consolidations or choppy markets.
Reversal Detection: The multi-kernel approach ensures that reversals are detected with greater precision, particularly in volatile markets where traditional indicators might fail.
Divergence Identification: With built-in divergence detection, the indicator provides traders with an early warning of potential trend reversals, helping to time their entries and exits more effectively.
Advantages and Strategic Value The Multi-Kernel CCI offers several strategic advantages over traditional CCI indicators:
Multi-Kernel Smoothing:
By using multiple decay kernels, this CCI calculation is better suited to detect subtle changes in market momentum, reducing the impact of noise and providing clearer trend signals.
Dynamic Thresholds:
The adaptive percentile-based thresholds ensure that the indicator remains relevant across different market conditions, enhancing signal accuracy.
Visual and Analytical Aids:
With features like extreme value detection and divergence spotting, this indicator equips traders with powerful tools to confirm trend strength and identify potential reversals.
Summary and Usage Tips
The Multi-Kernel CCI is a highly versatile tool for traders seeking a more adaptive and robust momentum indicator. Its multi-kernel foundation provides smoother, more reliable signals, while the adaptive thresholds and divergence detection features help traders refine their entries and exits. The dynamic nature of this indicator makes it ideal for both trend-following and reversal strategies in volatile markets.
Traders should experiment with the kernel calculation length and alpha parameter to align the indicator's sensitivity with their specific trading style and market conditions. Additionally, the adaptive thresholds can be fine-tuned to ensure the CCI captures the most significant trend changes without being overly reactive to short-term fluctuations.
Thus following all of the key points here are some sample backtests on the 1D Chart
Disclaimer: Backtests are based off past results, and are not indicative of the future.
INDEX:BTCUSD
INDEX:ETHUSD
BINANCE:SOLUSD
Kalman Filter RoC with Adaptive Thresholds [BackQuant]Kalman Filter RoC with Adaptive Thresholds
Another Kalman Script !!
Please Find the Basic Kalman Here:
Overview and Purpose
The Kalman Filter RoC with Adaptive Thresholds is an advanced tool designed for traders seeking to refine their trend detection and momentum analysis. By combining the robustness of the Kalman filter with the Rate of Change (RoC) indicator, this tool offers a highly responsive and adaptive method to identify shifts in market trends. The inclusion of adaptive thresholding further enhances the indicator’s precision by dynamically adjusting to market volatility, providing traders with reliable entry and exit signals.
Kalman Filter Dynamics
The Kalman Filter is renowned for its ability to estimate the true state of a system amidst noisy data. In this indicator, the Kalman filter is applied to the price data to smooth out fluctuations and generate a more accurate representation of the underlying trend. This is particularly useful in volatile markets where noise can obscure the true direction of price movements. The Kalman filter adapts in real-time based on user-defined parameters, such as process noise and measurement noise, making it highly customizable for different market conditions.
Rate of Change (RoC) and Smoothing The Rate of Change (RoC) is a classic momentum indicator that measures the percentage change in price over a specific period. By integrating it with the Kalman-filtered price, the RoC becomes more responsive to genuine price trends while filtering out short-term noise. An optional smoothing feature using the ALMA (Arnaud Legoux Moving Average) further refines the signal, allowing traders to adjust the calculation length and smoothing factor (sigma) for even greater precision.
Adaptive Thresholds A key innovation in this indicator is the adaptive thresholding mechanism. Traditional RoC indicators rely on static thresholds to identify overbought or oversold conditions, but the Kalman Filter RoC adapts these thresholds dynamically. The adaptive thresholds are calculated based on the historical volatility of the filtered RoC values, allowing the indicator to adjust in response to changing market conditions. This feature reduces the risk of false signals in choppy or highly volatile markets.
Divergence Detection The Kalman Filter RoC also includes divergence detection, helping traders identify when the momentum of the RoC diverges from the price action. Divergences can often signal potential reversals or trend continuations, making them a valuable tool in any trader’s toolkit. Regular and hidden divergences are plotted directly on the chart, providing visual cues for traders to act upon.
Customization and Flexibility This indicator offers a wide range of customization options, making it suitable for various trading strategies and market conditions:
Process Noise & Measurement Noise: These parameters control how sensitive the Kalman filter is to price changes and help traders fine-tune the balance between noise reduction and signal responsiveness.
ALMA Smoothing: Traders can apply ALMA smoothing to the RoC signal to reduce short-term volatility and improve signal clarity.
Adaptive Threshold Calculation Period: The length of the lookback period for the adaptive thresholds can be adjusted, allowing traders to tailor the indicator to fit their specific trading style.
Practical Applications
Trend Detection: The Kalman-filtered RoC helps identify shifts in momentum, making it easier for traders to spot emerging trends early. The dynamic thresholding ensures that these signals are reliable, even in volatile markets.
Divergence Trading: Divergences between the RoC and price action are clear indicators of potential trend reversals. The visual plotting of divergences simplifies the process of identifying these opportunities.
Momentum Analysis: The combination of Kalman filtering and RoC provides a smoother, more accurate view of market momentum, helping traders stay on the right side of the market.
Conclusion
The Kalman Filter RoC is a powerful and adaptable tool that merges advanced filtering techniques with momentum analysis. Its real-time responsiveness and dynamic thresholding make it a highly effective indicator for identifying trends, managing risk, and capitalizing on divergence signals. Traders looking to enhance their trend-following or momentum strategies will find this indicator to be a valuable addition to their toolkit.
Thus following all of the key points here are some sample backtests on the 1D Chart
Disclaimer: Backtests are based off past results, and are not indicative of the future.
INDEX:BTCUSD
INDEX:ETHUSD
BINANCE:SOLUSD
Adaptive Momentum Oscillator [BackQuant]Adaptive Momentum Oscillator
Please take time to read the following.
Conceptual Foundation and Innovation
The Adaptive Momentum Oscillator brings a new approach to momentum trading by introducing percentile-based adaptive thresholding. Unlike traditional momentum oscillators that rely on static overbought and oversold levels, this indicator adjusts dynamically to changing market conditions, providing more relevant signals in real-time. By combining percentile-based thresholds with a smoothed momentum oscillator, this tool allows traders to detect trend shifts with a higher degree of accuracy.
Technical Composition and Calculation
The core of this oscillator uses a lookback period to calculate the highest and lowest values of a smoothed price source (using a non-robust moving average). These values are then used to compute the oscillator, which normalizes the current price between the lookback high and low. The true innovation lies in its adaptive thresholds, which adjust based on percentiles of past oscillator values over a user-defined lookback period.
Lookback Period: The indicator checks the highest and lowest smoothed price over a set period, which becomes the basis for calculating momentum.
Percentile-Based Thresholds: The upper and lower thresholds are dynamically set at user-defined percentiles of historical momentum values, allowing the oscillator to adapt to the volatility and strength of the market.
Smoothing Length: Users can adjust the smoothing of the source input to fine-tune the sensitivity of the oscillator.
Features and User Inputs offer a host of customizable settings to suit different market conditions and trading strategies:
Adaptive Thresholding: Traders can set the lookback period and define the percentile levels for the upper (long) and lower (short) thresholds. This provides the ability to dynamically adjust to changing market conditions and avoid static thresholds that may become irrelevant over time.
Signal Line Customization: Users can configure the signal line width, colors for long, short, and neutral conditions, and choose whether to display adaptive threshold lines on the chart.
Candle Coloring: An optional feature allows traders to color the price bars based on the oscillator's trend signal, adding a visual confirmation layer for trend shifts.
Practical Applications
This oscillator is particularly effective in markets where the strength and direction of momentum are essential for identifying potential trend reversals or confirming ongoing trends. Traders can leverage the Adaptive Momentum Oscillator to:
Capture Adaptive Trends: The percentile-based thresholds adjust dynamically, ensuring that traders catch significant trends while filtering out market noise.
Avoid False Signals: By adapting to historical momentum levels, the oscillator reduces the risk of false breakouts or breakdowns, allowing for more reliable entries and exits.
Optimize Entries and Exits: With dynamically adjusting thresholds, the oscillator helps traders time their positions more effectively, minimizing the risk of getting caught in choppy or uncertain markets.
Advantages and Strategic Value
It offers a clear advantage over traditional static oscillators by continuously adjusting its sensitivity to market conditions. The adaptive percentile thresholds ensure that the indicator remains relevant, regardless of changes in volatility or market direction. This feature, combined with a customizable UI, makes the Adaptive Momentum Oscillator a powerful tool for traders looking to refine their momentum-based strategies with dynamic thresholds.
Summary and Usage Tips
The Adaptive Momentum Oscillator is a versatile tool for both trend-following and contrarian traders. Its dynamic nature allows for better alignment with current market conditions, while its user-friendly inputs offer extensive customization options. Traders are encouraged to experiment with the percentile-based threshold settings to find the optimal balance between signal sensitivity and noise reduction, particularly in fast-moving or volatile markets.
This indicator is best used in combination with other trend-confirmation tools, offering a dynamic layer to your trading system.
Thus following all of the key points here are some sample backtests on the 1D Chart
Disclaimer: Backtests are based off past results, and are not indicative of the future.
INDEX:BTCUSD
INDEX:ETHUSD
BINANCE:SOLUSD
Price-Volume w Trendline - Strategy [presentTrading]█ Introduction and How it is Different
The Price-Volume with Trendline Strategy is an innovative strategy that combines volume profile analysis, price-based Z-scores, and dynamic trendline filtering to identify optimal entry and exit points in the market. What sets this strategy apart is the integration of volume concentration (Point of Control or PoC) with dynamic volatility thresholds. Additionally, this strategy introduces a multi-step take profit (TP) mechanism that adjusts based on predefined levels, allowing traders to exit trades progressively while capitalizing on market momentum.
BTCUSD 6hr LS Performance
█ Strategy, How it Works: Detailed Explanation
The combination of multiple indicators and methodologies serves to create a more robust and reliable trading system. Each element is carefully chosen for its complementary role in providing accurate signals while minimizing false entries and exits. Here’s why the different components were chosen and how they work together:
- PoC and Z-Scores: The volume profile identifies key price areas, while the Z-score measures deviations from the mean. Together, they highlight points where the market is likely to react. For example, when the Z-score indicates an oversold condition near a PoC support level, it increases the probability of a reversal, providing a clear entry signal.
- Trendlines and Z-Scores: Trendlines serve as a secondary filter to ensure that price deviations identified by Z-scores align with broader market trends. This ensures that trades are only entered when the price has both deviated from its average and broken through a significant trendline level, reducing the likelihood of false signals.
- Multi-Step TP and Risk Management: Finally, the multi-step take profit logic works in tandem with the entry signals generated by the PoC, Z-scores, and trendlines. As the price moves in favor of the trade, profits are gradually locked in, ensuring the trader captures gains while still leaving room for further upside.
🔶 Point of Control (PoC) and Volume Profile Analysis
The PoC identifies the price level with the highest volume concentration within a specified lookback period. This price level represents where the most trading activity has occurred, often acting as a strong support or resistance. By breaking down the range into several rows (bins), the strategy identifies how much volume was traded at each price level.
🔶 Z-Score Calculation
The Z-score is a statistical metric that measures how far the current price is from its mean, expressed in terms of standard deviations. This is calculated both for price deviation and PoC-based deviation.
🔶 Trendline Breakout Filtering
The trendline filtering is a crucial aspect that refines entry signals by confirming trend continuation or reversals. It calculates trendlines based on pivot highs and lows using the selected method (e.g., ATR or standard deviation).
🔶 Multi-Step Take Profit
The multi-step take profit mechanism allows the strategy to take partial profits at several predefined levels. For example, when the price reaches 3%, 8%, 14%, or 21% above (or below) the entry price, it exits portions of the position. This is a useful technique for locking in profits as the market moves favorably.
Local
█ Usage
The Price-Volume with Trendline Strategy can be applied to various asset classes, including stocks, cryptocurrencies, and commodities. It is particularly effective in volatile markets where price deviations and volume concentrations signal potential reversals or trend continuations. By adjusting the settings for volatility and the lookback period, this strategy can be tailored to both short-term intraday trades and longer-term swing trades.
█ Default Settings
The default settings in the strategy play a vital role in shaping its performance.
- POC_lookbackLength (144): This defines the number of bars used to calculate the PoC. A longer lookback captures more data, leading to a more stable PoC, but may result in delayed signals. A shorter lookback increases responsiveness but may introduce noise.
- priceDeviationLength (200): This determines the period for calculating the standard deviation of price. A higher length smooths out the volatility, reducing the likelihood of false signals. Shorter lengths make the strategy more sensitive to sudden price movements.
- TL_length (14): Controls the swing detection period for trendline calculation. A shorter length will generate more frequent trendline breakouts, while a longer length captures only significant moves.
- Stop Loss and Take Profit: The strategy offers both fixed and SuperTrend-based stop losses. SuperTrend is adaptive to volatility, while fixed stop losses provide simpler risk control. The multi-step take profit ensures that profits are secured progressively, which can improve performance in trending markets by reducing the risk of full reversals.
Each of these settings can significantly affect the strategy’s risk-reward balance. For instance, increasing the stop loss level or the take profit percentages allows the strategy to stay in trades longer, potentially increasing profit per trade but at the cost of larger drawdowns. Conversely, tighter stops and smaller profit targets result in more frequent trades with lower average profit per trade.
Black-Scholes option price model & delta hedge strategyBlack-Scholes Option Pricing Model Strategy
The strategy is based on the Black-Scholes option pricing model and allows the calculation of option prices, various option metrics (the Greeks), and the creation of synthetic positions through delta hedging.
ATTENTION!
Trading derivative financial instruments involves high risks. The author of the strategy is not responsible for your financial results! The strategy is not self-sufficient for generating profit! It is created exclusively for constructing a synthetic derivative financial instrument. Also, there might be errors in the script, so use it at your own risk! I would appreciate it if you point out any mistakes in the comments! I would be even more grateful if you send the corrected code!
Application Scope
This strategy can be used for delta hedging short positions in sold options. For example, suppose you sold a call option on Bitcoin on the Deribit exchange with a strike price of $60,000 and an expiration date of September 27, 2024. Using this script, you can create a delta hedge to protect against the risk of loss in the option position if the price of Bitcoin rises.
Another example: Suppose you use staking of altcoins in your strategies, for which options are not available. By using this strategy, you can hedge the risk of a price drop (Put option). In this case, you won't lose money if the underlying asset price increases, unlike with a short futures position.
Another example: You received an airdrop, but your tokens will not be fully unlocked soon. Using this script, you can fully hedge your position and preserve their dollar value by the time the tokens are fully unlocked. And you won't fear the underlying asset price increasing, as the loss in the event of a price rise is limited to the option premium you will pay if you rebalance the portfolio.
Of course, this script can also be used for simple directional trading of momentum and mean reversion strategies!
Key Features and Input Parameters
1. Option settings:
- Style of option: "European vanilla", "Binary", "Asian geometric".
- Type of option: "Call" (bet on the rise) or "Put" (bet on the fall).
- Strike price: the option contract price.
- Expiration: the expiry date and time of the option contract.
2. Market statistic settings:
- Type of price source: open, high, low, close, hl2, hlc3, ohlc4, hlcc4 (using hl2, hlc3, ohlc4, hlcc4 allows smoothing the price in more volatile series).
- Risk-free return symbol: the risk-free rate for the market where the underlying asset is traded. For the cryptocurrency market, the return on the funding rate arbitrage strategy is accepted (a special function is written for its calculation based on the Premium Price).
- Volatility calculation model: realized (standard deviation over a moving period), implied (e.g., DVOL or VIX), or custom (you can specify a specific number in the field below). For the cryptocurrency market, the calculation of implied volatility is implemented based on the product of the realized volatility ratio of the considered asset and Bitcoin to the Bitcoin implied volatility index.
- User implied volatility: fixed implied volatility (used if "Custom" is selected in the "Volatility Calculation Method").
3. Display settings:
- Choose metric: what to display on the indicator scale – the price of the underlying asset, the option price, volatility, or Greeks (all are available).
- Measure: bps (basis points), percent. This parameter allows choosing the unit of measurement for the displayed metric (for all except the Greeks).
4. Trading settings:
- Hedge model: None (do not trade, default), Simple (just open a position for the full volume when the strike price is crossed), Synthetic option (creating a synthetic option based on the Black-Scholes model).
- Position side: Long, Short.
- Position size: the number of units of the underlying asset needed to create the option.
- Strategy start time: the moment in time after which the strategy will start working to create a synthetic option.
- Delta hedge interval: the interval in minutes for rebalancing the portfolio. For example, a value of 5 corresponds to rebalancing the portfolio every 5 minutes.
Post scriptum
My strategy based on the SegaRKO model. Many thanks to the author! Unfortunately, I don't have enough reputation points to include a link to the author in the description. You can find the original model via the link in the code, as well as through the search indicators on the charts by entering the name: "Black-Scholes Option Pricing Model". I have significantly improved the model: the calculation of volatility, risk-free rate and time value of the option have been reworked. The code performance has also been significantly optimized. And the most significant change is the execution, with which you can now trade using this script.
TradeTracker v33 - Interactive Journal [AR33_]TradeTracker v33 - Interactive Journal is a unique tool designed to enhance your trading experience by integrating an interactive journal directly onto your charts. Unlike traditional trading journals that require manual entries outside of TradingView, this script allows traders to document, track, and review their trades in real-time, right where the action happens.
What sets TradeTracker v33 apart from existing tools is its seamless blend of note-taking, task management, and performance tracking—all within a single, intuitive interface. With features like customizable checklists, due dates, and color-coded status indicators, this script provides a powerful and practical solution for traders who want to stay organized and disciplined.
2. Description
. TradeTracker v33 - Interactive Journal is designed to keep traders on track by allowing them to record trade-related notes, set tasks, and mark progress directly on their charts.
Here’s how it works:
• Purpose: The script serves as an all-in-one journal and task manager, helping traders document their trading strategies, track ongoing tasks, and review completed actions. It’s particularly useful for maintaining discipline and ensuring that every trade is executed according to a well-thought-out plan.
• How It Works:
• Interactive Notes and Tasks: Users can create and manage notes and tasks directly on their charts. Each note can be customized with a title, description, due date, and completion status.
• Status Indicators: Tasks are color-coded based on their status—green for completed, red for overdue, and default colors for pending tasks—allowing traders to quickly assess their progress.
• Dynamic Display: Notes are displayed in a clean, organized table on the chart, making it easy to review multiple tasks without cluttering the trading interface.
• Usage:
• Adding Notes: Simply fill in the note title, content, and optional due date within the script’s input settings, and the note will appear on your chart.
• Tracking Progress: Mark tasks as completed with a simple toggle, and the script will update their status in real-time.
• Customizing Your Workflow: Adjust the position, size, and visibility of notes to fit your trading style, ensuring that your journal supports rather than distracts from your trading activities.
3. Chart Presentation
To provide a clear and focused user experience, TradeTracker v33 - Interactive Journal is designed to be the sole feature on your chart when published. This ensures that users can easily identify and interact with their notes and tasks without any unnecessary distractions.
• Clean and Focused Display: The chart will exclusively display the interactive journal, showcasing how tasks and notes appear and update in real-time as you manage them.
• Useful Annotations: Annotations such as checkboxes and status indicators are clearly explained within the script’s description and are vital to understanding the functionality of the tool.
• Minimal Distractions: Only elements directly related to the script’s functionality are included on the chart, ensuring that users can easily follow along and implement the script in their own trading setup.
Enhanced Local Polynomial Regression [Yosiet]Local Polynomial Regression (LPR) is an advanced statistical method that offers a flexible approach to estimating the underlying trend in financial time series data.
The Mathematical Explanation
The core idea of LPR is to fit a polynomial of degree p at each point x using weighted least squares. The weight of each data point decreases with its distance from x, controlled by a kernel function and a bandwidth parameter.
The general form of the local polynomial estimator is:
β̂(x) = argmin Σ K((Xi - x) / h) (Yi - β0 - β1(Xi - x) - ... - βp(Xi - x)^p)^2
Where:
β̂(x) is the vector of estimated coefficients
K is the kernel function
h is the bandwidth
Xi and Yi are the predictor and response variables
p is the degree of the polynomial
Our implementation uses the Epanechnikov kernel:
K(u) = 3/4 * (1 - u^2) for |u| ≤ 1, 0 otherwise
The Implementation
This script implements LPR for the easier way to interpret its values with the following key components:
Input Parameters: Can adjust the lookback period, bandwidth, and polynomial degree.
Kernel Function: The Epanechnikov kernel is used for weighting.
LPR Function: Implements the core algorithm using matrix operations.
Signal Generation: Generates buy/sell signals based on crossovers of smoothed price and LPR results.
How to Use
Apply the indicator to your chart in TradingView.
Adjust the input parameters:
Lookback Period: Controls how many past bars are considered.
Bandwidth: Affects the smoothness of the regression line.
Polynomial Degree: Determines the complexity of the local fit.
Signal Smoothing Length: Adjusts the responsiveness of buy/sell signals.
Monitor buy/sell signals for potential trade entries.
Limitations
Sensitivity to Parameters: The choice of bandwidth and polynomial degree significantly impacts the results.
Lag: Like all trend-following indicators, LPR may lag behind rapid price movements.
Edge Effects: The indicator may be less reliable at the edges of the data (recent bars).
Recommendations
Parameter Optimization: Experiment with different lookback periods, bandwidths, and polynomial degrees to find the best fit for your trading style and timeframe.
Combine with Other Indicators: Use LPR in conjunction with momentum oscillators or volume indicators for confirmation.
Multiple Timeframes: Apply LPR on different timeframes to gain a more comprehensive view of the trend.
Avoid Overfitting: Be cautious of using high polynomial degrees, as they may lead to overfitting on historical data.
Consider Market Conditions: LPR works best in trending markets; be aware of its limitations in ranging or highly volatile conditions.
Backtest Thoroughly: Always backtest strategies based on LPR across different market conditions before live trading.
Conclusion
Local Polynomial Regression offers a sophisticated approach to trend analysis in financial markets. By providing a flexible, adaptive trend line, it can help traders identify potential entry and exit points with greater precision than traditional moving averages. However, like all technical indicators, it should be used as part of a comprehensive trading strategy that includes proper risk management and consideration of fundamental factors.
if you have an strategy or idea and need to make it real through an indicator or trading bot, you can DM or comment