Custom ATR with Paranormal Bar FilterCustom ATR with Paranormal Bar Filter
Description:
This indicator calculates a custom ATR (Average True Range) by filtering out bars with unusually large or small price ranges. It helps provide a more accurate measure of market volatility by ignoring outliers.
How it works:
True Range Calculation:
The price range for each bar is calculated.
Bars with ranges much larger or smaller than typical are excluded.
Filtered ATR:
The ATR is calculated using only the bars that pass the filter.
Current Bar Progress:
Measures how much the current bar has moved compared to the filtered ATR, based on the difference between its opening and closing prices.
Display:
A line represents the filtered ATR.
A table shows the filtered ATR, the current bar's range, and its progress relative to the ATR.
Input Settings:
ATR Period: Number of bars used to calculate the ATR.
Filter Window: Number of recent bars used to determine the typical range.
Filter Threshold: Sensitivity of the filter. A higher value allows more bars to pass.
How to Use:
Monitor Volatility:
Use the filtered ATR to understand market volatility while ignoring unusual price movements.
Track Current Bar Progress:
See how much of the ATR the current bar has completed.
Adjust Filter Settings:
Fine-tune the filter to match your trading timeframe and strategy.
This indicator is designed for traders who want to track market volatility without being misled by extreme outlier bars.
Volatilität
Conditional Volatility Explosion/ContractionThis indicator identifies zones of potential volatility expansion by analyzing the contraction and expansion of volatility bands, which are conditioned by the relationship of the price to moving averages
Volatility Squeeze: When the bands contract, it indicates a potential buildup in market tension, often preceding a significant price movement.
Volatility Expansion: When the bands expand, it signals the release of built-up tension, often resulting in increased volatility.
Trend Confirmation: The bands are active only when the price aligns with the moving average condition, helping to filter out less relevant signals during non-trending markets.
Upper Band: Displays as a red band when the volatility condition is met.
Represents the upper boundary of potential price action during high volatility.
Lower Band: Displays as a green band when the volatility condition is met.
Represents the lower boundary of potential price action during high volatility.
Fill Areas: The areas between the EMA and the bands are filled with transparent colors:
Red for the upper fill.
Green for the lower fill.
These highlights help visualize zones of potential volatility explosion.
Quick scan for signal🙏🏻 Hey TV, this is QSFS, following:
^^ Quick scan for drift (QSFD)
^^ Quick scan for cycles (QSFC)
As mentioned before, ML trading is all about spotting any kind of non-randomness, and this metric (along with 2 previously posted) gonna help ya'll do it fast. This one will show you whether your time series possibly exhibits mean-reverting / consistent / noisy behavior, that can be later confirmed or denied by more sophisticated tools. This metric is O(n) in windowed mode and O(1) if calculated incrementally on each data update, so you can scan Ks of datasets w/o worrying about melting da ice.
^^ windowed mode
Now the post will be divided into several sections, and a couple of things I guess you’ve never seen or thought about in your life:
1) About Efficiency Ratios posted there on TV;
Some of you might say this is the Efficiency Ratio you’ve seen in Perry's book. Firstly, I can assure you that neither me nor Perry, just as X amount of quants all over the world and who knows who else, would say smth like, "I invented it," lol. This is just a thing you R&D when you need it. Secondly, I invite you (and mods & admin as well) to take a lil glimpse at the following screenshot:
^^ not cool...
So basically, all the Efficiency Ratios that were copypasted to our platform suffer the same bug: dudes don’t know how indexing works in Pine Script. I mean, it’s ok, I been doing the same mistakes as well, but loxx, cmon bro, you... If you guys ever read it, the lines 20 and 22 in da code are dedicated to you xD
2) About the metric;
This supports both moving window mode when Length > 0 and all-data expanding window mode when Length < 1, calculating incrementally from the very first data point in the series: O(n) on history, O(1) on live updates.
Now, why do I SQRT transform the result? This is a natural action since the metric (being a ratio in essence) is bounded between 0 and 1, so it can be modeled with a beta distribution. When you SQRT transform it, it still stays beta (think what happens when you apply a square root to 0.01 or 0.99), but it becomes symmetric around its typical value and starts to follow a bell-shaped curve. This can be easily checked with a normality test or by applying a set of percentiles and seeing the distances between them are almost equal.
Then I noticed that on different moving window sizes, the typical value of the metric seems to slide: higher window sizes lead to lower typical values across the moving windows. Turned out this can be modeled the same way confidence intervals are made. Lines 34 and 35 explain it all, I guess. You can see smth alike on an autocorrelogram. These two match the mean & mean + 1 stdev applied to the metric. This way, we’ve just magically received data to estimate alpha and beta parameters of the beta distribution using the method of moments. Having alpha and beta, we can now estimate everything further. Btw, there’s an alternative parameterization for beta distributions based on data length.
Now what you’ll see next is... u guys actually have no idea how deep and unrealistically minimalistic the underlying math principles are here.
I’m sure I’m not the only one in the universe who figured it out, but the thing is, it’s nowhere online or offline. By calculating higher-order moments & combining them, you can find natural adaptive thresholds that can later be used for anomaly detection/control applications for any data. No hardcoded thresholds, purely data-driven. Imma come back to this in one of the next drops, but the truest ones can already see it in this code. This way we get dem thresholds.
Your main thresholds are: basis, upper, and lower deviations. You can follow the common logic I’ve described in my previous scripts on how to use them. You just register an event when the metric goes higher/lower than a certain threshold based on what you’re looking for. Then you take the time series and confirm a certain behavior you were looking for by using an appropriate stat test. Or just run a certain strategy.
To avoid numerous triggers when the metric jitters around a threshold, you can follow this logic: forget about one threshold if touched, until another threshold is touched.
In general, when the metric gets higher than certain thresholds, like upper deviation, it means the signal is stronger than noise. You confirm it with a more sophisticated tool & run momentum strategies if drift is in place, or volatility strategies if there’s no drift in place. Otherwise, you confirm & run ~ mean-reverting strategies, regardless of whether there’s drift or not. Just don’t operate against the trend—hedge otherwise.
3) Flex;
Extension and limit thresholds based on distribution moments gonna be discussed properly later, but now you can see this:
^^ magic
Look at the thresholds—adaptive and dynamic. Do you see any optimizations? No ML, no DL, closed-form solution, but how? Just a formula based on a couple of variables? Maybe it’s just how the Universe works, but how can you know if you don’t understand how fundamentally numbers 3 and 15 are related to the normal distribution? Hm, why do they always say 3 sigmas but can’t say why? Maybe you can be different and say why?
This is the primordial power of statistical modeling.
4) Thanks;
I really wanna dedicate this to Charlotte de Witte & Marion Di Napoli, and their new track "Sanctum." It really gets you connected to the Source—I had it in my soul when I was doing all this ∞
RS Cycles [QuantVue]The RS Cycles indicator is a technical analysis tool that expands upon traditional relative strength (RS) by incorporating Beta-based adjustments to provide deeper insights into a stock's performance relative to a benchmark index. It identifies and visualizes positive and negative performance cycles, helping traders analyze trends and make informed decisions.
Key Concepts:
Traditional Relative Strength (RS):
Definition: A popular method to compare the performance of a stock against a benchmark index (e.g., S&P 500).
Calculation: The traditional RS line is derived as the ratio of the stock's closing price to the benchmark's closing price.
RS=Stock Price/Benchmark Price
Usage: This straightforward comparison helps traders spot periods of outperformance or underperformance relative to the market or a specific sector.
Beta-Adjusted Relative Strength (Beta RS):
Concept: Traditional RS assumes equal volatility between the stock and benchmark, but Beta RS accounts for the stock's sensitivity to market movements.
Calculation:
Beta measures the stock's return relative to the benchmark's return, adjusted by their respective volatilities.
Alpha is then computed to reflect the stock's performance above or below what Beta predicts:
Alpha=Stock Return−(Benchmark Return×β)
Significance: Beta RS highlights whether a stock outperforms the benchmark beyond what its Beta would suggest, providing a more nuanced view of relative strength.
RS Cycles:
The indicator identifies positive cycles when conditions suggest sustained outperformance:
Short-term EMA (3) > Mid-term EMA (10) > Long-term EMA (50).
The EMAs are rising, indicating positive momentum.
RS line shows upward movement over a 3-period window.
EMA(21) > 0 confirms a broader uptrend.
Negative cycles are marked when the opposite conditions are met:
Short-term EMA (3) < Mid-term EMA (10) < Long-term EMA (50).
The EMAs are falling, indicating negative momentum.
RS line shows downward movement over a 3-period window.
EMA(21) < 0 confirms a broader downtrend.
This indicator combines the simplicity of traditional RS with the analytical depth of Beta RS, making highlighting true relative strength and weakness cycles.
Adaptive bollinger bands cloud v1 trend & trade signalsadaptive bollinger bands cloud:
the script extends the concept of bollinger bands by creating a "cloud" between the upper and lower bands. this cloud visually represents market conditions, with its color dynamically adjusting based on trend strength and volatility.
the gradient fill between the bands changes according to the deviation of the price from its basis, offering a visual cue for trend momentum.
trend detection logic:
a trend variable determines whether the price is in a bullish, bearish, or neutral state. if the price is above the upper band and the basis, the trend is marked bullish. if it's below the lower band and the basis, the trend is bearish. otherwise, it's neutral.
this trend logic is further enhanced with visual markers like arrows to indicate potential trend reversals.
extended take-profit bands:
additional upper and lower bands are calculated using a higher multiplier. these extended bands help identify potential take-profit levels, signaling when the price may have reached an overextended state.
gradient calculation:
the script computes a gradient based on the deviation of the price from its basis and normalizes it over a lookback period. this normalized gradient is smoothed to reflect volatility intensity and used to color the cloud dynamically.
signal generation:
buy and sell signals are generated based on crossovers of the trend variable. for instance, when the trend shifts from negative to positive, it signals a bullish opportunity. conversely, a shift from positive to negative indicates bearish conditions.
take-profit markers ("x") are plotted when the price crosses the extended bands, suggesting potential exit points.
trade entry tracking:
the script includes a table to display real-time entry signals and prices for long (buy) or short (sell) trades. this feature helps traders keep track of signals without needing to reference the chart visually.
customizable inputs:
users can adjust the bb period, multiplier, and colors to suit their trading preferences. this flexibility allows for tuning the indicator based on different market conditions or asset classes.
overall, the indicator blends traditional bollinger bands with innovative visualization, trend identification, and trading signals to enhance decision-making.
how to use this indicator
trend detection:
watch for arrows indicating trend shifts:
an upward arrow (green) signals a bullish trend; consider buying or entering a long position.
a downward arrow (red) signals a bearish trend; consider selling or entering a short position.
use the gradient-colored cloud to assess trend strength:
bright and strong colors indicate significant momentum.
fading colors suggest weakening trends or consolidation.
entry signals:
refer to the table in the top-right corner of the chart for real-time buy or sell entry signals.
when a "buy" signal is displayed with the price, it suggests a potential entry point for a long trade.
when a "sell" signal is displayed, consider shorting or exiting long positions.
take-profit signals:
look for the "x" markers near the extended bands (upper1 and lower1):
an "x" above the price suggests taking profit on long positions.
an "x" below the price suggests taking profit on short positions.
background gradient analysis:
observe the dynamic background color:
a strong purple gradient indicates significant price movement or volatility.
a lighter gradient suggests reduced momentum, signaling caution or a potential reversal.
alerts for automation:
set alerts using the predefined conditions:
bullish trend start, bearish trend start, and take-profit levels can be used to automate notifications for trade actions.
why to use this indicator
enhanced decision-making:
the adaptive cloud and gradient provide visual insights into trend strength and volatility, allowing traders to assess market conditions at a glance.
precise signals:
the indicator uses crossover logic and extended bollinger bands to generate clear buy, sell, and take-profit signals, reducing guesswork.
trend confirmation:
combining the bollinger bands with the trend variable ensures that traders only act on confirmed market trends rather than noise.
dynamic volatility assessment:
the normalized gradient calculation highlights periods of high or low volatility, helping traders adjust their strategies accordingly.
customizable settings:
adjustable parameters (period, multiplier, colors) allow the indicator to fit various markets, timeframes, and trading styles.
all-in-one tool:
integrates trend detection, entry signals, and take-profit levels into a single indicator, minimizing the need for multiple tools.
this indicator is especially useful for traders seeking a balance between simplicity and precision, whether scalping, day trading, or swing trading. it not only identifies trends but also highlights actionable entry and exit points, making it a versatile addition to any trading strategy.
IV Rank/Percentile with Williams VIX FixDisplay IV Rank / IV Percentile
This indicator is based on William's VixFix, which replicates the VIX—a measure of the implied volatility of the S&P 500 Index (SPX). The key advantage of the VixFix is that it can be applied to any security, not just the SPX.
IV Rank is calculated by identifying the highest and lowest implied volatility (IV) values over a selected number of past periods. It then determines where the current IV lies as a percentage between these two extremes. For example, if over the past five periods the highest IV was 30%, the lowest was 10%, and the current IV is 20%, the IV Rank would be 50%, since 20% is halfway between 10% and 30%.
IV Percentile, on the other hand, considers all past IV values—not just the highest and lowest—and calculates the percentage of these values that are below the current IV. For instance, if the past five IV values were 30%, 10%, 11%, 15%, and 17%, and the current IV is 20%, the IV Rank remains at 50%. However, the IV Percentile is 80% because 4 out of the 5 past values (80%) are below the current IV of 20%.
Real-Time Custom Candle Range Color Indicator
The script allows the user to input a custom range value (default set to 100 points) through the userDefinedRange variable. This value determines the minimum range required for a candle to change color.
Calculating Candle Range:
The script calculates the range of each candle by subtracting the low from the high price.
Determining Bullish or Bearish Candles:
It checks whether the close price is higher than the open price to determine if a candle is bullish (isBullish variable).
Coloring Candles:
Based on the custom range input, the script changes the color of the candles:
If the candle's range is greater than or equal to the custom range and it is bullish, the candle color is set to blue (bullishColor).
If the range condition is met and the candle is bearish, the color is set to orange (bearishColor).
If the range condition is not met, the color is set to na (not applicable).
Plotting Colored Candles:
The plotcandle function is used to plot candles with colors based on the custom range and bullish/bearish conditions. The candles will have a higher z-order to be displayed in front of default candles.
Displaying High and Low Price Points:
Triangular shapes are plotted at the high and low price levels using the plotshape function, with colors representing bullish (blue) and bearish (orange) conditions.
In trading, this indicator can help traders visually identify candles that meet a specific range criteria, potentially signaling strength or weakness in price movements. By customizing the range parameter, traders can adapt the indicator to different market conditions and trading strategies. It can be used in conjunction with other technical analysis tools to make informed trading decisions based on candlestick patterns and price movements.
Adaptive AI Predictor (v2) by OberlunarAdaptive AI Predictor by Oberlunar
This script is designed to dynamically adapt to market changes, leveraging a neural network-inspired model to identify reliable trading signals. It analyzes price variations, processes patterns in the market, and provides clear buy and sell signals based on dynamic force calculations.
The script goes beyond simple indicators by incorporating adaptive learning principles. It tracks the success of its signals over time, calculating both the average and median forces behind winning trades. These insights allow the script to continuously refine its performance, ensuring it remains responsive to evolving market conditions.
Clear signals are displayed on the chart, showing the strength of the signal and its median historical success.
Configuration Parameters
Number of Nodes: : This parameter controls the number of nodes through which the data is processed. A higher number of nodes can improve the model’s ability to represent complex dynamics, but may also increase bias and a low capacity of generalization.
Input Scaling: Determines how much the input signal (percentage price change) is amplified before being processed. If the value is too low, the system may not react sufficiently to price changes; if too high, it might become too sensitive to market noise.
Scaling: Controls the strength of interactions between internal nodes. A higher value makes interactions between the neurons (nodes) stronger, but might also lead to instability in the signals.
Leak Rate: This parameter determines how fast information is "forgotten" within the system. A higher value means the model "forgets" previous information more quickly, making it more responsive to recent changes.
Sparsity: Controls the density of connections between internal nodes. A higher value increases the likelihood that a connection between nodes is "active." This affects the system’s ability to model complex dynamics and can also influence computational speed.
Signal Threshold: Sets the limit beyond which the predicted signal is considered significant. A value too low could generate too frequent and noisy signals, while a value too high might reduce useful signals.
History Length: Determines how much historical data is considered for training the system. A higher value uses more historical data but could slow down computations.
Learning Rate: Controls the speed at which the system updates its internal weights. A value too high might cause oscillations in the results, while one too low might slow down the adaptation process.
Exponential Decay Factor: Defines how quickly the weights adapt based on errors. A higher value reduces the impact of older weights, allowing the model to adapt faster to recent changes.
How It Works
Input Signal: The system observes the percentage price change between two consecutive bars (current close vs. previous close).
State Update: The states of the nodes are updated based on the input signal and internal interactions between the neurons. The update is influenced by the leak rate, which determines how fast nodes "forget" previous information.
Weight Training: Weights are trained to minimize the error between the system’s prediction and the observed price change. The system uses exponential regression to update the weights efficiently.
Signal Generation: Buy (BUY) and sell (SELL) signals are generated based on an analysis of the overall values of the nodes' states. If the overall strength (average of the nodes' states) exceeds a certain threshold, a buy signal is generated. If it's lower than a negative threshold, a sell signal is triggered.
Visualization and Signals
Signals on the Chart: Buy and sell signals are displayed on the chart with specific labels, indicating the signal's strength and median successful strength previously adopted . The strength is based on the distance from the threshold. The stronger the signal, the more intense the label color.
Debug Table: A debug table shows details about the input weights, node states, and the success of buy/sell signals, allowing you to monitor the system's behavior in real-time.
Simple Capital Management: The system calculates the position size based on available capital and updates the current capital after each trade. The profit or loss is displayed as a percentage of the initial capital.
How to Use It
Initial Configuration: Customize the configuration parameters based on your trading strategy and style. If you’re a more conservative trader, you might prefer higher thresholds and lower scaling.
Monitor Signals: Follow the buy and sell signals generated on the chart. Each signal is accompanied by its strength (percentage), which will help you decide how aggressively to position.
Very simple Position Management: When a buy signal is emitted, you can open a buy position, and when a sell signal is emitted, you can close the position. The system automatically calculates the profit or loss for each trade.
Adapting to Market Conditions: Adjust the parameters based on market volatility and your risk tolerance. If the market is highly volatile, you might want to increase sensitivity to signals or reduce the number of nodes for faster responsiveness.
With this system, you can leverage dynamic predictive signals based on a combination of historical data and continuous adaptation, improving your trading decisions.
To obtain good results remember to fine-tune by a model reparametrization.
Simplified Momentum ScoreIndicator Name: Simplified Momentum Score
Description:
The Simplified Momentum Score indicator calculates the normalized price momentum of an asset over a user-defined period (e.g., 30 days). It provides a single actionable score between 0 and 1, making it easy to compare the relative strength of different tokens or assets:
1: Strongest momentum (best performer).
0: Weakest momentum (worst performer).
How to Use:
Apply this indicator to any chart in TradingView.
Use the normalized score to rank tokens or assets:
Closer to 1: Indicates strong recent price performance.
Closer to 0: Indicates weak recent price performance.
Customize the momentum period to match your trading strategy.
This tool is ideal for quick comparative analysis of multiple tokens to identify top-performing assets. Keep it simple, actionable, and effective! 🚀
Relative Momentum StrengthThe Relative Momentum Strength (RMS) indicator is designed to help traders and investors identify tokens with the strongest momentum over two customizable timeframes. It calculates and plots the percentage price change over 30-day and 90-day periods (or user-defined periods) to evaluate a token's relative performance.
30-Day Momentum (Green Line): Short-term price momentum, highlighting recent trends and movements.
90-Day Momentum (Blue Line): Medium-term price momentum, providing insights into broader trends.
This tool is ideal for comparing multiple tokens or assets to identify those showing consistent strength or weakness. Use it to spot outperformers and potential reversals in a competitive universe of assets.
How to Use:
Apply this indicator to your TradingView chart for any token or asset.
Look for tokens with consistently high positive momentum for potential strength.
Use the plotted values to compare relative performance across your watchlist.
Customization:
Adjust the momentum periods to suit your trading strategy.
Overlay it with other indicators like RSI or volume for deeper analysis.
Candlestick Strength and Volatility ReadoutDisplays a readout on the top right corner of the screen displaying a two basic calculations (volatility and strength; i.e. candlestick size and how close to the highs or lows it closed) for more convenient candlestick (price action) analysis.
Due to restrictions with Pine Script (or my knowledge thereof) only the current and previous candlestick data is shown, rather than the one currently hovered over.
The data is derived via two simple calculations; volatility being division between the range of the candlestick's high and low by the ATR; 'strength' (what I like to call it) being the range of the body by the range of the open to high or low, depending on the facing direction (positive or negative candlestick). These are expressed as percentages and will turn green depending on the set threshold.
Using this, one can effectively automate calculations you'd have to do by hand otherwise. I personally use these as entry filters in my trading, so it helps to not have to measure, remeasure, and divide before each potential entry.
Settings are implemented to change certain variables to your liking.
Contraction & Expansion Multi-Screener █ Overview:
The Contraction & Expansion Multi-Screener analyzes market volatility across many symbols. It provides insights into whether a market is contracting or expanding in volatility. With using a range of statistical models for modeling realized volatility, the script calculates, ranks, and monitors the degree of contraction or expansions in market volatility. The objective is to provide actionable insights into the current market phases by using historical data to model current volatility conditions.
This indicator accomplishes this by aggregating a variety of volatility measures, computing ranks, and applying threshold-based methods to identify transitions in market behavior. Volatility itself helps you understand if the market is moving a lot. High volatility or volatility that is increasing over time, means that the price is moving a lot. Volatility also mean reverts so if its extremely low, you can eventually expect it to return to its expected value, meaning there will be bigger price moves, and vice versa.
█ Features of the Indicator
This indicator allows the user to select up to 14 different symbols and retrieve their price data. There is five different types of volatility models that you can choose from in the settings of this indicator for how to use the screener.
Volatility Settings:
Standard Deviation
Relative Standard Deviation
Mean Absolute Deviation
Exponentially Weighted Moving Average (EWMA)
Average True Range (ATR)
Standard Deviation, Mean Absolute Deviation, and EWMA use returns to model the volatility, meanwhile Relative Standard Deviation uses price instead due to its geometric properties, and Average True Range for capturing the absolute movement in price. In this indicator the volatility is ranked, so if the volatility is at 0 or near 0 then it is contracting and the volatility is low. If the volatility is near 100 or at 100 then the volatility is at its maximum.
For traders that use the Forex Master Pattern Indicator 2 and want to use this indicator for that indicator, it is recommended to set your volatility type to Relative Standard Deviation.
Users can also modify the location of the screener to be on the top left, top right, bottom left, or bottom right. You also can disable sections of the screener and show a smaller list if you want to.
The Contraction & Expansion Screener shows you the following information:
Confirmation of whether or not there is a contraction or expansion
Percentage Rank of the volatility
Volatility MA direction: This screener uses moving averages on the volatility to determine if its increasing over time or decreasing over time.
MadTrend [InvestorUnknown]The MadTrend indicator is an experimental tool that combines the Median and Median Absolute Deviation (MAD) to generate signals, much like the popular Supertrend indicator. In addition to identifying Long and Short positions, MadTrend introduces RISK-ON and RISK-OFF states for each trade direction, providing traders with nuanced insights into market conditions.
Core Concepts
Median and Median Absolute Deviation (MAD)
Median: The middle value in a sorted list of numbers, offering a robust measure of central tendency less affected by outliers.
Median Absolute Deviation (MAD): Measures the average distance between each data point and the median, providing a robust estimation of volatility.
Supertrend-like Functionality
MadTrend utilizes the median and MAD in a manner similar to how Supertrend uses averages and volatility measures to determine trend direction and potential reversal points.
RISK-ON and RISK-OFF States
RISK-ON: Indicates favorable conditions for entering or holding a position in the current trend direction.
RISK-OFF: Suggests caution, signaling RISK-ON end and potential trend weakening or reversal.
Calculating MAD
The mad function calculates the median of the absolute deviations from the median, providing a robust measure of volatility.
// Function to calculate the Median Absolute Deviation (MAD)
mad(series float src, simple int length) =>
med = ta.median(src, length) // Calculate median
abs_deviations = math.abs(src - med) // Calculate absolute deviations from median
ta.median(abs_deviations, length) // Return the median of the absolute deviations
MADTrend Function
The MADTrend function calculates the median and MAD-based upper (med_p) and lower (med_m) bands. It determines the trend direction based on price crossing these bands.
MADTrend(series float src, simple int length, simple float mad_mult) =>
// Calculate MAD (volatility measure)
mad_value = mad(close, length)
// Calculate the MAD-based moving average by scaling the price data with MAD
median = ta.median(close, length)
med_p = median + (mad_value * mad_mult)
med_m = median - (mad_value * mad_mult)
var direction = 0
if ta.crossover(src, med_p)
direction := 1
else if ta.crossunder(src, med_m)
direction := -1
Trend Direction and Signals
Long Position (direction = 1): When the price crosses above the upper MAD band (med_p).
Short Position (direction = -1): When the price crosses below the lower MAD band (med_m).
RISK-ON: When the price moves further in the direction of the trend (beyond median +- MAD) after the initial signal.
RISK-OFF: When the price retraces towards the median, signaling potential weakening of the trend.
RISK-ON and RISK-OFF States
RISK-ON LONG: Price moves above the upper band after a Long signal, indicating strengthening bullish momentum.
RISK-OFF LONG: Price falls back below the upper band, suggesting potential weakness in the bullish trend.
RISK-ON SHORT: Price moves below the lower band after a Short signal, indicating strengthening bearish momentum.
RISK-OFF SHORT: Price rises back above the lower band, suggesting potential weakness in the bearish trend.
Picture below show example RISK-ON periods which can be identified by “cloud”
Note: Highlighted areas on the chart indicating RISK-ON and RISK-OFF periods for both Long and Short positions.
Implementation Details
Inputs and Parameters:
Source (input_src): The price data used for calculations (e.g., close, open, high, low).
Median Length (length): The number of periods over which the median and MAD are calculated.
MAD Multiplier (mad_mult): Determines the distance of the upper and lower bands from the median.
Calculations:
Median and MAD are recalculated each period based on the specified length.
Upper (med_p) and Lower (med_m) Bands are computed by adding and subtracting the scaled MAD from the median.
Visual representation of the indicator on a price chart:
Backtesting and Performance Metrics
The MadTrend indicator includes a Backtesting Mode with a performance metrics table to evaluate its effectiveness compared to a simple buy-and-hold strategy.
Equity Calculation:
Calculates the equity curve based on the signals generated by the indicator.
Performance Metrics:
Metrics such as Mean Returns, Standard Deviation, Sharpe Ratio, Sortino Ratio, and Omega Ratio are computed.
The metrics are displayed in a table for both the strategy and the buy-and-hold approach.
Note: Due to the use of labels and plot shapes, automatic chart scaling may not function ideally in Backtest Mode.
Alerts and Notifications
MadTrend provides alert conditions to notify traders of significant events:
Trend Change Alerts
RISK-ON and RISK-OFF Alerts - Provides real-time notifications about the RISK-ON and RISK-OFF states for proactive trade management.
Customization and Calibration
Default Settings: The provided default settings are experimental and not optimized. They serve as a starting point for users.
Parameter Adjustment: Traders are encouraged to calibrate the indicator's parameters (e.g., length, mad_mult) to suit their specific trading style and the characteristics of the asset being analyzed.
Source Input: The indicator allows for different price inputs (open, high, low, close, etc.), offering flexibility in how the median and MAD are calculated.
Important Notes
Market Conditions: The effectiveness of the MadTrend indicator can vary across different market conditions. Regular calibration is recommended.
Backtest Limitations: Backtesting results are historical and do not guarantee future performance.
Risk Management: Always apply sound risk management practices when using any trading indicator.
Bollinger Bands Adjusted for VolatilityDescription:
The Bollinger Bands Adjusted for Volatility is an advanced technical indicator designed to combine the precision of smoothed Bollinger Bands with the adaptability of linear regression for volatility analysis. This tool offers traders a dynamic way to visualize market trends while accounting for recent price movements and fluctuations in volatility.
Core Functionality:
Exponential Moving Average (EMA):
The indicator begins by calculating an Exponential Moving Average (EMA) over a user-defined period. This serves as the foundational trendline, smoothing out short-term fluctuations to highlight the overall trend.
Linear Regression Smoothing:
To account for price trends with greater precision, a Linear Regression line is calculated over a specified period.
The linear regression output is further smoothed using an EMA, ensuring a responsive yet stable representation of the price trend.
Standard Deviation and Volatility:
The indicator computes the standard deviation of the closing prices over the EMA period, dynamically capturing market volatility.
This measure of volatility is then integrated into the calculation of the upper and lower bands.
Smoothed Bollinger Bands:
The upper and lower bands are constructed by adjusting the smoothed linear regression line with the standard deviation, scaled by a user-defined multiplier.
This approach adapts to changing market conditions, offering a more nuanced view compared to traditional Bollinger Bands.
Visual Components:
EMA Line (Blue): A stable trendline that reflects the underlying market direction.
Upper Band (Red): Represents the upper boundary, adjusted for volatility and smoothed by linear regression.
Lower Band (Green): Marks the lower boundary, providing a measure of support based on volatility.
Band Fill (Shaded Area): A dynamic fill between the upper and lower bands for enhanced visualization of the price range.
Advanced Concepts:
Volatility-Responsive Bands:
By integrating the standard deviation into the bands and smoothing with linear regression, the indicator reacts effectively to market dynamics, widening during high volatility and contracting during low volatility.
Trend Adaptation:
The smoothed linear regression ensures that the bands align closely with the prevailing market trend, reducing noise and improving accuracy.
Applications:
Trend Identification:
Use the EMA and the central smoothed linear regression to identify the primary trend.
Observe price interaction with the upper and lower bands for potential trend continuations or reversals.
Volatility-Based Strategies:
Monitor band expansions and contractions to gauge shifts in market volatility.
Trade breakouts or reversals when the price breaches the bands under extreme conditions.
Support and Resistance:
The upper and lower bands act as dynamic support and resistance levels, adapting to the current market environment.
Disclaimer:
This indicator is provided for informational and educational purposes only. It does not constitute financial advice. Users should exercise caution and perform their own analysis when making trading decisions.
Optimus Trader Consolidation V.1 Indicator Description: "Optimus Trader Consolidation V.1"
This Pine Script indicator is designed to assist traders by identifying key market conditions, including **trend direction**, **volume dynamics**, **liquidity zones**, and **consolidation periods**, alongside candlestick patterns like **Pin Bars** and **Inside Bars**. It provides clear buy and sell signals based on a confluence of these factors. Here’s a detailed breakdown of its functionality:
---
Key Features:
1. **Moving Average (MA) and VWAP Integration**:
- The indicator uses a 50-period Simple Moving Average (SMA) and VWAP (Volume Weighted Average Price) to identify the market trend.
- **Uptrend**: Price is above both the MA and VWAP.
- **Downtrend**: Price is below both the MA and VWAP.
2. **Volume Threshold**:
- A dynamic volume threshold is calculated based on the 20-period SMA of volume, multiplied by a factor of 1.2.
- This ensures signals are filtered to consider only significant volume spikes, avoiding noise from low-volume periods.
3. **Pin Bar Detection**:
- Identifies bullish and bearish Pin Bars based on candlestick characteristics:
- **Bullish Pin Bar**: Large wick above the body, small lower wick, and a green body.
- **Bearish Pin Bar**: Large wick below the body, small upper wick, and a red body.
4. **Inside Bar Detection**:
- Detects Inside Bars, where the current candle’s high and low are fully contained within the previous candle’s range.
- Indicates a period of indecision or potential breakout zones.
5. **Liquidity Zone Identification**:
- Uses recent 20-period highs and lows to approximate liquidity zones.
- Highlights areas where price is near these zones, indicating potential support or resistance.
6. **Buy and Sell Signal Generation**:
- **Buy Signal**: Triggered when a bullish Pin Bar or Inside Bar occurs in an uptrend, with high volume, and near liquidity zones.
- **Sell Signal**: Triggered when a bearish Pin Bar or Inside Bar occurs in a downtrend, with high volume, and near liquidity zones.
- Signals are visually plotted with green (BUY) and red (SELL) markers.
7. **Consolidation Zone Detection**:
- Identifies periods of low price range volatility using a user-defined period (`length`) and range threshold (`range_threshold` in %).
- Highlights periods where the price range is less than the threshold, visually marking consolidation zones.
- Upper and lower boundaries of consolidation zones are plotted with green and red lines, respectively.
8. **Visual Enhancements**:
- Consolidation zones are shaded with a blue background to make them easily recognizable.
- Clear markers for buy and sell signals help traders quickly spot opportunities.
---
Use Cases:
- **Trend Confirmation**: By integrating MA, VWAP, and volume analysis, this indicator helps confirm trends before entering trades.
- **Liquidity Zone Trading**: Identifies price areas where support or resistance may lead to significant price movement.
- **Consolidation Breakouts**: Highlights consolidation zones, which often precede explosive moves, allowing traders to anticipate breakouts.
- **Candlestick Reversal Patterns**: Pin Bars and Inside Bars are powerful patterns that provide early indications of potential reversals or continuation setups.
---
Customizable Parameters:
- **MA Period**: Length of the moving average (default: 50).
- **Volume Threshold**: Sensitivity to volume spikes (default: 20-period SMA × 1.2).
- **Consolidation Period**: Lookback period for identifying consolidation (default: 20).
- **Consolidation Range Threshold**: Maximum percentage range considered as consolidation (default: 1%).
---
Visualization:
- **Green BUY Signals**: Bullish opportunities based on confluence of patterns, trends, and volume.
- **Red SELL Signals**: Bearish opportunities under similar conditions.
- **Consolidation Zones**: Marked by shaded blue backgrounds and clear horizontal lines for high and low boundaries.
- **Dynamic Levels**: Liquidity zones (highs and lows) plotted for added context.
---
Advantages:
- **Confluence of Factors**: Combines trend, volume, and candlestick analysis for robust signal generation.
- **Market State Detection**: Effectively identifies consolidation and breakout conditions.
- **Customizable**: Users can fine-tune parameters for different instruments or trading styles.
---
This indicator is ideal for traders seeking a comprehensive tool to navigate market conditions with precision, leveraging multiple layers of analysis in a single, easy-to-use overlay.
HMA Gaussian Volatility AdjustedOverview
The "HMA Gaussian Volatility Adjusted" indicator introduces a unique combination of HMA smoothing with a Gaussian filter and two components to measure volatility (Average True Range (ATR) and Standard Deviation (SD)). This tool provides traders with a stable and accurate measure of price trends by integrating a Gaussian Filter smoothed using HMA with a customized calculation of volatility. This innovative approach allows for enhanced sensitivity to market fluctuations while filtering out short-term price noise.
Technical Composition and Calculation
The "HMA Gaussian Volatility Adjusted" indicator incorporates HMA smoothing and dynamic standard deviation calculations to build upon traditional volatility measures.
HMA & Gaussian Smoothing:
HMA Calculation (HMA_Length): The script applies a Hull Moving Average (HMA) to smooth the price data over a user-defined period, reducing noise and helping focus on broader market trends.
Gaussian Filter Calculation (Length_Gaussian): The smoothed HMA data is further refined by putting it into a Gaussian filter to incorporate a normal distribution.
Volatility Measurement:
ATR Calculation (ATR_Length, ATR_Factor): The indicator incorporates the Average True Range (ATR) to measure market volatility. The user-defined ATR multiplier is applied to this value to calculate upper and lower trend bands around the Gaussian, providing a dynamic measure of potential price movement based on recent volatility.
Standard Deviation Calculation (SD_Length): The script calculates the standard deviation of the price over a user-defined length, providing another layer of volatility measurement. The upper and lower standard deviation bands (SDD, SDU) act as additional indicators of price extremes.
Momentum Calculation & Scoring
When the indicator signals SHORT:
Diff = Price - Upper Boundary of the Standard Deviation (calculated on a Gaussian filter).
When the indicator signals LONG:
Diff = Price - Upper Boundary of the ATR (calculated on a Gaussian filter).
The calculated Diff signals how close the indicator is to changing trends. An EMA is applied to the Diff to smooth the data. Positive momentum occurs when the Diff is above the EMA, and negative momentum occurs when the Diff is below the EMA.
Trend Detection
Trend Logic: The indicator uses the calculated bands to identify whether the price is moving within or outside the standard deviation and ATR bands. Crosses above or below these bands, combined with positive/negative momentum, signals potential uptrends or downtrends, offering traders a clear view of market direction.
Features and User Inputs
The "HMA Gaussian Volatility Adjusted" script offers a variety of user inputs to customize the indicator to suit traders' styles and market conditions:
HMA Length: Allows traders to adjust the sensitivity of the HMA smoothing to control the amount of noise filtered from the price data.
Gaussian Length: Users can define the length at which the Gaussian filter is applied.
ATR Length and Multiplier: These inputs let traders fine-tune the ATR calculation, affecting the size of the dynamic upper and lower bands to adjust for price volatility.
Standard Deviation Length: Controls how the standard deviation is calculated, allowing further customization in detecting price volatility.
EMA Confluence: This input lets traders determine the length of the EMA used to calculate price momentum.
Type of Plot Setting: Allows users to determine how the indicator signal is plotted on the chart (Background color, Trend Lines, BOTH (backgroung color and Trend Lines)).
Transparency: Provides users with customization of the background color's transparency.
Color Long/Short: Offers users the option to choose their preferred colors for both long and short signals.
Summary and Usage Tips
The "HMA Gaussian Volatility Adjusted" indicator is a powerful tool for traders looking to refine their analysis of market trends and volatility. Its combination of HMA smoothing, Gaussian filtering, and standard deviation analysis provides a nuanced view of market movements by incorporating various metrics to determine direction, momentum, and volatility. This helps traders make better-informed decisions. It's recommended to experiment with the various input parameters to optimize the indicator for specific needs.
ATR-based TP/SL with Dynamic RREnglish
This indicator combines the power of the Average True Range (ATR) with dynamic calculations for Take Profit (TP) and Stop Loss (SL) levels, offering a clear visualization of trading opportunities and their respective Risk-Reward Ratios (RRR).
Features:
Dynamic TP/SL Calculation:
TP and SL levels are derived using user-defined ATR multipliers for precise positioning.
Multipliers are flexible, allowing traders to adjust according to their strategies.
Risk-Reward Ratio (RRR):
Automatically calculates and displays the RRR for each trade signal.
Helps traders quickly assess if a trade aligns with their risk management plan.
Entry Conditions:
Buy signals occur when the closing price crosses above the 20-period Simple Moving Average (SMA).
Sell signals occur when the closing price crosses below the 20-period SMA.
Visual Aids:
Red and green lines indicate Stop Loss and Take Profit levels.
Blue and orange labels show the RRR for long and short trades, respectively.
How It Works:
The indicator uses the ATR to calculate TP and SL levels:
TP: Adjusted based on the desired Risk-Reward Ratio (RR).
SL: Proportional to the ATR multiplier.
Entry signals are plotted with "BUY" or "SELL" markers, while the respective TP/SL levels are drawn as horizontal lines.
Why Use This Indicator?
Perfect for traders who value precise risk management.
Helps identify trades with favorable RRR (e.g., greater than 1.5 or 2.0).
Ideal for swing traders, day traders, and scalpers looking to automate their decision-making process.
Customization:
ATR Length: Control the sensitivity of ATR-based calculations.
ATR Multipliers: Set the TP and SL distances relative to the ATR.
Desired RRR: Define the risk/reward ratio you aim to achieve.
Important Notes:
The indicator does not place trades automatically; it is for visual and analytical purposes.
Always backtest and combine it with additional analysis for best results.
French
Cet indicateur combine la puissance de l’Average True Range (ATR) avec des calculs dynamiques pour les niveaux de Take Profit (TP) et de Stop Loss (SL), tout en offrant une visualisation claire des opportunités de trading et de leurs Ratios Risque/Rendement (RRR).
Fonctionnalités :
Calcul Dynamique des TP/SL :
Les niveaux de TP et SL sont calculés à l'aide de multiplicateurs ATR définis par l’utilisateur pour une position précise.
Les multiplicateurs sont personnalisables pour s'adapter à votre stratégie de trading.
Ratio Risque/Rendement (RRR) :
Calcule et affiche automatiquement le ratio RRR pour chaque signal de trade.
Permet aux traders d’évaluer rapidement si un trade correspond à leur plan de gestion des risques.
Conditions d'Entrée :
Les signaux d'achat apparaissent lorsque le prix de clôture traverse au-dessus de la moyenne mobile simple (SMA) à 20 périodes.
Les signaux de vente apparaissent lorsque le prix de clôture traverse en dessous de la SMA à 20 périodes.
Aides Visuelles :
Lignes rouges et vertes pour indiquer les niveaux de Stop Loss et de Take Profit.
Étiquettes bleues et orange pour afficher le RRR des trades longs et courts, respectivement.
Comment Cela Fonctionne :
L'indicateur utilise l’ATR pour calculer les niveaux TP et SL :
TP : Calculé dynamiquement en fonction du ratio risque/rendement souhaité (RRR).
SL : Proportionnel au multiplicateur ATR défini par l’utilisateur.
Les signaux d’entrée sont représentés par des étiquettes "BUY" ou "SELL", tandis que les niveaux de TP/SL sont tracés sous forme de lignes horizontales.
Pourquoi Utiliser Cet Indicateur ?
Idéal pour les traders soucieux d’une gestion rigoureuse des risques.
Identifie les opportunités de trades avec des RRR favorables (par exemple, supérieurs à 1.5 ou 2.0).
Convient aux swing traders, day traders et scalpeurs souhaitant automatiser leur processus de décision.
Personnalisation :
Longueur de l’ATR : Contrôlez la sensibilité des calculs basés sur l’ATR.
Multiplicateurs ATR : Ajustez les distances TP et SL par rapport à l’ATR.
Ratio RRR souhaité : Définissez le ratio risque/rendement que vous visez.
Remarques Importantes :
Cet indicateur n’exécute pas de trades automatiquement ; il est destiné à un usage visuel et analytique uniquement.
Toujours backtester et combiner avec une analyse supplémentaire pour de meilleurs résultats.
parametre par type de trading:
1. Pour les Scalpers :
Style de trading : Trades rapides sur de petites variations de prix, souvent sur des unités de temps courtes (1 min, 5 min).
Recommandations de paramètres :
ATR Length : 7 (plus court pour réagir rapidement à la volatilité).
Multiplicateur SL : 1.0 (Stop Loss proche pour limiter les pertes).
RR souhaité : 1.5 à 2.0 (bon équilibre entre risque et récompense).
Résultat attendu : Des trades fréquents, avec une probabilité raisonnable de toucher le TP tout en limitant les pertes.
2. Pour les Day Traders :
Style de trading : Trades qui durent plusieurs heures dans la journée, souvent sur des unités de temps moyennes (15 min, 1h).
Recommandations de paramètres :
ATR Length : 14 (standard pour capturer une volatilité modérée).
Multiplicateur SL : 1.5 (Stop Loss à distance raisonnable pour supporter les fluctuations intrajournalières).
RR souhaité : 2.0 à 3.0 (ciblez une bonne récompense par rapport au risque).
Résultat attendu : Moins de trades, mais un RR élevé pour compenser les pertes potentielles.
3. Pour les Swing Traders :
Style de trading : Trades qui durent plusieurs jours, souvent sur des unités de temps longues (4h, 1 jour).
Recommandations de paramètres :
ATR Length : 20 (pour capturer des mouvements de volatilité plus larges).
Multiplicateur SL : 2.0 (Stop Loss large pour supporter des fluctuations importantes).
RR souhaité : 3.0 ou plus (ciblez de gros mouvements de prix).
Résultat attendu : Des trades moins fréquents mais potentiellement très lucratifs.
4. Pour les Actifs Volatils (Crypto, Commodités) :
Problème spécifique : Les actifs volatils ont souvent des mouvements brusques.
Recommandations de paramètres :
ATR Length : 7 ou 10 (plus court pour suivre rapidement les variations).
Multiplicateur SL : 1.5 à 2.0 (assez large pour ne pas être déclenché prématurément).
RR souhaité : 1.5 à 2.0 (favorisez des récompenses réalistes sur des mouvements volatils).
Résultat attendu : Trades qui s’adaptent à la volatilité sans sortir trop tôt.
5. Pour les Marchés Stables (Indices, Actions Blue Chip) :
Problème spécifique : Les mouvements sont souvent lents et prévisibles.
Recommandations de paramètres :
ATR Length : 14 ou 20 (capture une volatilité modérée).
Multiplicateur SL : 1.0 à 1.5 (Stop Loss serré pour maximiser l’efficacité).
RR souhaité : 2.0 à 3.0 (ciblez des ratios plus élevés sur des mouvements moins fréquents).
Résultat attendu : Maximisation des profits sur des tendances claires.
Recommandation Générale :
Si vous ne savez pas par où commencer, utilisez ces paramètres par défaut :
ATR Length : 14
Multiplicateur SL : 1.5
RR souhaité : 2.0
MACD, ADX & RSI -> for altcoins# MACD + ADX + RSI Combined Indicator
## Overview
This advanced technical analysis tool combines three powerful indicators (MACD, ADX, and RSI) into a single view, providing a comprehensive analysis of trend, momentum, and divergence signals. The indicator is designed to help traders identify potential trading opportunities by analyzing multiple aspects of price action simultaneously.
## Components
### 1. MACD (Moving Average Convergence Divergence)
- **Purpose**: Identifies trend direction and momentum
- **Components**:
- Fast EMA (default: 12 periods)
- Slow EMA (default: 26 periods)
- Signal Line (default: 9 periods)
- Histogram showing the difference between MACD and Signal line
- **Visual**:
- Blue line: MACD line
- Orange line: Signal line
- Green/Red histogram: MACD histogram
- **Interpretation**:
- Histogram color changes indicate potential trend shifts
- Crossovers between MACD and Signal lines suggest entry/exit points
### 2. ADX (Average Directional Index)
- **Purpose**: Measures trend strength and direction
- **Components**:
- ADX line (default threshold: 20)
- DI+ (Positive Directional Indicator)
- DI- (Negative Directional Indicator)
- **Visual**:
- Navy blue line: ADX
- Green line: DI+
- Red line: DI-
- **Interpretation**:
- ADX > 20 indicates a strong trend
- DI+ crossing above DI- suggests bullish momentum
- DI- crossing above DI+ suggests bearish momentum
### 3. RSI (Relative Strength Index)
- **Purpose**: Identifies overbought/oversold conditions and divergences
- **Components**:
- RSI line (default: 14 periods)
- Divergence detection
- **Visual**:
- Purple line: RSI
- Horizontal lines at 70 (overbought) and 30 (oversold)
- Divergence labels ("Bull" and "Bear")
- **Interpretation**:
- RSI > 70: Potentially overbought
- RSI < 30: Potentially oversold
- Bullish/Bearish divergences indicate potential trend reversals
## Alert System
The indicator includes several automated alerts:
1. **MACD Alerts**:
- Rising to falling histogram transitions
- Falling to rising histogram transitions
2. **RSI Divergence Alerts**:
- Bullish divergence formations
- Bearish divergence formations
3. **ADX Trend Alerts**:
- Strong trend development (ADX crossing threshold)
- DI+ crossing above DI- (bullish)
- DI- crossing above DI+ (bearish)
## Settings Customization
All components can be fine-tuned through the settings panel:
### MACD Settings
- Fast Length
- Slow Length
- Signal Smoothing
- Source
- MA Type options (SMA/EMA)
### ADX Settings
- Length
- Threshold level
### RSI Settings
- RSI Length
- Source
- Divergence calculation toggle
## Usage Guidelines
### Entry Signals
Strong entry signals typically occur when multiple components align:
1. MACD histogram color change
2. ADX showing strong trend (>20)
3. RSI showing divergence or leaving oversold/overbought zones
### Exit Signals
Consider exits when:
1. MACD crosses signal line in opposite direction
2. ADX shows weakening trend
3. RSI reaches extreme levels with divergence
### Risk Management
- Use the indicator as part of a complete trading strategy
- Combine with price action and support/resistance levels
- Consider multiple timeframe analysis for confirmation
- Don't rely solely on any single component
## Technical Notes
- Built for TradingView using Pine Script v5
- Compatible with all timeframes
- Optimized for real-time calculation
- Includes proper error handling and NA value management
- Memory-efficient calculations for smooth performance
## Installation
1. Copy the provided Pine Script code
2. Open TradingView Chart
3. Create New Indicator -> Pine Editor
4. Paste the code and click "Add to Chart"
5. Adjust settings as needed through the indicator settings panel
## Version Information
- Version: 2.0
- Last Updated: November 2024
- Platform: TradingView
- Language: Pine Script v5
USDT.D Volatility TrackerUSDT.D Volatility Tracker
Description:
This script is designed to track the volatility of USDT.D (US Dollar in cryptocurrency) on the TradingView platform. It uses a moving average and deviation from it to generate buy and sell signals, helping traders visualize changes in volatility and make informed decisions.
Input Parameters:
maPeriod: The period of the moving average (default 120). This parameter allows users to adjust the length of the period used to calculate the moving average.
devThreshold: The deviation threshold (default 0.6). This parameter defines the level of deviation that will trigger buy or sell signals.
Data Request:
The script requests closing data for USDT.D using the request.security function, allowing it to retrieve up-to-date data on the selected timeframe.
Moving Average and Deviation Calculation:
An exponential moving average (EMA) is used to calculate the deviation from the moving average, enabling the identification of current volatility.
Deviation Line Display:
The deviation rate line is displayed on the chart, allowing users to visually track changes in volatility.
Signal Generation:
If the deviation exceeds the set threshold (devThreshold), a buy signal is generated (green background).
If the deviation falls below the negative threshold (-devThreshold), a sell signal is generated (red background).
Visual Signals:
Buy signals are displayed on the chart as green triangles, while sell signals are displayed as red triangles. This helps traders quickly identify potential entry and exit points.
Dual Strategy Selector V2 - CryptogyaniOverview:
This script provides traders with a dual-strategy system that they can toggle between using a simple dropdown menu in the input settings. It is designed to cater to different trading styles and needs, offering both simplicity and advanced filtering techniques. The strategies are built around moving average crossovers, enhanced by configurable risk management tools like take profit levels, trailing stops, and ATR-based stop-loss.
Key Features:
Two Strategies in One Script:
Strategy 1: A classic moving average crossover strategy for identifying entry signals based on trend reversals. Includes user-defined take profit and trailing stop-loss options for profit locking.
Strategy 2: An advanced trend-following system that incorporates:
A higher timeframe trend filter to confirm entry signals.
ATR-based stop-loss for dynamic risk management.
Configurable partial take profit to secure gains while letting the trade run.
Highly Customizable:
All key parameters such as SMA lengths, take profit levels, ATR multiplier, and timeframe for the trend filter are adjustable via the input settings.
Dynamic Toggle:
Traders can switch between Strategy 1 and Strategy 2 with a single dropdown, allowing them to adapt the strategy to market conditions.
How It Works:
Strategy 1:
Entry Logic: A long trade is triggered when the fast SMA crosses above the slow SMA.
Exit Logic: The trade exits at either a user-defined take profit level (percentage or pips) or via an optional trailing stop that dynamically adjusts based on price movement.
Strategy 2:
Entry Logic: Builds on the SMA crossover logic but adds a higher timeframe trend filter to align trades with the broader market direction.
Risk Management:
ATR-Based Stop-Loss: Protects against adverse moves with a volatility-adjusted stop-loss.
Partial Take Profit: Allows traders to secure a percentage of gains while keeping some exposure for extended trends.
How to Use:
Select Your Strategy:
Use the dropdown in the input settings to choose Strategy 1 or Strategy 2.
Configure Parameters:
Adjust SMA lengths, take profit, and risk management settings to align with your trading style.
For Strategy 2, specify the higher timeframe for trend filtering.
Deploy and Monitor:
Apply the script to your preferred asset and timeframe.
Use the backtest results to fine-tune settings for optimal performance.
Why Choose This Script?:
This script stands out due to its dual-strategy flexibility and enhanced features:
For beginners: Strategy 1 provides a simple yet effective trend-following system with minimal setup.
For advanced traders: Strategy 2 includes powerful tools like trend filters and ATR-based stop-loss, making it ideal for challenging market conditions.
By combining simplicity with advanced features, this script offers something for everyone while maintaining full transparency and user customization.
Default Settings:
Strategy 1:
Fast SMA: 21, Slow SMA: 49
Take Profit: 7% or 50 pips
Trailing Stop: Optional (disabled by default)
Strategy 2:
Fast SMA: 20, Slow SMA: 50
ATR Multiplier: 1.5
Partial Take Profit: 50%
Higher Timeframe: 1 Day (1D)
Truly Iterative Gaussian ChannelOVERVIEW
The Truly Iterative Gaussian Channel is a robust channeling system that integrates a Gaussian smoothing kernel with a rolling standard deviation to create dynamically adaptive upper and lower boundaries around price. This indicator provides a smooth, yet responsive representation of price movements while minimizing lag and dynamically adjusting channel width to reflect real-time market volatility. Its versatility makes it effective across various timeframes and trading styles, offering significant potential for experimentation and integration into advanced trading systems.
TRADING USES
The Gaussian indicator can be used for multiple trading strategies. Trend following relies on the middle Gaussian line to gauge trend direction: prices above this line indicate bullish momentum, while prices below signal bearish momentum. The upper and lower boundaries act as dynamic support and resistance levels, offering breakout or pullback entry opportunities. Mean reversion focuses on identifying reversal setups when price approaches or breaches the outer boundaries, aiming for a return to the Gaussian centerline. Volatility filtering helps assess market conditions, with narrow channels indicating low volatility or consolidation and suggesting fewer trading opportunities or an impending breakout. Adaptive risk management uses channel width to adjust for market volatility, with wider channels signaling higher risk and tighter channels indicating lower volatility and potentially safer entry points.
THEORY
Gaussian kernel smoothing, derived from the Gaussian normal distribution, is a cornerstone of probability and statistics, valued for its ability to reduce noise while preserving critical signal features. In this indicator, it ensures price movements are smoothed with precision, minimizing distortion while maintaining responsiveness to market dynamics.
The rolling standard deviation complements this by dynamically measuring price dispersion from the mean, enabling the channel to adapt in real time to changing market conditions. This combination leverages the mathematical correctness of both tools to balance smoothness and adaptability.
An iterative framework processes data efficiently, bar by bar, without recalculating historical value to ensure reliability and preventing repainting to create a mathematically grounded channel system suitable for a wide range of market environments.
The Gaussian channel excels at filtering noise while remaining responsive to price action, providing traders with a dependable tool for identifying trends, reversals, and volatility shifts with consistency and precision.
CALIBRATION
Calibration of the Gaussian channel involves adjusting its length to modify sensitivity and adaptability based on trading style. Shorter lengths (e.g., 50-100) are ideal for intraday traders seeking quick responses to price fluctuations. Medium lengths (e.g., 150-200) cater to swing traders aiming to capture broader market trends. Longer lengths (e.g., 250-400+) are better suited for positional traders focusing on long-term price movements and stability.
MARKET USAGE
Stock, Forex, Crypto, Commodities, and Indices.
Bull Bear Candles with Volume ProfileUser Guide for Bull Bear Candles Indicator with Keltner Channels
Author: NellyN
Introduction
This indicator helps identify potential bullish and bearish trends in the market by analyzing buying and selling volume over two configurable timeframes. It calculates the percentage of buying and selling volume and displays the current market condition based on two moving averages for 2 periods.
Key Features
• Volume Analysis : Calculates Buy and Sell Volume for two configurable timeframes (e.g., 5 min, 15 min, 15 min. and 1 hour, etc.) and displays them as percentages.
• Moving Averages : Uses one Moving Average (MA) for two different time periods to identify trends (uptrend when shorter-term MA is above longer-term MA). You can also choose other Moving Average types like SMA, EMA, WMA, RMA, VWMA, or HMA.
• Colored Candles : Candles are colored green for bullish conditions, red for bearish conditions, and gray for neutral conditions.
• Market Condition Labels : Displays labels in table-view indicating the current market condition based on Buy and Sell Volume (Very Bullish, Very Bearish, Bullish/Bearish Retracement, Chop).
• Alerts: Generates alerts for potential buy and sell signals based on indicator conditions (Note: Enable alerts in the indicator settings).
• Visual Signals: Provides visual signals through colored candles and market condition labels in addition to alerts.
Input Parameters
• Source: Close price (default) or Heikin Ashi
• Timeframe: Select the timeframe for price and volume data used in the indicator (e.g., Daily, Hourly).
• Colored Candles On: Enable (True) or disable (False) coloring candles based on market conditions.
• Enable Alerts: Enable (True) or disable (False) alerts for buy/sell signals.
• Length of MA: Sets the length for the MAs used in trend identification (minimum 1).
• Lookback Period Vol. 1 & 2: Define the timeframes used to calculate buying and selling volume and the MA calculation (e.g., 5 min, 15 min).
Understanding the Outputs
• Cloud Fill: The area between two MAs is filled with a color that reflects the trend (green for uptrend, red for downtrend).
• Table: Shows Buy Volume, Sell Volume, Buy Percentage, Sell Percentage, and the current Market Condition Labels. (If you decide to see them uncomment them from the code simply removing the // in front of the code)
• Colored Candles and Market Condition Labels: Look for green candles and bullish labels for potential buying opportunities, and vice versa for red candles and bearish labels.
Bullish green label appears when short-term MA is above long-term MA AND Buy Volume percentage is greater than 50%.
Red cross for exiting long entry appears when we have bearish volume OR bearish crossover of the MA for the 2 periods.
Bearish red label appears when short-term MA is below long-term MA AND Buy Volume percentage is less than 50%.
Green cross for exiting short entry appears when we have bullish volume OR bullish crossover of the MA for the 2 periods.
• Bullish/Bearish Retracement: The moving averages indicate a potential trend reversal, while the Buy Volume percentage suggests a continuation of the prior trend. The candle color may be green, red, or gray depending on the current price position relative to the moving averages.
• Chop (Gray Candle): The moving averages are flat and the Buy Volume percentage is not significantly above or below 50%.
• Buy/Sell Alerts: The indicator generates alerts based on specific conditions, but these should be used in conjunction with other trading strategies and careful risk management.
Important Notes
• This indicator is for informational purposes only and should not be considered financial advice. Back-test the indicator with historical data to understand its performance before using it for live trading.
• Combine this indicator with other technical analysis tools.
ORB Screener with Trailing SLThis is an extension to our already published script ORB with ATR Trailing SL indicator
Many people requested to add screener to the existing indicator but since it's slowing down the performance heavily, we decided to add this as a separate screener.
Note: This screener does NOT plot the chart and so you want to have both plotting and screener, use both scripts together.
Overview:
The ORB Screener is a TradingView indicator designed to assist traders in identifying breakout opportunities based on the Opening Range Breakout (ORB) strategy. It features multi-symbol screening, customizable session timeframes, and a detailed table for quick visual reference and stock scanning.
The ORB Screener utilizes the ORB strategy to calculate breakout levels for multiple symbols. It identifies the high and low during a specified session (e.g., first 5 minutes after market open) and provides insights on whether the price is above the high (bullish), below the low (bearish), or between the range (neutral).
Additionally, the script calculates and displays the RSI values for each symbol, aiding traders in assessing momentum alongside breakout status.
Note: One can add up to 40 symbols for screening the stocks.
Key Features and Inputs:
ORB Session Time: Define a specific timeframe (e.g., "0915-0920") during which the ORB high and low are calculated. This serves as the foundation for identifying breakouts.
Multi-Symbol Screening: Screen up to 40 symbols at once, enabling you to monitor multiple opportunities without switching charts.
Breakout Validation:
Select from two methods for confirming a breakout: Close (based on closing prices) or Touch (based on intraday highs/lows).
Breakout Status Indicators:
Above High: Indicates a current bullish breakout when the price exceeds the ORB high.
Below Low: Indicates a current bearish breakout when the price falls below the ORB low.
Between Range: Indicates no breakout (price remains within the range).
RSI Integration : Calculates the RSI for each symbol to help traders evaluate momentum alongside breakout signals.
Customizable Table Display:
Position: Place the data table at the top, middle, or bottom of the chart and align it left, center, or right.
Size: Choose from multiple table size options for optimal visibility (Auto, Huge, Large, Normal, Small, Tiny).
Visual Feedback:
Green Background: Indicates a breakout happened at least once above the ORB high.
Red Background: Indicates a breakout happened at least once below the ORB low.
Gray Background: Indicates price is within the ORB range.