SPDR Relativ Sector MomentumThe SPDR Relativ Sector Momentum Indicator is designed to evaluate the momentum of key U.S. market sectors relative to the broader market, represented by the S&P 500 Index (SPY). This indicator uses momentum-based techniques to assess sector performance and highlight relative strength or weakness over a given period. It leverages rate of change (ROC) as the primary momentum measure and incorporates smoothing via a simple moving average (SMA).
Methodology
This measure is smoothed over a configurable length (default: 20 periods) to filter noise and highlight trends. Sector momentum is computed for 11 key SPDR ETFs:
• XLE: Energy
• XLB: Materials
• XLI: Industrials
• XLY: Consumer Discretionary
• XLP: Consumer Staples
• XLV: Healthcare
• XLF: Financials
• XLK: Technology
• XLC: Communication Services
• XLU: Utilities
• XLRE: Real Estate
Momentum for the SPY is calculated similarly and serves as a benchmark.
Visualization
The indicator displays relative momentum values in a structured table, with high-contrast colors for better readability. The table dynamically updates sector performance, allowing users to easily track which sectors are outperforming or underperforming SPY. Additionally, the relative momentum values are plotted as individual lines around a zero baseline, providing visual confirmation of trends.
Applications
1. Portfolio Allocation: By identifying leading and lagging sectors, investors can allocate resources to sectors with strong momentum and reduce exposure to weaker sectors.
2. Trend Identification: The zero baseline helps users distinguish between sectors with positive and negative relative momentum.
3. Momentum Trading: The indicator aids in trading strategies that capitalize on sector rotations by highlighting momentum shifts.
Theoretical Background
Momentum strategies are grounded in behavioral finance theory and empirical research. They exploit the tendency of securities with strong past performance to continue outperforming in the short term. Jegadeesh and Titman (1993) demonstrated that momentum strategies yield significant returns over intermediate horizons (3-12 months). Applying this framework to sectors enhances the granularity of momentum analysis.
Limitations
While momentum strategies have shown historical efficacy, they are prone to mean reversion during periods of market instability (Barroso & Santa-Clara, 2015). Moreover, sector ETFs may exhibit varying levels of liquidity and sensitivity to macroeconomic factors, affecting signal reliability.
References
1. Jegadeesh, N., & Titman, S. (1993). “Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency.” The Journal of Finance.
2. Barroso, P., & Santa-Clara, P. (2015). “Momentum Has Its Moments.” Journal of Financial Economics.
3. Moskowitz, T. J., & Grinblatt, M. (1999). “Do Industries Explain Momentum?” The Journal of Finance.
This indicator provides a practical tool for evaluating sector-specific momentum dynamics, grounded in robust financial theory. Its modular design allows customization, making it a versatile instrument for momentum-based sector analysis.
Educational
G. Santostasi's Bimodal Regimes Power Law G. Santostasi's Bimodal Regimes Power Law Model
Invite-Only TradingView Indicator
The Bimodal Power Law Model is a powerful TradingView indicator that provides a detailed visualization of Bitcoin's price behavior relative to its long-term power law trend. By leveraging volatility-normalized deviations, this model uncovers critical upper and lower bounds that govern Bitcoin’s price dynamics.
Key Features:
Power Law Support Line:
The model highlights the power law support line, a natural lower bound that has consistently defined Bitcoin's price floor over time. This line provides a crucial reference point for identifying accumulation zones.
Volatility-Normalized Upper Bound:
The indicator introduces a volatility-normalized upper channel, dynamically defined by the deviations from the power law. This bound represents the natural ceiling for Bitcoin’s price action and adjusts in real time to reflect changes in market volatility.
Color-Shaded Volatility Bounds:
The upper and lower bounds are visualized as color-shaded regions that represent the range of current volatility relative to the power law trend. These shaded regions dynamically expand or contract based on the level of market volatility, providing an intuitive view of Bitcoin’s expected price behavior under normalized conditions.
Two Regime Analysis:
Using a Gaussian Hidden Markov Model (HMM), the indicator separates Bitcoin's price action into two distinct regimes:
Above the power law:
Bullish phases characterized by overextensions.
Below the power law:
Bearish or accumulation phases where price consolidates below the trend.
Dynamic Bounds with Standard Deviations:
The model plots 2 standard deviation bands for both regimes, offering precise insights into the natural limits of Bitcoin’s price fluctuations. Peaks exceeding these bounds are contextualized as anomalies caused by historically higher volatility, emphasizing the consistency of normalized deviations.
Enhanced Visualization and Analysis:
The indicator integrates running averages calculated using deviations from the power law trend and smoothed volatility data to ensure a visually intuitive representation of Bitcoin’s price behavior. These insights help traders and researchers identify when price action is approaching statistically significant levels.
Use Cases:
Support and Resistance Identification:
Use the power law support line and upper volatility bounds to identify critical levels for buying or taking profit.
Cycle Analysis:
Distinguish between sustainable trends and speculative bubbles based on deviations from the power law.
Risk Management:
The shaded volatility regions provide a dynamic measure of risk, helping traders gauge when Bitcoin is overbought or oversold relative to its historical norms.
Market Timing: Understand Bitcoin’s cyclical behavior to time entries and exits based on its position within the shaded bounds.
Note:
This indicator is designed for long-term Bitcoin investors, researchers, and advanced traders who seek to leverage statistical regularities in Bitcoin’s price behavior. Available by invitation only.
Candle 1 2 3 on XAUUSD (by Veronica)Description
Discover the Candle 1 2 3 Strategy, a simple yet effective trading method tailored exclusively for XAUUSD on the 15-minute timeframe. Designed by Veronica, this strategy focuses on identifying key reversal and continuation patterns during the London and New York sessions, making it ideal for traders who prioritise high-probability entries during these active market hours.
Key Features:
1. Session-Specific Trading:
The strategy operates strictly during London (03:00–06:00 UTC) and New York (08:30–12:30 UTC) sessions, where XAUUSD tends to show higher volatility and clearer price movements.
Pattern Criteria:
- Works best if the first candle is NOT a pin bar or a doji.
- Third candle should either:
a. Be a marubozu (large body with minimal wicks).
a. Have a significant body with wicks, ensuring the close of the third candle is above Candle 2 (for Buy) or below Candle 2 (for Sell).
Callout Labels and Alerts:
Automatic Buy and Sell labels are displayed on the chart during qualifying sessions, ensuring clarity for decision-making.
Integrated alerts notify you of trading opportunities in real-time.
Risk Management:
Built-in Risk Calculator to estimate lot sizes based on your account size, risk percentage, and stop-loss levels.
Customizable Table:
Displays your calculated lot size for various stop-loss pip values, making risk management seamless and efficient.
How to Use:
1. Apply the indicator to XAUUSD (M15).
2. Focus on setups appearing within the London and New York sessions only.
3. Ensure the first candle is neither a pin bar nor a doji.
4. Validate the third candle's body placement:
For a Buy, the third candle’s close must be above the second candle.
For a Sell, the third candle’s close must be below the second candle.
5. Use the generated alerts to streamline your entry process.
Notes:
This strategy is meant to complement your existing knowledge of market structure and price action.
Always backtest thoroughly and adjust parameters to fit your personal trading style and risk tolerance.
Credit:
This strategy is the intellectual property of Veronica, developed specifically for XAUUSD (M15) traders seeking precision entries during high-volume sessions.
00 Averaging Down Backtest Strategy by RPAlawyer v21FOR EDUCATIONAL PURPOSES ONLY! THE CODE IS NOT YET FULLY DEVELOPED, BUT IT CAN PROVIDE INTERESTING DATA AND INSIGHTS IN ITS CURRENT STATE.
This strategy is an 'averaging down' backtester strategy. The goal of averaging/doubling down is to buy more of an asset at a lower price to reduce your average entry price.
This backtester code proves why you shouldn't do averaging down, but the code can be developed (and will be developed) further, and there might be settings even in its current form that prove that averaging down can be done effectively.
Different averaging down strategies exist:
- Linear/Fixed Amount: buy $1000 every time price drops 5%
- Grid Trading: Placing orders at price levels, often with increasing size, like $1000 at -5%, $2000 at -10%
- Martingale: doubling the position size with each new entry
- Reverse Martingale: decreasing position size as price falls: $4000, then $2000, then $1000
- Percentage-Based: position size based on % of remaining capital, like 10% of available funds at each level
- Dynamic/Adaptive: larger entries during high volatility, smaller during low
- Logarithmic: position sizes increase logarithmically as price drops
Unlike the above average costing strategies, it applies averaging down (I use DCA as a synonym) at a very strong trend reversal. So not at a certain predetermined percentage negative PNL % but at a trend reversal signaled by an indicator - hence it most closely resembles a dynamically moving grid DCA strategy.
Both entering the trade and averaging down assume a strong trend. The signals for trend detection are provided by an indicator that I published under the name '00 Parabolic SAR Trend Following Signals by RPAlawyer', but any indicator that generates numeric signals of 1 and -1 for buy and sell signals can be used.
The indicator must be connected to the strategy: in the strategy settings under 'External Source' you need to select '00 Parabolic SAR Trend Following Signals by RPAlawyer: Connector'. From this point, the strategy detects when the indicator generates buy and sell signals.
The strategy considers a strong trend when a buy signal appears above a very conservative ATR band, or a sell signal below the ATR band. The conservative ATR is chosen to filter ranging markets. This very conservative ATR setting has a default multiplier of 8 and length of 40. The multiplier can be increased up to 10, but there will be very few buy and sell signals at that level and DCA requirements will be very high. Trade entry and DCA occur at these strong trends. In the settings, the 'ATR Filter' setting determines the entry condition (e.g., ATR Filter multiplier of 9), and the 'DCA ATR' determines when DCA will happen (e.g., DCA ATR multiplier of 6).
The DCA levels and DCA amounts are determined as follows:
The first DCA occurs below the DCA Base Deviation% level (see settings, default 3%) which acts as a threshold. The thick green line indicates the long position avg price, and the thin red line below the green line indicates the 3% DCA threshold for long positions. The thick red line indicates the short position avg price, and the thin red line above the thick red line indicates the short position 3% DCA threshold. DCA size multiplier defines the DCA amount invested.
If the loss exceeds 3% AND a buy signal arrives below the lower ATR band for longs, or a sell signal arrives above the upper ATR band for shorts, then the first DCA will be executed. So the first DCA won't happen at 3%, rather 3% is a threshold where the additional condition is that the price must close above or below the ATR band (let's say the first DCA occured at 8%) – this is why the code resembles a dynamic grid strategy, where the grid moves such that alongside the first 3% threshold, a strong trend must also appear for DCA. At this point, the thick green/red line moves because the avg price is modified as a result of the DCA, and the thin red line indicating the next DCA level also moves. The next DCA level is determined by the first DCA level, meaning modified avg price plus an additional +8% + (3% * the Step Scale Multiplier in the settings). This next DCA level will be indicated by the modified thin red line, and the price must break through this level and again break through the ATR band for the second DCA to occur.
Since all this wasn't complicated enough, and I was always obsessed by the idea that when we're sitting in an underwater position for days, doing DCA and waiting for the price to correct, we can actually enter a short position on the other side, on which we can realize profit (if the broker allows taking hedge positions, Binance allows this in Europe).
This opposite position in this strategy can open from the point AFTER THE FIRST DCA OF THE BASE POSITION OCCURS. This base position first DCA actually indicates that the price has already moved against us significantly so time to earn some money on the other side. Breaking through the ATR band is also a condition for entry here, so the hedge position entry is not automatic, and the condition for further DCA is breaking through the DCA Base Deviation (default 3%) and breaking through the ATR band. So for the 'hedge' or rather opposite position, the entry and further DCA conditions are the same as for the base position. The hedge position avg price is indicated by a thick black line and the Next Hedge DCA Level is indicated by a thin black line.
The TPs are indicated by green labels for base positions and red labels for hedge positions.
No SL built into the strategy at this point but you are free to do your coding.
Summary data can be found in the upper right corner.
The fantastic trend reversal indicator Machine learning: Lorentzian Classification by jdehorty can be used as an external indicator, choose 'backtest stream' for the external source. The ATR Band multiplicators need to be reduced to 5-6 when using Lorentz.
The code can be further developed in several aspects, and as I write this, I already have a few ideas 😊
Best of Option Indicator - Manoj WadekarPlot this indicator for both CALL and PUT options and buy only when color of candle is YELLOW and above BLACK line.
4EMAs+OpenHrs+FOMC+CPIThis script displays 4 custom EMAs of your choice based on the Pine script standard ema function.
Additionally the following events are shown
1. Opening hours for New York Stock exchange
2. Opening Time for London Stock exchange
3. US CPI Release Dates
4. FOMC press conference dates
5. FOMC meeting minutes release dates
I have currently added FOMC and CPI Dates for 2025 but will keep updating in January of every year (at least as long as I stay in the game :D)
India VIXThe VIX chart represents the Volatility Index, commonly referred to as the "Fear Gauge" of the stock market. It measures the market's expectations of future volatility over the next 30 days, based on the implied volatility of NSE index options. The VIX is often used as an indicator of investor sentiment, reflecting the level of fear or uncertainty in the market.
Here’s a breakdown of what you might observe on a typical VIX chart:
VIX Value: The y-axis typically represents the VIX index value, with higher values indicating higher levels of expected market volatility (more fear or uncertainty), and lower values signaling calm or stable market conditions.
VIX Spikes: Large spikes in the VIX often correspond to market downturns or periods of heightened uncertainty, such as during financial crises or major geopolitical events. A high VIX is often associated with a drop in the stock market.
VIX Drops: A decline in the VIX indicates a reduction in expected market volatility, usually linked with periods of market calm or rising stock prices.
Trend Analysis: Technical traders might use moving averages or other indicators on the VIX chart to assess the potential for future market movements.
Inverse Relationship with the Stock Market: Typically, there is an inverse correlation between the VIX and the stock market. When stocks fall sharply, volatility increases, and the VIX tends to rise. Conversely, when the stock market rallies or remains stable, the VIX tends to fall.
A typical interpretation would be that when the VIX is low, the market is relatively stable, and when the VIX is high, the market is perceived to be uncertain or volatile.
Combined Multi-Timeframe EMA OscillatorThis script aims to visualize the strength of bullish or bearish trends by utilizing a mix of 200 EMA across multiple timeframes. I've observed that when the multi-timeframe 200 EMA ribbon is aligned and expanding, the uptrend usually lasts longer and is safer to enter at a pullback for trend continuation. Similarly, when the bands are expanding in reverse order, the downtrend holds longer, making it easier to sell the pullbacks.
In this script, I apply a purely empirical and experimental method: a) Ranking the position of each of the above EMAs and turning it into an oscillator. b) Taking each 200 EMA on separate timeframes, turning it into a stochastic-like oscillator, and then averaging them to compute an overall stochastic.
To filter a bullish signal, I use the bullish crossover between these two aggregated oscillators (default: yellow and blue on the chart) which also plots a green shadow area on the screen and I look for buy opportunities/ ignore sell opportunities while this signal is bullish. Similarly, a bearish crossover gives us a bearish signal which also plots a red shadow area on the screen and I only look for sell opportunities/ ignore any buy opportunities while this signal is bearish.
Note that directly buying the signal as it prints can lead to suboptimal entries. The idea behind the above is that these crossovers point on average to a stronger trend; however, a trade should be initiated on the pullbacks with confirmation from momentum and volume indicators and in confluence with key areas of support and resistance and risk management should be used in order to protect your position.
Disclaimer: This script does not constitute certified financial advice, the current work is purely experimental, use at your own discretion.
Accurate Bollinger Bands mcbw_ [True Volatility Distribution]The Bollinger Bands have become a very important technical tool for discretionary and algorithmic traders alike over the last decades. It was designed to give traders an edge on the markets by setting probabilistic values to different levels of volatility. However, some of the assumptions that go into its calculations make it unusable for traders who want to get a correct understanding of the volatility that the bands are trying to be used for. Let's go through what the Bollinger Bands are said to show, how their calculations work, the problems in the calculations, and how the current indicator I am presenting today fixes these.
--> If you just want to know how the settings work then skip straight to the end or click on the little (i) symbol next to the values in the indicator settings window when its on your chart <--
--------------------------- What Are Bollinger Bands ---------------------------
The Bollinger Bands were formed in the 1980's, a time when many retail traders interacted with their symbols via physically printed charts and computer memory for personal computer memory was measured in Kb (about a factor of 1 million smaller than today). Bollinger Bands are designed to help a trader or algorithm see the likelihood of price expanding outside of its typical range, the further the lines are from the current price implies the less often they will get hit. With a hands on understanding many strategies use these levels for designated levels of breakout trades or to assist in defining price ranges.
--------------------------- How Bollinger Bands Work ---------------------------
The calculations that go into Bollinger Bands are rather simple. There is a moving average that centers the indicator and an equidistant top band and bottom band are drawn at a fixed width away. The moving average is just a typical moving average (or common variant) that tracks the price action, while the distance to the top and bottom bands is a direct function of recent price volatility. The way that the distance to the bands is calculated is inspired by formulas from statistics. The standard deviation is taken from the candles that go into the moving average and then this is multiplied by a user defined value to set the bands position, I will call this value 'the multiple'. When discussing Bollinger Bands, that trading community at large normally discusses 'the multiple' as a multiplier of the standard deviation as it applies to a normal distribution (gaußian probability). On a normal distribution the number of standard deviations away (which trades directly use as 'the multiple') you are directly corresponds to how likely/unlikely something is to happen:
1 standard deviation equals 68.3%, meaning that the price should stay inside the 1 standard deviation 68.3% of the time and be outside of it 31.7% of the time;
2 standard deviation equals 95.5%, meaning that the price should stay inside the 2 standard deviation 95.5% of the time and be outside of it 4.5% of the time;
3 standard deviation equals 99.7%, meaning that the price should stay inside the 3 standard deviation 99.7% of the time and be outside of it 0.3% of the time.
Therefore when traders set 'the multiple' to 2, they interpret this as meaning that price will not reach there 95.5% of the time.
---------------- The Problem With The Math of Bollinger Bands ----------------
In and of themselves the Bollinger Bands are a great tool, but they have become misconstrued with some incorrect sense of statistical meaning, when they should really just be taken at face value without any further interpretation or implication.
In order to explain this it is going to get a bit technical so I will give a little math background and try to simplify things. First let's review some statistics topics (distributions, percentiles, standard deviations) and then with that understanding explore the incorrect logic of how Bollinger Bands have been interpreted/employed.
---------------- Quick Stats Review ----------------
.
(If you are comfortable with statistics feel free to skip ahead to the next section)
.
-------- I: Probability distributions --------
When you have a lot of data it is helpful to see how many times different results appear in your dataset. To visualize this people use "histograms", which just shows how many times each element appears in the dataset by stacking each of the same elements on top of each other to form a graph. You may be familiar with the bell curve (also called the "normal distribution", which we will be calling it by). The normal distribution histogram looks like a big hump around zero and then drops off super quickly the further you get from it. This shape (the bell curve) is very nice because it has a lot of very nifty mathematical properties and seems to show up in nature all the time. Since it pops up in so many places, society has developed many different shortcuts related to it that speed up all kinds of calculations, including the shortcut that 1 standard deviation = 68.3%, 2 standard deviations = 95.5%, and 3 standard deviations = 99.7% (these only apply to the normal distribution). Despite how handy the normal distribution is and all the shortcuts we have for it are, and how much it shows up in the natural world, there is nothing that forces your specific dataset to look like it. In fact, your data can actually have any possible shape. As we will explore later, economic and financial datasets *rarely* follow the normal distribution.
-------- II: Percentiles --------
After you have made the histogram of your dataset you have built the "probability distribution" of your own dataset that is specific to all the data you have collected. There is a whole complicated framework for how to accurately calculate percentiles but we will dramatically simplify it for our use. The 'percentile' in our case is just the number of data points we are away from the "middle" of the data set (normally just 0). Lets say I took the difference of the daily close of a symbol for the last two weeks, green candles would be positive and red would be negative. In this example my dataset of day by day closing price difference is:
week 1:
week 2:
sorting all of these value into a single dataset I have:
I can separate the positive and negative returns and explore their distributions separately:
negative return distribution =
positive return distribution =
Taking the 25th% percentile of these would just be taking the value that is 25% towards the end of the end of these returns. Or akin the 100%th percentile would just be taking the vale that is 100% at the end of those:
negative return distribution (50%) = -5
positive return distribution (50%) = +4
negative return distribution (100%) = -10
positive return distribution (100%) = +20
Or instead of separating the positive and negative returns we can also look at all of the differences in the daily close as just pure price movement and not account for the direction, in this case we would pool all of the data together by ignoring the negative signs of the negative reruns
combined return distribution =
In this case the 50%th and 100%th percentile of the combined return distribution would be:
combined return distribution (50%) = 4
combined return distribution (100%) = 10
Sometimes taking the positive and negative distributions separately is better than pooling them into a combined distribution for some purposes. Other times the combined distribution is better.
Most financial data has very different distributions for negative returns and positive returns. This is encapsulated in sayings like "Price takes the stairs up and the elevator down".
-------- III: Standard Deviation --------
The formula for the standard deviation (refereed to here by its shorthand 'STDEV') can be intimidating, but going through each of its elements will illuminate what it does. The formula for STDEV is equal to:
square root ( (sum ) / N )
Going back the the dataset that you might have, the variables in the formula above are:
'mean' is the average of your entire dataset
'x' is just representative of a single point in your dataset (one point at a time)
'N' is the total number of things in your dataset.
Going back to the STDEV formula above we can see how each part of it works. Starting with the '(x - mean)' part. What this does is it takes every single point of the dataset and measure how far away it is from the mean of the entire dataset. Taking this value to the power of two: '(x - mean) ^ 2', means that points that are very far away from the dataset mean get 'penalized' twice as much. Points that are very close to the dataset mean are not impacted as much. In practice, this would mean that if your dataset had a bunch of values that were in a wide range but always stayed in that range, this value ('(x - mean) ^ 2') would end up being small. On the other hand, if your dataset was full of the exact same number, but had a couple outliers very far away, this would have a much larger value since the square par of '(x - mean) ^ 2' make them grow massive. Now including the sum part of 'sum ', this just adds up all the of the squared distanced from the dataset mean. Then this is divided by the number of values in the dataset ('N'), and then the square root of that value is taken.
There is nothing inherently special or definitive about the STDEV formula, it is just a tool with extremely widespread use and adoption. As we saw here, all the STDEV formula is really doing is measuring the intensity of the outliers.
--------------------------- Flaws of Bollinger Bands ---------------------------
The largest problem with Bollinger Bands is the assumption that price has a normal distribution. This is assumption is massively incorrect for many reasons that I will try to encapsulate into two points:
Price return do not follow a normal distribution, every single symbol on every single timeframe has is own unique distribution that is specific to only itself. Therefore all the tools, shortcuts, and ideas that we use for normal distributions do not apply to price returns, and since they do not apply here they should not be used. A more general approach is needed that allows each specific symbol on every specific timeframe to be treated uniquely.
The distributions of price returns on the positive and negative side are almost never the same. A more general approach is needed that allows positive and negative returns to be calculated separately.
In addition to the issues of the normal distribution assumption, the standard deviation formula (as shown above in the quick stats review) is essentially just a tame measurement of outliers (a more aggressive form of outlier measurement might be taking the differences to the power of 3 rather than 2). Despite this being a bit of a philosophical question, does the measurement of outlier intensity as defined by the STDEV formula really measure what we want to know as traders when we're experiencing volatility? Or would adjustments to that formula better reflect what we *experience* as volatility when we are actively trading? This is an open ended question that I will leave here, but I wanted to pose this question because it is a key part of what how the Bollinger Bands work that we all assume as a given.
Circling back on the normal distribution assumption, the standard deviation formula used in the calculation of the bands only encompasses the deviation of the candles that go into the moving average and have no knowledge of the historical price action. Therefore the level of the bands may not really reflect how the price action behaves over a longer period of time.
------------ Delivering Factually Accurate Data That Traders Need------------
In light of the problems identified above, this indicator fixes all of these issue and delivers statistically correct information that discretionary and algorithmic traders can use, with truly accurate probabilities. It takes the price action of the last 2,000 candles and builds a huge dataset of distributions that you can directly select your percentiles from. It also allows you to have the positive and negative distributions calculated separately, or if you would like, you can pool all of them together in a combined distribution. In addition to this, there is a wide selection of moving averages directly available in the indicator to choose from.
Hedge funds, quant shops, algo prop firms, and advanced mechanical groups all employ the true return distributions in their work. Now you have access to the same type of data with this indicator, wherein it's doing all the lifting for you.
------------------------------ Indicator Settings ------------------------------
.
---- Moving average ----
Select the type of moving average you would like and its length
---- Bands ----
The percentiles that you enter here will be pulled directly from the return distribution of the last 2,000 candles. With the typical Bollinger Bands, traders would select 2 standard deviations and incorrectly think that the levels it highlights are the 95.5% levels. Now, if you want the true 95.5% level, you can just enter 95.5 into the percentile value here. Each of the three available bands takes the true percentile you enter here.
---- Separate Positive & Negative Distributions----
If this box is checked the positive and negative distributions are treated indecently, completely separate from each other. You will see that the width of the top and bottom bands will be different for each of the percentiles you enter.
If this box is unchecked then all the negative and positive distributions are pooled together. You will notice that the width of the top and bottom bands will be the exact same.
---- Distribution Size ----
This is the number of candles that the price return is calculated over. EG: to collect the price return over the last 33 candles, the difference of price from now to 33 candles ago is calculated for the last 2,000 candles, to build a return distribution of 2000 points of price differences over 33 candles.
NEGATIVE NUMBERS(<0) == exact number of candles to include;
EG: setting this value to -20 will always collect volatility distributions of 20 candles
POSITIVE NUMBERS(>0) == number of candles to include as a multiple of the Moving Average Length value set above;
EG: if the Moving Average Length value is set to 22, setting this value to 2 will use the last 22*2 = 44 candles for the collection of volatility distributions
MORE candles being include will generally make the bands WIDER and their size will change SLOWER over time.
I wish you focus, dedication, and earnest success on your journey.
Happy trading :)
RSI Team Synergy | JeffreyTimmermansRSI Team Synergy
The "RSI Team Synergy" indicator is an advanced and highly customizable tool that integrates a Double RSI (DRSI) approach for comprehensive trend and momentum analysis. It utilizes two layers of RSI calculations, along with optional smoothing and various moving average types, to enhance signal accuracy. The dynamic visuals and alerts make this indicator a valuable resource for traders aiming to optimize their strategies.
Key Features
Double RSI (DRSI) Calculation
First RSI (Primary Layer): Captures the core price momentum using a configurable period.
Second RSI (DRSI Layer): Applies a second RSI calculation to the smoothed first RSI, refining signals and amplifying trend accuracy.
Double RSI Formula: Combines the smoothed RSI layers into a single robust indicator that adapts to market conditions.
Smoothing and Advanced Moving Averages
Optional Smoothing: Enables users to reduce noise by applying smoothing to both RSI layers.
Advanced MA Options: Supports multiple MA types, including SMA, EMA, WMA, RMA, DEMA, TEMA, VWMA, ZLEMA, and HMA. These can be applied to tailor the indicator to specific trading conditions.
Separate Configurations: Independent smoothing lengths and types for each RSI layer provide unparalleled customization.
Threshold and Signal System
Long Threshold: Highlights bullish conditions when the Double RSI exceeds the threshold.
Short Threshold: Signals bearish conditions when the Double RSI falls below the threshold.
Directional State: Tracks the overall direction using a state-based signal system (bullish, bearish, or neutral).
Dynamic Visualization
Oscillator Color Coding: Green shades for bullish momentum. Red shades for bearish momentum. Dynamic gradients for smoother transitions.
Glow Effect: Optional glowing lines enhance the visual clarity of the oscillator.
Threshold Lines: Configurable dashed horizontal lines to mark critical levels for easy reference.
Bar Color Integration
Bar Coloring: Matches bar colors to the oscillator's direction for cohesive visualization.
Advanced Control: Toggle bar coloring on/off without affecting other plots.
Alerts
Bullish Signal Alert: Triggers when the Double RSI crosses above the long threshold.
Bearish Signal Alert: Triggers when the Double RSI crosses below the short threshold.
Custom Messages: Alerts are equipped with descriptive messages for actionable insights.
Signal Arrows
Bullish Arrow (↑): Marks upward trends directly on the chart.
Bearish Arrow (↓): Highlights downward trends, ensuring traders never miss an opportunity.
Improvements
Customizable Thresholds: Adjustable long and short thresholds allow traders to fine-tune sensitivity.
Enhanced Smoothing Control: Separate smoothing options for each RSI layer provide flexibility in noise reduction.
Multiple MA Types: Extensive support for advanced moving averages to suit diverse trading preferences.
Color-Coded Oscillator: Improves trend visibility with gradient-based coloring and optional glow effects.
Signal Detection: Clear and intuitive arrows directly on the chart for quick signal interpretation.
Alerts and Notifications: Comprehensive alert conditions keep traders informed in real-time.
Use Cases
Momentum Analysis: Identify sustained bullish or bearish trends using the Double RSI calculation.
Noise Reduction: Utilize smoothing and advanced MA options to remove market noise.
Reversal Detection: Spot potential trend reversals with threshold-based signals.
Customizable Strategies: Tailor the indicator for scalping, swing trading, or long-term analysis.
The RSI Team Synergy indicator combines precision, flexibility, and intuitive design, making it an essential tool for traders at all levels. With its innovative Double RSI approach and advanced customization options, it provides actionable insights for mastering market trends.
This script is inspired by "Clokivez" . However, it is more advanced and includes additional features and options.
-Jeffrey
ATR-Based Suitability CheckerPurpose:
This indicator helps traders identify the most suitable timeframe for trading by comparing fees to market volatility (ATR). Instead of filtering out specific assets or strategies, it focuses on finding optimal trading conditions for the selected timeframe. It is designed to adapt dynamically, ensuring that traders can align their approach with the current market environment.
Key Features:
Dynamic ATR Analysis: Measures volatility using the Average True Range (ATR) and evaluates how fees impact potential profitability across timeframes.
Fee-to-ATR Ratio: Calculates the proportion of fees to ATR, highlighting conditions where fees are too large relative to price movements.
Visual Feedback: **Red Background:** Indicates unsuitable trading conditions where fees dominate. **Green Background:** Highlights suitable conditions for trading efficiency. Markers provide quick visual identification of suitability.
Custom Transparency: Enables users to adjust the background’s transparency for better chart visibility.
How to Use:
Timeframe Optimization: When volatility rises, price movements become larger, making shorter timeframes more suitable for trading. Conversely, during periods of low volatility, longer timeframes are preferable to avoid overtrading within a narrow price range.
Spot & Leverage Trading: For spot trading, this tool identifies conditions where fees (e.g., 0.25%-0.3%) might excessively impact profitability. For instance, if ATR is comparable to fees, the trading environment may not be ideal. In leveraged trading, the indicator helps assess whether the current volatility supports your chosen leverage level, ensuring that leverage does not amplify undue risks.
Efficiency Focus: The indicator emphasizes finding a balance between market conditions and your trading strategy. Not all timeframes need to be "suitable" at all times; instead, it highlights the best opportunities based on current market dynamics. Utilize the suitability ratio across different timeframes to guide and adjust your trading strategies effectively.
Input Parameters:
ATR Length: Defines the period for ATR calculation (default: 14).
Fee Percentage (%): Trading fee as a percentage of the closing price (default: 0.1%).
Unsuitable Threshold (% of 1 ATR): Sets the maximum acceptable fee-to-ATR ratio for suitable conditions (default: 20%).
Background Transparency (0-100): Adjusts the opacity of the background highlight (default: 80).
Who Should Use This:
This tool is ideal for traders seeking to align their strategy with market conditions by finding the most suitable timeframe. It applies to both spot and leveraged markets, helping optimize efficiency while managing fees and volatility.
Notes:
The ATR-Based Suitability Checker is a supplementary tool. Combine it with other forms of analysis for comprehensive decision-making.
Regularly adjust the parameters to match your trading preferences and market conditions.
Consistency Rule CalculatorThis script, titled "Consistency Rule Calculator" is designed for use on the TradingView platform. It allows traders to input specific values related to their account, daily highest profit, and a consistency rule (as a decimal).
The script then calculates the "Amount Needed to Withdraw" based on the user's input. This value is calculated using the formula:
Amount Needed to Withdraw = (Daily Highest Profit/Consistency Rule )+ Account Type
Each prop firm has its own consistency rule. Follow their rule, and you will be second to payout!
Additionally, it displays the input values and the calculated amount in a customizable table on the chart. The table is formatted with colors for clarity, and it provides a motivational quote about successful trading. Plus, user can adjust the table's position on the screen.
Year-over-Year % Change for PCEPILFEHello, traders!
This indicator is specifically for FRED:PCEPILFE , which is a 'Personal Consumption Expenditures (PCE) Index excluding food and energy.'
What this indicator does is compare the monthly data to that of the same month last year to see how it has changed over the year. This comparison method is widely known as YoY(Year-over-Year).
While I made this indicator to use for FRED:PCEPILFE , you may use it for different charts as long as they show monthly data.
FRED:PCEPILFE is one of the main measures of inflation the Federal Reserve uses.
You can see the YoY % change of the PCE Index excluding food and energy in the official website for the Bureau of Labor Statistics, but unfortunately, I couldn't find one in TradingView.
So instead, I decided to make my own indicator showing the changes using FRED:PCEPILFE .
The code is very simple: it compares the data to the data 12 points ago because 12 points would mean 12 months in this chart. We then multiply the result by 100 for percentage.
Doing so, we compare the current month to the same month of the previous year.
Because I am only interested in the YoY % Change of the index, I pulled the indicator all the way up, covering the original chart data entirely. (Or you could achieve the same by simply moving your indicator to the pane above. But this way, the original chart data is also visible.)
I hope this indicator helps you with your analysis. Feel free to ask questions if have any!
God bless!
Compare Symbol [LuxmiAI]This indicator allows users to plot candles or bars for a selected symbol and add a moving average of their choice as an underlay. Users can customize the moving average type and length, making it versatile for a wide range of trading strategies.
This script is designed to offer flexibility, letting traders select the symbol, timeframe, candle style, and moving average type directly from the input options. The moving averages include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Weighted Moving Average (WMA), and Volume-Weighted Moving Average (VWMA).
Features of the Script
This indicator provides the following key features:
1. Symbol Selection: Users can input the ticker symbol for which they want to plot the data.
2. Timeframe Selection: The script allows users to choose a timeframe for the symbol data.
3. Candle Styles: Users can select from three styles - regular candles, bars, or Heikin-Ashi candles.
4. Moving Average Options: Users can choose between EMA, SMA, WMA, and VWMA for added trend analysis.
5. Customizable Moving Average Length: The length of the moving average can be adjusted to suit individual trading strategies.
How the Script Works
The script starts by taking user inputs for the symbol and timeframe. It then retrieves the open, high, low, and close prices of the selected symbol and timeframe using the request.security function. Users can select between three candle styles: standard candles, bars, and Heikin-Ashi candles. If Heikin-Ashi candles are selected, the script calculates the Heikin-Ashi open, high, low, and close values.
To add further analysis capabilities, the script includes a moving average. Traders can select the moving average type from EMA, SMA, WMA, or VWMA and specify the desired length. The selected moving average is then plotted on the chart to provide a clear visualization of the trend.
Step-by-Step Implementation
1. Input Options: The script starts by taking inputs for the symbol, timeframe, candle style, moving average type, and length.
2. Data Retrieval: The script fetches OHLC data for the selected symbol and timeframe using request.security.
3. Candle Style Logic: It determines which candle style to plot based on the user’s selection. If Heikin-Ashi is selected, the script calculates Heikin-Ashi values.
4. Moving Average Calculation: Depending on the user’s choice, the script calculates the selected moving average.
5. Visualization: The script plots the candles or bars and overlays the moving average on the chart.
Benefits of Using This Indicator
This custom indicator provides multiple benefits for traders. It allows for quick comparisons between symbols and timeframes, helping traders identify trends and patterns. The flexibility to choose different candle styles and moving averages enhances its adaptability to various trading strategies. Additionally, the ability to customize the moving average length makes it suitable for both short-term and long-term analysis.
Session Bar/Candle ColoringChange the color of candles within a user-defined trading session. Borders and wicks can be changed as well, not just the body color.
PREFACE
This script can be used an educational resource for those who are interested in learning Pine Script. Therefore, the script is published open source and is organized in a manner that follows the recommended Style Guide .
While the main premise of the indicator is rather simple, the script showcases various things that can be achieved such as conditional plotting, alignment of indicator settings, user input validation, script optimization, and more. The script also has examples of taking into consideration the chart timeframe and/or different chart types (Heikin Ashi, Renko, etc.) that a user might be running it on. Note: for complete beginners, I strongly suggest going through the Pine Script User Manual (possibly more than once).
FEATURES
Besides being able to select a specific time window, the indicator also provides additional color settings for changing the background color or changing the colors of neutral/indecisive candles, as shown in the image below.
This allows for a higher level of customization beyond the TradingView chart settings or other similar scripts that are currently available.
HOW TO USE
First, define the intraday trading session that will contain the candles to modify. The session can be limited to specific days of the week.
Next, select the parts of the candles that should be modified: Body, Borders, Wick, and/or Background.
For each of the candle parts that were enabled, you can select the colors that will be used depending on whether a candle is bullish (⇧), bearish (⇩), or neutral (⇆).
All other indicator settings will have a detailed tooltip to describe its usage and/or effect.
LIMITATIONS
The indicator is not intended to function on Daily or higher timeframes due to the intraday nature of session time windows.
The indicator cannot always automatically detect the chart type being used, therefore the user is requested to manually input the chart type via the " Chart Style " setting.
Depending on the available historical data and the selected choice for the " Portion of bar in session " setting, the indicator may not be able to update very old candles on the chart.
EXAMPLE USAGE
This section will show examples of different scenarios that the indicator can be used for.
Emphasizing a main trading session.
Defining a "Pre/post market hours background" like is available for some symbols (e.g., NASDAQ:AAPL ).
Highlighting in which bar the midnight candle occurs.
Hiding indecision bars (neutral candles).
Showing only "Regular Trading Hours" for a chart that does not have the option to toggle ETH/RTH. To achieve this, the actual chart data is hidden, and only the indicator is visible; alternatively, a 2nd instance of the indicator could change colors to match the chart background.
Using a combination of Bars and Japanese Candlesticks. Alternatively, this could be done by hiding the main chart data and using 2 instances of the indicator (one with " Chart Style " setting as Bars , and the other set to Candles ).
Using a combination of thin and thick bars on Range charts. Note: requires disabling the "Thin Bars" setting for Bar charts in the TradingView chart settings.
NOTES
If using more than one instance of this indicator on the same chart, you can use the TradingView "Save Indicator Template" feature to avoid having to re-configure the multiple indicators at a later time.
This indicator is intended to work "out-of-the-box" thanks to the behind_chart option introduced to Pine Script in October 2024. But you can always manually bring the indicator to the front just in case the color changes are not being seen (using the "More" option in the indicator status line: More > Visual Order > Bring to front ).
Many thanks to fikira for their help and inspiring me to create open source scripts.
Any feedback including bug reports or suggestions for improving the indicator (or source code itself) are always welcome in the comments section.
Trend Force Meter | JeffreyTimmermansTrend Force Meter
The "Trend Force Meter" is an innovative trading tool designed to visualize trend strength and provide precise signals for identifying market dynamics. By combining the Hull Moving Average (HMA) with the Simple Moving Average (SMA), it delivers a comprehensive analysis of trend forces and directions. With customizable smoothing, low-pass filtering, and an advanced color-coded display, this indicator is a valuable addition to any trader's toolkit.
Overview
The Trend Force Meter uses a unique approach to trend analysis by calculating the difference between smoothed HMA and SMA values. This difference is normalized and converted into a visually intuitive gradient to represent bullish and bearish conditions. The indicator also incorporates features for noise reduction and enhanced visualization.
Key Features
Dual Moving Averages
Hull Moving Average (HMA): Provides a highly responsive measure of trend direction and strength.
Simple Moving Average (SMA): Offers a stable and reliable long-term trend baseline.
Customizable Smoothing
Enable/Disable Smoothing: Adjust the sensitivity of the HMA and SMA calculations.
Smoothing Length: Fine-tune the smoothing parameters to match your trading style, balancing between responsiveness and stability.
Low-Pass Filtering
Noise Reduction: Optional low-pass filter reduces market noise, providing clearer trend signals.
Filter Length: Adjustable parameter for fine control over the noise reduction level.
Gradient-Based Visualization
Dynamic Color Coding: Bullish trends are displayed in shades of green, while bearish trends appear in shades of red, providing immediate visual clarity.
Strength Meter: A gradient-based strength meter quantifies the intensity of the current trend, from weak to strong.
Trend Strength Normalization
Normalizes trend strength over a configurable period, ensuring consistent and meaningful readings across various market conditions.
Alerts
Bullish Trend Alert: Notifies when the trend transitions to a bullish phase.
Bearish Trend Alert : Signals when the trend turns bearish.
Enhanced Functionality
Trend Strength Gauge
Displays a real-time strength gauge that visualizes the trend intensity, allowing traders to assess the market at a glance.
Automatically adjusts to reflect normalized trend values, ensuring accuracy across different timeframes and volatility conditions.
Visual Gradient
A refined gradient coloring system dynamically adjusts based on trend direction and intensity, enabling traders to easily interpret market sentiment.
Advanced Customization
Length Settings: Fine-tune HMA and SMA lengths to match specific trading strategies.
Smoothing Options: Toggle smoothing and low-pass filtering on or off as needed.
Gradient Color Range: Provides flexible options for customizing the visual display.
Use Cases
Trend Analysis: Quickly identify the direction and strength of market trends to make informed trading decisions.
Momentum Confirmation : Use the gradient and strength meter to validate potential breakout or reversal scenarios.
Noise Reduction: Employ the low-pass filter to focus on meaningful trends while ignoring short-term market fluctuations.
How It Works
Calculate HMA and SMA: The indicator computes smoothed HMA and SMA values.
Difference Extraction: The difference between the smoothed HMA and SMA forms the core trend signal.
Optional Filtering: Low-pass filtering reduces noise, enhancing the clarity of trend signals.
Normalization: The difference is normalized over the selected period, ensuring consistent scaling.
Visualization: A color-coded gradient and trend strength gauge display the trend’s intensity and direction.
Customization Options
MA Lengths: Adjust the calculation periods for HMA and SMA.
Smoothing and Filtering: Enable or disable smoothing and filtering to refine the signal output.
Color Palette: Choose custom colors to align with personal preferences or trading environments.
Conclusion
The Trend Force Meter is an invaluable addition to any trader’s toolkit, combining cutting-edge techniques with intuitive visuals to make trend analysis more accessible and actionable. Its flexibility and precision cater to various trading strategies, ensuring traders stay ahead of market movements.
This script is inspired by "VanHels1ng" . However, it is more advanced and includes additional features and options.
-Jeffrey
QuantFrame | FractalystWhat’s the purpose of this indicator?
The purpose of QuantFrame is to provide traders with a systematic approach to analyzing market structure, eliminating subjectivity, and enhancing decision-making. By clearly identifying and labeling structural breaks, QuantFrame helps traders:
1. Refine Market Analysis: Transition from discretionary market observation to a structured framework.
2. Identify Key Levels: Highlight important liquidity and invalidation zones for potential entries, exits, and risk management.
3. Streamline Multi-Timeframe Analysis: Track market trends and structural changes across different timeframes seamlessly.
4. Enhance Consistency: Reduce guesswork by following a rule-based methodology for identifying structural breaks.
How Does This Indicator Identify Market Structure?
1. Swing Detection
• The indicator identifies key swing points on the chart. These are local highs or lows where the price reverses direction, forming the foundation of market structure.
2. Structural Break Validation
• A structural break is flagged when a candle closes above a previous swing high (bullish) or below a previous swing low (bearish).
• Break Confirmation Process:
To confirm the break, the indicator applies the following rules:
• Valid Swing Preceding the Break: There must be at least one valid swing point before the break.
3. Numeric Labeling
• Each confirmed structural break is assigned a unique numeric ID starting from 1.
• This helps traders track breaks sequentially and analyze how the market structure evolves over time.
4. Liquidity and Invalidation Zones
• For every confirmed structural break, the indicator highlights two critical zones:
1. Liquidity Zone (LIQ): Represents the structural liquidity level.
2. Invalidation Zone (INV): Acts as Invalidation point if the structure fails to hold.
What do the extremities show us on the charts?
When using QuantFrame for market structure analysis, the extremities—Liquidity Level (LIQ) and Invalidation Level (INV)—serve as critical reference points for understanding price behavior and making informed trading decisions.
Here's a detailed explanation of what these extremities represent and how they function:
Liquidity Level (LIQ)
Definition: The Liquidity Level is a key price zone where the market is likely to retest, consolidate, or seek liquidity. It represents areas where orders are concentrated, making it a high-probability reaction zone.
Purpose: Traders use this level to anticipate potential pullbacks or continuation patterns. It helps in identifying areas where price may pause or reverse temporarily due to the presence of significant liquidity.
Key Insight: If a candle closes above or below the LIQ, it results in another break of structure (BOS) in the same direction. This indicates that price is continuing its trend and has successfully absorbed liquidity at that level.
Invalidation Level (INV)
Definition: The Invalidation Level marks the threshold that, if breached, signifies a structural shift in the market. It acts as a critical point where the current market bias becomes invalid.
Purpose: This level is often used as a stop-loss or re-evaluation point for trading strategies. It ensures that traders have a clear boundary for risk management.
Key Insight: If a candle closes above or below the INV, it signals a shift in market structure:
A closure above the INV in a bearish trend indicates a shift from bearish to bullish bias.
A closure below the INV in a bullish trend indicates a shift from bullish to bearish bias.
What does the top table display?
The top table in QuantFrame serves as a multi-timeframe trend overview. Here’s what it provides:
1. Numeric Break IDs Across Multiple Timeframes:
• Each numeric break corresponds to a confirmed structural break on a specific timeframe, helping traders track the most recent breaks systematically.
2. Trend Direction via Text Color:
• The color of the text reflects the current trend direction:
• Blue indicates a bullish structure.
• Red signifies a bearish structure.
3. Higher Timeframe Insights Without Manual Switching:
• The table eliminates the need to switch between timeframes by presenting a consolidated view of the market trend across multiple timeframes, saving time and improving decision-making.
What is the Multi-Timeframe Trend Score (MTTS)?
MTTS is a score that quantifies trend strength and direction across multiple timeframes.
How does MTTS work?
1. Break Detection:
• Analyzes bullish and bearish structural breaks on each timeframe.
2. Trend Scoring:
• Scores each timeframe based on the frequency and quality of bullish/bearish breaks.
3. MTTS Calculation:
• Averages the scores across all timeframes to produce a unified trend strength value.
How is MTTS interpreted?
• ⬆ (Above 50): Indicates an overall bullish trend.
• ⬇ (Below 50): Suggests an overall bearish trend.
• ⇅ (Exactly 50): Represents a neutral or balanced market structure.
How to Use QuantFrame?
1. Implement a Systematic Market Structure Framework:
• Use QuantFrame to analyze market structure objectively by identifying key structural breaks and marking liquidity (LIQ) and invalidation (INV) zones.
• This eliminates guesswork and provides a clear framework for understanding market movements.
2. Leverage MTTS for Directional Bias:
• Refer to the MTTS table to identify the multi-timeframe directional bias, giving you the broader market context.
• Align your trading decisions with the overall trend or structure to improve accuracy and consistency.
3. Apply Your Preferred Entry Model:
• Once the market context is clear, use your preferred entry model to capitalize on the identified structure and trend.
• Manage trades dynamically as price delivers, using the provided liquidity and invalidation zones for risk management.
What Makes QuantFrame Original?
1. Objective Market Structure Analysis:
• Unlike subjective methods, QuantFrame uses a rule-based approach to identify structural breaks, ensuring consistency and reducing emotional decision-making.
2. Multi-Timeframe Integration:
• The MTTS table consolidates trend data across multiple timeframes, offering a bird’s-eye view of market trends without the need to switch charts manually.
• This unique feature allows traders to align strategies with higher-timeframe trends for more informed decision-making.
3. Liquidity and Invalidation Zones:
• Automatically marks Liquidity (LIQ) and Invalidation (INV) zones for every structural break, providing actionable levels for entries, exits, and risk management.
• These zones help traders define their risk-reward setups with precision.
4. Dynamic Trend Scoring (MTTS):
• The Multi-Timeframe Trend Score (MTTS) quantifies trend strength and direction across selected timeframes, offering a single, consolidated metric for market sentiment.
• This score is visualized with intuitive symbols (⬆, ⬇, ⇅) for quick decision-making.
5. Numeric Labeling of Breaks:
• Each structural break is assigned a unique numeric ID, making it easy to track, analyze, and backtest specific market scenarios.
6. Systematic Yet Flexible:
• While it provides a structured framework for market analysis, QuantFrame seamlessly integrates with any trading style. Traders can use it alongside their preferred entry models, adapting it to their unique strategies.
7. Enhanced Market Context:
• By combining structural insights with directional bias (via MTTS), the indicator equips traders with a complete market context, enabling them to make better-informed decisions.
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.
US Treasury Yields ROC1. Motivation and Context
The yield curve, which represents the relationship between bond yields and their maturities, plays a pivotal role in macroeconomic analysis and market forecasting. Changes in the slope or curvature of the yield curve are often indicative of investor expectations about economic growth, inflation, and monetary policy. For example:
• Steepening curves may indicate economic optimism and rising inflation expectations.
• Flattening curves are often associated with slower growth or impending recessions.
Analyzing these dynamics with quantitative tools such as the rate of change (ROC) enables traders and analysts to identify actionable patterns in the market. As highlighted by Gürkaynak, Sack, and Wright (2007), the term structure of interest rates embeds significant economic information, and understanding its movements is crucial for both policy makers and market participants.
2. Methodology
2.1 Input Parameters
The script takes the following key input:
• ROC Period (roc_length): Determines the number of bars over which the rate of change is calculated. This is an adjustable parameter (14 by default), allowing users to adapt the analysis to different timeframes.
2.2 Data Sources
The yields of the US Treasury securities for different maturities are fetched from TradingView using the request.security() function:
• 2-Year Yield (TVC:US02Y)
• 5-Year Yield (TVC:US05Y)
• 10-Year Yield (TVC:US10Y)
• 30-Year Yield (TVC:US30Y)
These yields are central to identifying trends in short-term versus long-term rates.
2.3 Visualization
Plots: The ROC values for each maturity are plotted in distinct colors for clarity:
• 2Y: Blue
• 5Y: Yellow
• 10Y: Green
• 30Y: Red
Background Highlight: The script uses color-coded backgrounds to visualize the identified curve regimes:
• Bull Steepener: Neon Green
• Bear Steepener: Bright Red
• Bull Flattener: Blue
• Bear Flattener: Orange
2.4 Zero Line
A horizontal zero line is included as a reference point, allowing users to easily identify transitions from negative to positive ROC values, which may signal shifts in the yield curve dynamics.
3. Implications for Financial Analysis
By automating the identification of yield curve dynamics, this script aids in:
• Macroeconomic Forecasting:
Steepeners and flatteners are associated with growth expectations and monetary policy changes. For instance, Bernanke and Blinder (1992) emphasize the predictive power of the yield curve for future economic activity.
• Trading Strategies:
Yield curve steepening or flattening can inform bond market strategies, such as long/short duration trades or curve positioning.
4. References
1. Bernanke, B. S., & Blinder, A. S. (1992). “The Federal Funds Rate and the Channels of Monetary Transmission.” American Economic Review, 82(4), 901–921.
2. Gürkaynak, R. S., Sack, B., & Wright, J. H. (2007). “The U.S. Treasury Yield Curve: 1961 to the Present.” Journal of Monetary Economics, 54(8), 2291–2304.
3. TradingView Documentation. “request.security Function.” Retrieved from TradingView.
Big Whale Finder (BWF)The Big Whale Finder (BWF) indicator is a technical analysis tool designed to detect large, hidden orders in financial markets. These orders, often placed by institutional traders or "whales," are significant in size but executed in a way that minimizes their impact on the market price.
This tool uses volume-based analysis to identify these orders, focusing on the detection of unusual volume spikes occurring in price regions where the market remains stagnant or shows minimal movement. The indicator aims to help traders identify potential areas of institutional activity, providing a strategic advantage by recognizing patterns of hidden liquidity.
Core Logic and Methodology
The BWF indicator combines two key factors to identify potential "whale" activity:
Volume Analysis: The first condition evaluates the volume relative to its average over a defined period. This is done by calculating the Simple Moving Average (SMA) of the volume and comparing current volume levels against this average. When the volume is significantly higher than the historical average, it signals the presence of a potentially large order.
Volume Threshold=Current Volume>(Average Volume×Threshold Factor)
Volume Threshold=Current Volume>(Average Volume×Threshold Factor)
According to market theory, large trades or "whale" activities often require substantial volumes to be executed. Identifying these anomalies can offer insights into the behavior of institutional players who seek to execute large transactions without disturbing the market (Lo, 2004).
Price Movement Analysis: The second condition considers the price change in relation to the volume. Specifically, if high volumes are detected but the price remains relatively stable, this suggests that large orders are being executed without significantly impacting the market price.
This phenomenon often occurs in "liquidity pools" or through algorithms designed to mask the true size of the orders. The indicator uses a price change threshold to identify this stagnation, with the condition that price movement remains below a certain percentage threshold.
Price Stagnation=(∣Close−Open∣Open)<Price Change Threshold
Price Stagnation=(Open∣Close−Open∣)<Price Change Threshold
This principle is aligned with research on market microstructure, which suggests that large institutional orders often attempt to hide their true size to avoid influencing the market (Hasbrouck, 1991).
Practical Use and Benefits
The Big Whale Finder (BWF) indicator is useful for identifying zones where large, potentially hidden orders are being executed. Traders often seek to detect these areas to better understand market dynamics and anticipate price movements. The benefits of using such an indicator include:
Increased Market Awareness: By identifying areas of high volume with minimal price movement, traders can spot potential "whale" activity that may indicate significant institutional involvement. These hidden large orders are not immediately visible in the market price, but their impact can become evident over time (Kyle, 1985).
Strategic Entry and Exit Points: Identifying areas with hidden liquidity can help traders make more informed decisions about where to enter or exit positions. A large institutional order may signal strong interest in a specific price level, and understanding this can guide strategic decisions regarding support and resistance levels.
Mitigating Price Impact: Knowing where these large orders are placed can also assist traders in avoiding price levels where they are more likely to face slippage. For instance, avoiding areas where whales are accumulating or distributing assets may help reduce the risk of unfavorable price movements.
Scientific Foundations and References
The underlying logic of this indicator draws heavily on established theories in market microstructure and behavioral finance, particularly the concept of hidden liquidity and information asymmetry. Market participants, especially institutional traders, frequently employ strategies to hide the true size of their orders to avoid influencing the market (Hasbrouck, 1991). These strategies include the use of dark pools, where large trades are executed privately and away from public view, and algorithmic trading systems that spread large orders across multiple price levels to minimize market impact (Lobel, 2012).
Research has shown that understanding these hidden liquidity dynamics can give traders a significant edge. For example, Hasbrouck (1991) emphasized that large, hidden orders may signal upcoming price trends, as they often precede significant market moves. Similarly, Lo (2004) highlighted that institutional traders' strategies to hide orders are a critical factor in market behavior, suggesting that the ability to detect these activities could enhance trading strategies.
Conclusion
The Big Wale Finder (BWF) indicator provides a powerful tool for identifying areas where large orders are being executed without significantly impacting the price. By analyzing volume and price stagnation, it helps traders uncover hidden liquidity, which is critical for anticipating potential price movements. This indicator's effectiveness lies in its ability to detect "whale" activity, offering traders insights into the actions of institutional market participants. Understanding and leveraging these insights can provide a strategic advantage in the highly competitive and information-rich landscape of financial markets.
References
Hasbrouck, J. (1991). Measuring the Information Content of Stock Trades. Journal of Finance, 46(1), 179-207.
Kyle, A. S. (1985). Continuous Auctions and Insider Trading. Econometrica, 53(6), 1315-1335.
Lo, A. W. (2004). The Adaptive Markets Hypothesis: Market Efficiency from an Evolutionary Perspective. Journal of Portfolio Management, 30(5), 15-29.
Lobel, S. (2012). Dark Pools, Price Discovery, and Market Liquidity. The Journal of Trading, 7(1), 35-42.
Improved Trend Shot | JeffreyTimmermansImproved Trend Shot
The "Improved Trend Shot" is an advanced trend-following tool that integrates cutting-edge features and the principles of John Ehlers’ SuperSmoother Filter to provide traders with more accurate trend detection and better decision-making. This enhanced version includes multiple smoothing types, customizable lengths, dynamic alerts, and a comprehensive dashboard to help traders quickly interpret market conditions.
This script is inspired by "TRW" . However, it is more advanced and includes additional features and options.
Key Features and Improvements
Smoothed Lines and Trend Detection
The core of the Improved Smooth Trend Shot relies on three key lines to capture market momentum:
Fast Line: Highly sensitive to short-term price changes, offering rapid responsiveness to market movements.
Middle Line: Provides a medium-term view of market trends, acting as a more stable reference.
Slow Line: Focuses on long-term trends, offering a broader perspective on market direction.
These three smoothed lines interact dynamically to create a visual color-coded cloud that helps traders easily interpret market conditions:
Green Cloud: Indicates an upward trend when the Fast line is above the Slow line.
Red Cloud: Signals a downward trend when the Fast line is below the Slow line.
The cloud color adjusts based on the relative positioning of the Fast, Middle, and Slow lines, helping traders to identify bullish or bearish trends with ease.
Dynamic Cloud Visualization and Alerts
The cloud and trend lines adapt to market conditions, updating in real-time to reflect changes in trend strength and momentum. Traders can also set up real-time alerts to notify them of important trend shifts, such as:
Fast and Slow Crossovers: Alerts when the Fast line crosses the Slow line.
Middle and Slow Crossovers: Alerts when the Middle line crosses the Slow line.
This makes it easier to capture trading opportunities and respond promptly to market changes.
Enhanced Smoothing Options
Traders can now choose from multiple smoothing types, including:
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
DEMA (Double Exponential Moving Average)
WMA (Weighted Moving Average)
Each smoothing type has different properties, allowing traders to select the best fit for their trading style. The smoothing length can also be customized, offering flexibility in fine-tuning how sensitive or stable the trend lines should be.
Improved Signal Logic and Precision
The signal logic has been optimized for better precision. Now, the system provides more accurate buy and sell alerts based on:
Trend Detection: The color-coded cloud and the relative positions of the Fast, Middle, and Slow lines help visualize whether the trend is bullish or bearish.
Rising and Falling Indicators: The indicator also checks if each line is rising or falling over the last three bars, offering early signals of momentum shifts.
Dashboard Insights
The dashboard provides real-time updates on the positions and movements of the smoothed lines:
Line Positions: Displays the positions of the Fast, Middle, and Slow lines.
Trend Direction: Shows whether each line is rising or falling.
Price Levels: Displays the price levels for each of the smoothed lines, offering clear reference points for market evaluation.
These features help traders better understand the state of the market, offering valuable insights for both trend-following and reversal-based strategies.
Crossovers and Signal Triggers
The Improved Smooth Trend Shot focuses on crossovers between the different smoothed lines as primary trading signals. There are two types of crossovers:
Fast Shots: This occurs when the Fast line crosses the Slow line.
Slow Shots: This occurs when the Middle line crosses the Slow line.
These crossovers serve as key entry or exit points for traders, helping them spot potential trend reversals. The improved logic ensures that crossovers are accurately detected, reducing the chances of false signals.
Customization Options
The Improved Smooth Trend Shot offers a high degree of customization:
Smoothing Length: Adjust the smoothing period to balance between fast responses and stable trends.
Source Selection: Default to the average of high and low prices (hl2), or choose other price sources.
Smoothing Type: Select from EMA, SMA, DEMA, or WMA for personalized trend analysis.
Signal Type: Choose between Fast Shots or Slow Shots based on the type of crossover you want to focus on.
Long, Medium, and Short-Term Applications
Although the default settings are optimized for long-term trend analysis, the Improved Smooth Trend Shot is highly adaptable. By adjusting the smoothing length and selecting different smoothing types, traders can use the tool for:
Short-Term Trading: Focus on fast responses to market shifts using shorter smoothing periods.
Medium-Term Trading: Tailor the settings to capture intermediate trends.
Long-Term Trend Analysis: Use longer smoothing periods for a more stable and comprehensive view of market dynamics.
Advanced ATR Filtering and Alerts
The inclusion of ATR (Average True Range) filtering helps ensure that signals are triggered only when significant price movements occur. This helps reduce noise and false signals, ensuring traders only act on meaningful market shifts.
Conclusion
The Improved Smooth Trend Shot is a powerful and versatile tool that enhances the original SuperSmoother Filter with advanced features like customizable smoothing options, real-time alerts, and an intuitive dashboard. Whether you're a day trader, swing trader, or long-term investor, this enhanced indicator provides a comprehensive and actionable view of market trends.
The combination of enhanced signal accuracy, dynamic trend visualization, and in-depth customization ensures that the Improved Smooth Trend Shot is an indispensable tool for traders across all market conditions.
-Jeffrey
Drawdown Tracker [SpokoStocks]Drawdown Tracker
The Drawdown Tracker is a powerful tool designed to help traders monitor and visualize the drawdown of symbol. By tracking both current and maximum drawdown levels, this indicator provides valuable insights into risk and potential capital preservation.
Features:
> Current Drawdown:
The current drawdown is calculated as the percentage drop from the record high to the current low, providing a real-time view of the loss from the peak.
> Maximum Drawdown:
The maximum drawdown represents the deepest drop observed from any peak in the historical data, giving an understanding of the worst-case scenario for losses.
> You can choose between two modes:
Full History: Tracks the maximum drawdown from the entire available data.
Rolling Period: Tracks the maximum drawdown within a defined rolling period (default 50 bars), allowing for a shorter-term risk assessment.
> Customizable Rolling Period:
You can adjust the rolling period length through the Rolling Period Length input to reflect different time frames for drawdown calculations.
> Warning Level:
A customizable warning level (default -65%) is plotted on the chart. This acts as a threshold to alert users when the drawdown crosses into a potentially concerning territory.
> Gradient Color Visualization:
The current drawdown is visualized using a gradient color, transitioning from red to yellow as the drawdown increases from -100% to 0%, providing an easy-to-interpret view of the severity of the drawdown.
> New Max Drawdown Marker:
Whenever a new maximum drawdown is recorded, a triangle marker is displayed at the bottom of the chart, along with a label showing the drawdown percentage. This provides clear visual confirmation when a new historical low is reached.
> Alerts:
Warning Level Breach Alert: Alerts you when the drawdown breaches the warning level you’ve set, helping you stay aware of significant risk events.
New Max Drawdown Alert: Triggers when a new maximum drawdown is recorded, allowing you to act quickly if necessary.
Use Cases:
Risk Management: Keep track of how much an asset is down from the peak, helping you make informed decisions about risk and drawdown tolerances.
Risk Disclaimer:
The information provided by this script is for educational and informational purposes only. It is not intended as financial advice and should not be construed as such. All trading and investment activities involve a high level of risk and may result in the loss of capital. The user is solely responsible for any decisions made based on the content provided by this script.
By using this script, you acknowledge and agree that you use it at your own risk. The creator of this script makes no warranties regarding the accuracy, completeness, or reliability of the information, and disclaims any responsibility for any losses or damages arising from its use.
Always conduct your own research and consult with a qualified financial advisor before making any investment decisions.
MMXM ICT [TradingFinder] Market Maker Model PO3 CHoCH/CSID + FVG🔵 Introduction
The MMXM Smart Money Reversal leverages key metrics such as SMT Divergence, Liquidity Sweep, HTF PD Array, Market Structure Shift (MSS) or (ChoCh), CISD, and Fair Value Gap (FVG) to identify critical turning points in the market. Designed for traders aiming to analyze the behavior of major market participants, this setup pinpoints strategic areas for making informed trading decisions.
The document introduces the MMXM model, a trading strategy that identifies market maker activity to predict price movements. The model operates across five distinct stages: original consolidation, price run, smart money reversal, accumulation/distribution, and completion. This systematic approach allows traders to differentiate between buyside and sellside curves, offering a structured framework for interpreting price action.
Market makers play a pivotal role in facilitating these movements by bridging liquidity gaps. They continuously quote bid (buy) and ask (sell) prices for assets, ensuring smooth trading conditions.
By maintaining liquidity, market makers prevent scenarios where buyers are left without sellers and vice versa, making their activity a cornerstone of the MMXM strategy.
SMT Divergence serves as the first signal of a potential trend reversal, arising from discrepancies between the movements of related assets or indices. This divergence is detected when two or more highly correlated assets or indices move in opposite directions, signaling a likely shift in market trends.
Liquidity Sweep occurs when the market targets liquidity in specific zones through false price movements. This process allows major market participants to execute their orders efficiently by collecting the necessary liquidity to enter or exit positions.
The HTF PD Array refers to premium and discount zones on higher timeframes. These zones highlight price levels where the market is in a premium (ideal for selling) or discount (ideal for buying). These areas are identified based on higher timeframe market behavior and guide traders toward lucrative opportunities.
Market Structure Shift (MSS), also referred to as ChoCh, indicates a change in market structure, often marked by breaking key support or resistance levels. This shift confirms the directional movement of the market, signaling the start of a new trend.
CISD (Change in State of Delivery) reflects a transition in price delivery mechanisms. Typically occurring after MSS, CISD confirms the continuation of price movement in the new direction.
Fair Value Gap (FVG) represents zones where price imbalance exists between buyers and sellers. These gaps often act as price targets for filling, offering traders opportunities for entry or exit.
By combining all these metrics, the Smart Money Reversal provides a comprehensive tool for analyzing market behavior and identifying key trading opportunities. It enables traders to anticipate the actions of major players and align their strategies accordingly.
MMBM :
MMSM :
🔵 How to Use
The Smart Money Reversal operates in two primary states: MMBM (Market Maker Buy Model) and MMSM (Market Maker Sell Model). Each state highlights critical structural changes in market trends, focusing on liquidity behavior and price reactions at key levels to offer precise and effective trading opportunities.
The MMXM model expands on this by identifying five distinct stages of market behavior: original consolidation, price run, smart money reversal, accumulation/distribution, and completion. These stages provide traders with a detailed roadmap for interpreting price action and anticipating market maker activity.
🟣 Market Maker Buy Model
In the MMBM state, the market transitions from a bearish trend to a bullish trend. Initially, SMT Divergence between related assets or indices reveals weaknesses in the bearish trend. Subsequently, a Liquidity Sweep collects liquidity from lower levels through false breakouts.
After this, the price reacts to discount zones identified in the HTF PD Array, where major market participants often execute buy orders. The market confirms the bullish trend with a Market Structure Shift (MSS) and a change in price delivery state (CISD). During this phase, an FVG emerges as a key trading opportunity. Traders can open long positions upon a pullback to this FVG zone, capitalizing on the bullish continuation.
🟣 Market Maker Sell Model
In the MMSM state, the market shifts from a bullish trend to a bearish trend. Here, SMT Divergence highlights weaknesses in the bullish trend. A Liquidity Sweep then gathers liquidity from higher levels.
The price reacts to premium zones identified in the HTF PD Array, where major sellers enter the market and reverse the price direction. A Market Structure Shift (MSS) and a change in delivery state (CISD) confirm the bearish trend. The FVG then acts as a target for the price. Traders can initiate short positions upon a pullback to this FVG zone, profiting from the bearish continuation.
Market makers actively bridge liquidity gaps throughout these stages, quoting continuous bid and ask prices for assets. This ensures that trades are executed seamlessly, even during periods of low market participation, and supports the structured progression of the MMXM model.
The price’s reaction to FVG zones in both states provides traders with opportunities to reduce risk and enhance precision. These pullbacks to FVG zones not only represent optimal entry points but also create avenues for maximizing returns with minimal risk.
🔵 Settings
Higher TimeFrame PD Array : Selects the timeframe for identifying premium/discount arrays on higher timeframes.
PD Array Period : Specifies the number of candles for identifying key swing points.
ATR Coefficient Threshold : Defines the threshold for acceptable volatility based on ATR.
Max Swing Back Method : Choose between analyzing all swings ("All") or a fixed number ("Custom").
Max Swing Back : Sets the maximum number of candles to consider for swing analysis (if "Custom" is selected).
Second Symbol for SMT : Specifies the second asset or index for detecting SMT divergence.
SMT Fractal Periods : Sets the number of candles required to identify SMT fractals.
FVG Validity Period : Defines the validity duration for FVG zones.
MSS Validity Period : Sets the validity duration for MSS zones.
FVG Filter : Activates filtering for FVG zones based on width.
FVG Filter Type : Selects the filtering level from "Very Aggressive" to "Very Defensive."
Mitigation Level FVG : Determines the level within the FVG zone (proximal, 50%, or distal) that price reacts to.
Demand FVG : Enables the display of demand FVG zones.
Supply FVG : Enables the display of supply FVG zones.
Zone Colors : Allows customization of colors for demand and supply FVG zones.
Bottom Line & Label : Enables or disables the SMT divergence line and label from the bottom.
Top Line & Label : Enables or disables the SMT divergence line and label from the top.
Show All HTF Levels : Displays all premium/discount levels on higher timeframes.
High/Low Levels : Activates the display of high/low levels.
Color Options : Customizes the colors for high/low lines and labels.
Show All MSS Levels : Enables display of all MSS zones.
High/Low MSS Levels : Activates the display of high/low MSS levels.
Color Options : Customizes the colors for MSS lines and labels.
🔵 Conclusion
The Smart Money Reversal model represents one of the most advanced tools for technical analysis, enabling traders to identify critical market turning points. By leveraging metrics such as SMT Divergence, Liquidity Sweep, HTF PD Array, MSS, CISD, and FVG, traders can predict future price movements with precision.
The price’s interaction with key zones such as PD Array and FVG, combined with pullbacks to imbalance areas, offers exceptional opportunities with favorable risk-to-reward ratios. This approach empowers traders to analyze the behavior of major market participants and adopt professional strategies for entry and exit.
By employing this analytical framework, traders can reduce errors, make more informed decisions, and capitalize on profitable opportunities. The Smart Money Reversal focuses on liquidity behavior and structural changes, making it an indispensable tool for financial market success.
Stop Loss & Take Profit LevelsCalculate and Plot Stop Loss (SL) Levels:
The indicator calculates the Stop Loss price level based on the account balance, risk percentage, and the trade's entry price.
For long positions, the SL is below the entry price.
For short positions, the SL is above the entry price.
Calculate and Plot Take Profit (TP) Levels:
The indicator calculates up to three Take Profit (TP) levels, each based on different Risk/Reward (R:R) ratios.
The R:R ratio determines how much reward (profit) you aim to achieve relative to the risk (the distance between the entry price and the stop loss).
These TP levels are plotted on the chart as lines above the entry price for long positions or below the entry price for short positions.
Manual Entry Price:
The user can input a manual entry price to simulate trades or plan trades before entering the market. This makes it useful for pre-trade analysis.
Dynamic Position Type:
Users can toggle between Long or Short positions:
Long Position: The trader expects the price to go up.
Short Position: The trader expects the price to go down.
The indicator adapts its calculations (SL and TP levels) based on the selected position type.
Risk Calculation Based on Account Balance:
The indicator calculates the amount of capital at risk (in €) based on the trader's account balance and the selected risk percentage.
For example:
If the account balance is €1,000 and the Stop Loss percentage is 1%, the risk amount is €10.
Visual Representation on the Chart:
The following levels are plotted on the chart:
Stop Loss Level (Red Line): The price level at which the trader would exit the trade to limit losses.
Take Profit Levels (Green Lines): Up to three price levels where the trader could take profits based on R:R ratios.
Entry Price (Blue Line): The price level where the trade begins.
These lines are dynamically updated as inputs are changed, providing instant feedback to the trader.