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 :)
Penunjuk dan strategi
Onky's DikFat Supreme Supply and Demand Onky's DikFat Supreme Supply and Demand is an essential tool for traders looking to harness the power of Supply and Demand Trading , a strategy based on the fundamental market principle that prices increase when demand exceeds supply and decrease when supply surpasses demand. This indicator helps you pinpoint key Supply and Demand Zones on the chart, acting as high-probability areas for potential market reversals.
Introduction to Supply and Demand Trading
Supply and demand trading is one of the most powerful approaches used by traders across all financial markets, from stocks to forex to commodities. It works on the idea that prices will naturally rise when there is more demand than supply, and fall when there is more supply than demand. Understanding where these zones lie on the chart is critical for making profitable trades. By identifying key support and resistance levels driven by these forces, traders can anticipate price movements with high accuracy.
Benefits of Using Supply & Demand Trading:
Simple Trading Approach : Focus on market structure rather than complex indicators.
High-Probability Trading Setups : Recognize zones where price is likely to reverse.
Minimal Indicators Required : The strategy works on pure price action.
Works Across All Markets : Supply and demand principles apply to stocks, forex, and commodities.
High Accuracy : When implemented correctly, it offers a high degree of precision.
Whether you are just starting or looking to refine your strategy, understanding how to identify supply and demand zones can greatly improve your trading decisions. Here’s how you can begin:
Step 1: Identify Supply and Demand Zones
Before entering trades, it's essential to first identify the Supply and Demand Zones on your chart. These zones act as key support and resistance levels where price is likely to reverse.
Supply Zone : This represents an area where selling pressure exceeds buying pressure, causing the price to drop.
Demand Zone : This marks an area where buying pressure exceeds selling pressure, driving the price upwards.
These zones are crucial for spotting potential turning points in the market. Using Onky's DikFat Supreme Supply and Demand indicator, supply and demand zones are automatically detected, helping you to identify these key levels with ease. The indicator highlights these zones with specific color coding, allowing you to quickly see where price might reverse based on historical price action.
Step 2: Confirm Your Entry and Exit
Once you've identified the supply and demand zones, confirmation is key before entering any trades.
Entry Confirmation :
Look for additional technical indicators and patterns that signal a strong trade setup:
Candlestick Patterns : Bullish engulfing, Piercing Line, and other reversal patterns.
Chart Patterns : Double bottom, Head and Shoulders, and other formations that suggest a market shift.
Momentum Indicators : Use tools like MACD and RSI to confirm the strength of the trend.
Exit Confirmation :
Plan your exits with discipline to maximize your profits and minimize losses:
Stop Loss : Always place stop losses just outside of the supply or demand zone.
Exit Strategies :
Close part of the position at 2x risk and move stop loss to breakeven.
Trail stops below the previous support or resistance levels.
Close the full position using reversal candlestick patterns.
Step 3: Use Effective Risk Management
Incorporating effective Risk Management practices is essential for long-term success in supply and demand trading. Even with a high-probability edge, managing your risk ensures that you protect your capital and make more informed decisions.
Risk Management Best Practices :
Risk 1%-3% Per Trade : For a $10,000 account, risk only $100-$300 per trade.
Position Sizing : Stick to position sizes appropriate for your account size to manage risk effectively.
Set Stop Loss Orders : Always manage your risk with clearly defined stop losses.
Control Emotions : Avoid overtrading, revenge trading, and excessive confidence. Stick to your plan.
By combining supply and demand zones with solid risk management, you can confidently trade the markets and grow your account over time.
Start Applying Supply and Demand
Now that you understand the basics, you can begin applying Supply and Demand trading using the Onky's DikFat Supreme Supply and Demand indicator to detect key zones and high-probability setups. Here’s how to start:
Identify Fresh Supply and Demand Levels : Use the indicator to automatically find the most relevant zones.
Confirm Setups with Additional Signals : Use candlestick patterns, momentum indicators, and chart patterns for entry confirmation.
Manage Risk on Every Trade : Always use proper risk management to ensure you’re protecting your capital.
As you become more proficient in identifying and trading these zones, you will enhance your trading strategy and improve your consistency. Implementing these practices early on will help you grow as a trader and achieve long-term success.
Additional Resources
Price Action and Supply and Demand : A deeper dive into how price action complements supply and demand analysis.
Supply and Demand Trading - The Ultimate Guide : A comprehensive guide to mastering supply and demand trading techniques.
Advanced Supply and Demand Zones : Learn to identify more complex supply and demand zones for greater trading precision.
With the right education, dedication, and a focus on proper risk management, you can successfully trade based on supply and demand principles, no matter your experience level.
3 Candle AlertThis is a test for integration using a webhook. I am publishing it so I can share it. Ultimately, this is what we want to do:
1. Trade Entry Rules:
Wait until at least the 3rd bar of the day (15 minutes after market open) before entering the first trade.
Order of Priority for Entry:
Look for two consecutive volume bars of the same color (the second bar must have higher volume than the first).
Look for a “price push” beyond the high or low of the day (as determined in the first 15 minutes).
2. Trading Direction:
If the volume bars are RED, I take a Long Position.
If the volume bars are GREEN, I take a Short Position.
Quasimodo PatternWhat is a Quasimodo Pattern?
A Quasimodo Pattern is a chart pattern traders look for to predict possible price reversals in the market:
- Bullish Quasimodo: Signals a possible price increase (buying opportunity).
- Bearish Quasimodo: Signals a potential price decrease (selling opportunity).
How the Script Works
1. Bullish Quasimodo:
- Checks if the price pattern shows signs of a potential upward movement:
- The current low price is higher than a previous price point (suggesting fair value gap).
- The previous candle closed higher than it opened (bullish candle).
- The candle before that closed lower than it opened (bearish candle).
2. Bearish Quasimodo:
- Looks for signs of a downward movement:
- The current high price is lower than a previous price point (suggesting fair value gap).
- The previous candle closed lower than it opened (bearish candle).
- The candle before that closed higher than it opened (bullish candle).
Visual Indicators
- Yellow Candles: Indicate a bullish Quasimodo pattern.
- Pink Candles: Indicate a bearish Quasimodo pattern.
Alerts
If a Quasimodo pattern is detected, the script sends an alert:
- The alert says: "A Quasimodo Pattern has appeared!"
Purpose
Traders can use this tool to quickly spot potential trend changes without manually analyzing every chart, saving time and improving decision-making for trades.
It Screams When Crypto BottomsGet ready to ride the crypto rollercoaster with your new favourite tool for catching Bitcoin at its juiciest, most oversold moments.
This isn’t just another boring indicator — it screams when it’s time to load your bags and get ready for the ride back up!
Expect it to scream just once or twice per cycle at the very bottom, so you know exactly when the party starts!
Why You'll Love It:
Crypto-Exclusive Magic: It does not really matter what chart you are on; this indicator only bothers about the original and realised market cap of BTC. We all know the rest will follow.
Big Picture Focus: Designed for daily. No noisy intraday drama — just pure, clear signals.
Screaming Alerts: When the signal hits, it’s like a neon sign screaming, “Crypto Bottomed!"
Think of this indicator as your backstage pass to the crypto world’s most dramatic moments. It’s not subtle — it’s bold, loud, and ready to help you time the market like a pro.
P.S.: Use it only on a daily chart. Don’t even try it on shorter timeframes — it won’t scream, and you’ll miss the show! 🙀
GANN Level (Salil Sir)GANN Level Indicator Description
This Pine Script calculates and plots Gann Levels based on a user-defined price input. It creates horizontal lines at key support and resistance levels derived from the input price, applying Gann's theory of market structure. The levels are dynamically calculated and squared for enhanced precision.
Key Features:
Manual Price Input:
The user inputs a round off of square root of base price (Manual_Input), which serves as the foundation for calculations.
Support and Resistance Levels:
Six resistance levels (R1 to R6) and six support levels (S1 to S6) are calculated by incrementing or decrementing the base price in steps of 0.25.
Squared Levels:
Each level is squared (level^2) to align with Gann's mathematical principles.
Visualization:
All levels, including the base price squared (GANN), are plotted as horizontal dotted lines:
Black Line: Base price squared (Gann Level).
Green Lines: Resistance levels.
Red Lines: Support levels.
Purpose:
The indicator helps traders identify potential support and resistance zones based on Gann's methodology, providing a mathematical framework for decision-making.
Usage:
Adjust the Manual Price in the settings to the desired value.
Observe the plotted levels for key support and resistance zones on the chart.
Use these levels to make informed trading decisions or to validate other indicators.
Rolling Angled Volume Profile [Trendoscope®]🎲 Volume Profile Indicators
🎯Traditional Volume Profile
Volume profile indicators visually represent the distribution of volume across price levels. These indicators typically operate on horizontal price levels, making them effective in identifying supply and demand zones in ranging markets. However, they are less useful in trending markets where price movements follow a slope.
🎯The Need for Angled Volume Profiles
Just as support and resistance levels differ from trendlines, volume profile indicators require an equivalent method to account for volume distribution along a sloped trajectory. This would enable more accurate volume analysis in trending markets.
We identified the need of Angled Volume profile and have already published few indicators that implements the concept.
Angled Volume Profile calculates volume distribution along a slope. Users interact with the indicator by selecting the starting point, after which the volume profile is calculated for the selected trajectory.
Volume Forks is another tool that extends angled volume profile analysis, aligning volume profiles along the trajectory of pitchforks.
🎲 Rolling Volume Profile Indicator
The Rolling Volume Profile offers a new approach to angled volume profile calculations, addressing some limitations of earlier implementations:
🎯 Rolling Calculation
The volume profile is calculated for the last N bars of the instrument
The slope of the profile lines is determined by the closing prices of the starting and ending bars
Profiles are drawn in the direction of price movement between the start and end bars.
🎯 Dynamic Updates
As new bars are added, the calculations are updated, and the profile is redrawn based on the latest data.
This dynamic behavior earns it the name "Rolling Volume Profile."
🎯 Advantages Over Earlier Versions
Unlimited Profile Lines : Unlike previous implementations limited to 500 profile lines, this indicator uses polyline objects, overcoming the restriction.
Live Updates : Previous angled volume profile tools lacked real-time updates when new bars appeared. This limitation is resolved in the Rolling Volume Profile Indicator.
The Rolling Volume Profile provides an efficient and scalable solution for analyzing volume in trending markets.
🎯 Indicator Settings
Simple settings include few customisable options
Xmaster Formula Indicator [TradingFinder] No Repaint Strategies🔵 Introduction
The Xmaster Formula Indicator is a powerful tool for forex trading, combining multiple technical indicators to provide insights into market trends, support and resistance levels, and price reversals. Developed in the early 2010s, it is widely valued for generating reliable buy and sell signals.
Key components include Exponential Moving Averages (EMA) for identifying trends and price momentum, and MACD (Moving Average Convergence Divergence) for analyzing trend strength and direction.
The Stochastic Oscillator and RSI (Relative Strength Index) enhance accuracy by signaling potential price reversals. Additionally, the Parabolic SAR assists in identifying trend reversals and managing risk.
By integrating these tools, the Xmaster Formula Indicator provides a comprehensive view of market conditions, empowering traders to make informed decisions.
🔵 How to Use
The Xmaster Formula Indicator offers two distinct methods for generating signals: Standard Mode and Advance Mode. Each method caters to different trading styles and strategies.
Standard Mode :
In Standard Mode, the indicator uses normalized moving average data to generate buy and sell signals. The difference between the short-term (10-period) and long-term (38-period) EMAs is calculated and normalized to a 0-100 scale.
Buy Signal : When the normalized value crosses above 55, accompanied by the trend line turning green, a buy signal is generated.
Sell Signal : When the normalized value crosses below 45, and the trend line turns red, a sell signal is issued.
This mode is simple, making it ideal for traders looking for straightforward signals without the need for additional confirmations.
Advance Mode :
Advance Mode combines multiple technical indicators to provide more detailed and robust signals.
This method analyzes trends by incorporating :
🟣 MACD
Buy Signal : When the MACD histogram bars are positive.
Sell Signal : When the MACD histogram bars are negative.
🟣 RSI
Buy Signal : When RSI is below 30, indicating oversold conditions.
Sell Signal : When RSI is above 70, suggesting overbought conditions.
🟣 Stochastic Oscillator
Buy Signal : When Stochastic is below 20.
Sell Signal : When Stochastic is above 80.
🟣 Parabolic SAR
Buy Signal : When SAR is below the price.
Sell Signal : When SAR is above the price.
A signal is generated in Advance Mode only when all these indicators align :
Buy Signal : All conditions point to a bullish trend.
Sell Signal : All conditions indicate a bearish trend.
This mode is more comprehensive and suitable for traders who prefer deeper analysis and stronger confirmations before executing trades.
🔵 Settings
Method :
Choose between "Standard" and "Advance" modes to determine how signals are generated. In Standard Mode, signals are based on normalized moving average data, while in Advance Mode, signals rely on the combination of MACD, RSI, Stochastic Oscillator, and Parabolic SAR.
Moving Average Settings :
Short Length : The period for the short-term EMA (default is 10).
Mid Length : The period for the medium-term EMA (default is 20).
Long Length : The period for the long-term EMA (default is 38).
MACD Settings :
Fast Length : The period for the fast EMA in the MACD calculation (default is 12).
Slow Length : The period for the slow EMA in the MACD calculation (default is 26).
Signal Line : The signal line period for MACD (default is 9).
Stochastic Settings :
Length : The period for the Stochastic Oscillator (default is 14).
RSI Settings :
Length : The period for the Relative Strength Index (default is 14).
🔵 Conclusion
The Xmaster Formula Indicator is a versatile and reliable tool for forex traders, offering both simplicity and advanced analysis through its Standard and Advance modes. In Standard Mode, traders benefit from straightforward signals based on normalized moving average data, making it ideal for quick decision-making.
Advance Mode, on the other hand, provides a more detailed analysis by combining multiple indicators like MACD, RSI, Stochastic Oscillator, and Parabolic SAR, delivering stronger confirmations for critical market decisions.
While the Xmaster Formula Indicator offers valuable insights and reliable signals, it is important to use it alongside proper risk management and other analytical methods. By leveraging its capabilities effectively, traders can enhance their trading strategies and achieve better outcomes in the dynamic forex market.
VWAP Fibonacci Bands (Zeiierman)█ Overview
The VWAP Fibonacci Bands is a sophisticated yet user-friendly indicator designed to assist traders in visualizing market trends, volatility, and potential support/resistance levels. Developed by Zeiierman, this tool integrates the MIDAS (Market Interpretation Data Analysis System) methodology with Standard Deviation Bands and user-defined Fibonacci levels to provide a comprehensive market analysis framework.
This indicator is built for traders who want a dynamic and customizable approach to understanding market movements, offering features that adapt to varying market conditions. Whether you're a scalper, swing trader, or long-term investor.
█ How It Works
⚪ Anchor Point System
The indicator begins its calculations based on an anchor point, which can be set to:
A specific date for historical analysis or alignment with significant market events.
A timeframe-based reset, dynamically restarting calculations at the beginning of each selected period (e.g., daily, weekly, or monthly).
This dual-anchor method ensures flexibility, allowing the indicator to align with various trading strategies.
⚪ MIDAS Calculation
The MIDAS calculation is central to this indicator. It uses cumulative price and volume data to compute a volume-weighted average price (VWAP), offering a trendline that reflects the true value weighted by trading activity.
⚪ Standard Deviation Bands
The upper and lower bands are calculated using the standard deviation of price movements around the MIDAS line.
⚪ Fibonacci Levels
User-defined Fibonacci ratios are used to plot additional support and resistance levels between the bands. These levels provide visual cues for potential price reversals or trend continuations.
█ How to Use
⚪ Trend Identification
Uptrend: The price remains above the MIDAS line.
Downtrend: The price stays below the MIDAS line and aligns with the lower bands.
⚪ Support and Resistance
The upper and lower bands act as support and resistance levels.
Fibonacci levels provide intermediate zones for potential price reversals.
⚪ Volatility Analysis
Wider bands indicate periods of high volatility.
Narrower bands suggest low-volatility conditions, often preceding breakouts.
⚪ Overbought/Oversold Conditions
Look for the price beyond the upper or lower bands to identify extreme conditions.
█ Settings
Set Anchor Method
Anchor Method: Choose between Timeframe or Date to define the starting point of calculations.
Anchor Timeframe: For Timeframe mode, specify the interval (e.g., Daily, Weekly).
Anchor Date: For Date mode, set the exact starting date for historical alignment.
Set Std Dev Multiplier
Controls the width of the bands:
Higher values widen the bands, filtering out minor fluctuations.
Lower values tighten the bands for more responsive analysis.
Set Fibonacci Levels
Define custom Fibonacci ratios (e.g., 0.236, 0.382) to plot intermediate levels between the bands.
█ Tips for Fine-Tuning
⚪ For Trend Trading:
Use higher Std Dev Multipliers to focus on long-term trends and avoid noise. Adjust Anchor Timeframe to Weekly or Monthly for broader trend analysis.
⚪ For Reversal Trading:
Tighten the bands with a lower Std Dev Multiplier.
Use shorter anchor timeframes for intraday reversals (e.g., Hourly).
⚪ For Volatile Markets:
Increase the Std Dev Multiplier to accommodate wider price swings.
⚪ For Quiet Markets:
Decrease the Std Dev Multiplier to highlight smaller fluctuations.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
momentum indicatorThe Rational Quadratic Smoother uses the Rational Quadratic Kernel to create a non-repainting, adaptive smoothing of price data. This method provides a balance between long-term trends and short-term movements by adjusting the weight of distant data points using a kernel function. Traders can use this indicator to:
Smooth price data for better trend identification.
Filter out noise without introducing lag.
Combine it with other indicators for advanced strategies.
Key Features:
Adjustable Lookback Period: Controls the range of data points considered.
Relative Weighting: Fine-tunes the influence of long-term vs. short-term data.
Customizable smoothing to fit different trading styles (scalping, swing trading, etc.).
Multi Timeframe Market Formation [LuxAlgo]The Multi Timeframe Market Formation tool allows traders to analyze up to 6 different timeframes simultaneously to discover their current formation, S/R levels and their degree of synchronization with the current chart timeframe. Multi timeframe analysis made easy.
🔶 USAGE
By default, the tool displays the chart's timeframe formation plus up to 5 other formations on timeframes higher than the one in the chart.
When the chart formation is synchronized with any enabled timeframe formation, the tool displays labels and a trailing channel, it uses a gradient by default, so the more timeframes are synchronized, the more visible the labels and the trailing channel are.
All timeframes enabled in the settings panel must be higher than the chart timeframe, otherwise the tool will display an error message.
🔹 Formations
A formation is a market structure defined by a lower and an upper boundary (also known as support & resistance).
Each formation has a different symbol and color to identify it at a glance.
It helps traders to know the current market behavior and the tool displays up to 5 of them.
BULLISH (green ▲): higher high and higher low
BEARISH (red ▼): lower high and lower low
CONTRACTION (orange ◀): lower high and higher low
EXPANSION (blue ▶): higher high and lower low
SIDEWAYS (yellow ◀): Any that does not fit with the others
🔹 Multi Timeframe Formations
The tool displays up to 6 different timeframe formations, the chart timeframe plus 5 more configurable from the settings panel.
Each of them has an upper and lower limit, a timeframe, a color and an icon.
If a bound level is shared by more than one formation, the timeframes and symbols are displayed on the same line.
These are significant levels shared by different timeframes and traders need to be aware of them.
🔹 Sync With Chart Timeframe
If the current formation on the chart timeframe is in sync with any of the timeframes enabled in the settings panel, the tool will display this on the chart.
The more timeframes are in sync, the more they are visible, providing a clear visual representation of the common market behavior on multiple timeframes at the same time.
🔶 SETTINGS
Formation size: Size of market formations on the chart timeframe
🔹 Timeframes
TF1 to TF5: Activate/deactivate timeframe, set size of market formation and activate/deactivate high and low levels
🔹 Style
Show Labels: Enable/Disable Timeframe Sync Labels
Transparency Gradient: Enable/Disable Transparency Gradient
Show Trailing Channel | Multiplier: Enable/Disable Trailing Channel and set multiplier
Color for each formation
Enhanced SPX and BTC Overlay with EMASPX-BTC Momentum Gauge and EMA Cross Indicator
Thorough Analysis:
• Combined Overlay (Green/Red Line):
o Function: Plots a wide line over the price chart, representing a composite of SPX and BTC dynamics adjusted by volume data.
o Color Coding:
Green: Indicates bullish conditions when the combined value exceeds its 10-period SMA and Bitcoin volume increases.
Red: Signals bearish conditions when the combined value drops below its 10-period SMA and Bitcoin volume decreases.
o Line Characteristics:
Width: Set at 8 for high visibility.
Transparency: 86% for both colors to overlay without obscuring candlesticks.
Scaling: Uses a factor of 0.02446 to amplify movements, making trend changes more noticeable.
• Continuous Bright Red and Green Lines:
o 20-period EMA of Current Ticker (Red):
Purpose: Acts as a medium-term trend indicator, smoothing price data to reflect the asset's general direction over time.
Color: Bright red for easy identification.
Transparency: 60% to keep it visible but not overpowering.
o 5-period EMA of BTC (Green):
Purpose: Provides insights into short-term Bitcoin momentum, capturing rapid changes in market sentiment.
Color: Bright green to distinguish from the red EMA.
Transparency: 30% for high visibility against price movements.
Detailed Analysis of the EMA Cross:
• Crossing Points:
o Bullish Crossover:
Occurs when the 5-period BTC EMA (green) moves above the 20-period EMA of the current ticker (red).
Suggests that Bitcoin's short-term momentum is gaining strength relative to the asset's medium-term trend, potentially signaling an upcoming uptrend or strengthening of an existing one.
o Bearish Crossover:
When the green line falls below the red, it indicates that Bitcoin's immediate momentum is weakening compared to the asset's medium-term trend, which might precede a downtrend or confirm one.
• Early Trade Signals:
o Entry/Exit Points:
These crossovers can guide traders in making timely decisions to enter or exit trades, especially when corroborated by the combined overlay's color.
o Confirmation:
EMA crossovers can confirm trends indicated by the combined overlay. For example, a bullish crossover with a green combined line could validate a buying opportunity.
o Volatility Insights:
The rapid shifts in Bitcoin's 5-period EMA highlight potential volatility spikes, offering an additional layer of market analysis, particularly useful in volatile markets.
• Strategic Use:
o Multi-Market Insight: The script integrates data from both traditional (SPX) and crypto (BTC) markets, allowing for a more comprehensive analysis of market conditions.
o Decision-Making: Provides traders with visual cues for market sentiment, trend direction, and potential reversals, enhancing strategic trading decisions.
o Trend Confirmation: The combination of EMA crossovers and the overlay's color changes offers a multi-faceted approach to trend confirmation or divergence.
In Summary:
• This script merges elements of traditional stock market analysis with cryptocurrency dynamics, utilizing color changes, line thickness, and EMA crossovers to visually communicate market conditions, offering traders a robust tool for analyzing and acting on market movements.
Dominan BreakPlots an arrow what dominan got break. Dominan is a bar which high is higher than high of the next x bars and low is lower than low of the next x bars. So, next x bars are completely in range of that dominan bar.
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.
HTF RangeThis Pine Script indicator, HTF Range , is a tool designed to help traders visualize predefined ranges (highs and lows) and analyze price action within those levels. It's particularly useful for identifying key levels and trends for a set of pre-configured assets, such as cryptocurrencies, stocks, and forex pairs.
Key Features:
1. Predefined Symbol Ranges:
Stores a list of assets (tickers) with corresponding high, low, and trend information in an array.
Automatically matches the current symbol on the chart (syminfo.ticker) to fetch and display relevant range data:
High Range: The upper price level.
Low Range: The lower price level.
Trend: Indicates whether the trend is "up" or "down."
Example tickers: BTCUSDT, ETHUSDT, GBPUSD, NVDA, and more.
2. Range Visualizations:
Extremeties: Draws dashed horizontal lines for the high and low levels.
Half-Level: Marks the midpoint of the range with a dashed yellow line.
Upper and Lower Quarters: Highlights upper and lower portions of the range using shaded boxes with customizable extensions:
3. Configurable Inputs:
Enable/Disable Levels: Toggles for extremeties, half-levels, and quarter-levels.
Table Info: Option to display a table summarizing the range data (symbol, high, low, and trend).
4. Dynamic Calculations:
Automatically calculates the difference between the high and low (diff) for precise range subdivisions.
Dynamically adjusts visuals based on the trend (up or down) for better relevance to the market condition.
5. Table Display:
Provides a detailed summary of the asset's range and trend in the top-right corner of the chart:
Symbol ticker.
High and low levels.
Overall trend direction.
Use Case:
This indicator is ideal for traders who:
Trade multiple assets and want a quick overview of key price ranges.
Analyze price movements relative to predefined support and resistance zones.
Use range-based strategies for trend following, breakout trading, or reversals.
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.
Volume Weighted Moving Average (TechnoBlooms)The Volume Weighted Moving Average Oscillator (VWMO) is a custom technical indicator designed to measure market momentum while accounting for volume. It helps traders assess whether price movements are supported by strong or weak trading volumes. The VWMO provides insights into potential trends by comparing current momentum with historical averages.
Indicator Overview:
The VWMO is based on a combination of price and volume data, highlighting the relationship between these two components to generate a clear oscillation value. The oscillator displays dynamic insights into market strength, capturing price directionality and volume alignment.
Key Features:
1. Dynamic Visualization of Momentum:
o The oscillator displays positive and negative momentum by analyzing the relationship between price movements and trading volume over a specified period.
o Positive momentum typically represents a bullish market, while negative momentum reflects bearish conditions.
2. Volume-Weighted Analysis:
o Volume is incorporated to give an adjusted price perspective, where price movements on high-volume days have more influence on the resulting oscillator values.
3. Trend Confirmation via EMA:
o An Exponential Moving Average (EMA) of the oscillator is plotted to smooth the raw oscillator values and provide trend confirmation.
o The EMA is essential for identifying whether the oscillator is in an upward or downward trend. It also serves as a support for evaluating when momentum might reverse.
4. Visual Indicators and Color Coding:
o The indicator uses varying color intensities to differentiate between strong and weak momentum.
o Bullish and bearish momentum is visually reflected by colors, offering at-a-glance guidance on potential trade opportunities.
5. Overbought and Oversold Thresholds:
o Horizontal lines at predefined levels (e.g., +100 and -100) help to define overbought and oversold areas, which assist in identifying overextended price movements that may signal reversals.
6. Scalability & Adaptability:
o The indicator allows for adjustment of the period, EMA length, and other key parameters to tailor its usage according to different asset classes or timeframe preferences.
Big Candle Identifier with RSI Divergence and Advanced Stops1. Strategy Objective
The main goal of this strategy is to:
Identify significant price momentum (big candles).
Enter trades at opportune moments based on market signals (candlestick patterns and RSI divergence).
Limit initial risk through a fixed stop loss.
Maximize profits by using a trailing stop that activates only after the trade moves a specified distance in the profitable direction.
2. Components of the Strategy
A. Big Candle Identification
The strategy identifies big candles as indicators of strong momentum.
A big candle is defined as:
The body (absolute difference between close and open) of the current candle (body0) is larger than the bodies of the last five candles.
The candle is:
Bullish Big Candle: If close > open.
Bearish Big Candle: If open > close.
Purpose: Big candles signal potential continuation or reversal of trends, serving as the primary entry trigger.
B. RSI Divergence
Relative Strength Index (RSI): A momentum oscillator used to detect overbought/oversold conditions and divergence.
Fast RSI: A 5-period RSI, which is more sensitive to short-term price movements.
Slow RSI: A 14-period RSI, which smoothens fluctuations over a longer timeframe.
Divergence: The difference between the fast and slow RSIs.
Positive divergence (divergence > 0): Bullish momentum.
Negative divergence (divergence < 0): Bearish momentum.
Visualization: The divergence is plotted on the chart, helping traders confirm momentum shifts.
C. Stop Loss
Initial Stop Loss:
When entering a trade, an immediate stop loss of 200 points is applied.
This stop loss ensures the maximum risk is capped at a predefined level.
Implementation:
Long Trades: Stop loss is set below the entry price at low - 200 points.
Short Trades: Stop loss is set above the entry price at high + 200 points.
Purpose:
Prevents significant losses if the price moves against the trade immediately after entry.
D. Trailing Stop
The trailing stop is a dynamic risk management tool that adjusts with price movements to lock in profits. Here’s how it works:
Activation Condition:
The trailing stop only starts trailing when the trade moves 200 ticks (profit) in the right direction:
Long Position: close - entry_price >= 200 ticks.
Short Position: entry_price - close >= 200 ticks.
Trailing Logic:
Once activated, the trailing stop:
For Long Positions: Trails behind the price by 150 ticks (trail_stop = close - 150 ticks).
For Short Positions: Trails above the price by 150 ticks (trail_stop = close + 150 ticks).
Exit Condition:
The trade exits automatically if the price touches the trailing stop level.
Purpose:
Ensures profits are locked in as the trade progresses while still allowing room for price fluctuations.
E. Trade Entry Logic
Long Entry:
Triggered when a bullish big candle is identified.
Stop loss is set at low - 200 points.
Short Entry:
Triggered when a bearish big candle is identified.
Stop loss is set at high + 200 points.
F. Trade Exit Logic
Trailing Stop: Automatically exits the trade if the price touches the trailing stop level.
Fixed Stop Loss: Exits the trade if the price hits the predefined stop loss level.
G. 21 EMA
The strategy includes a 21-period Exponential Moving Average (EMA), which acts as a trend filter.
EMA helps visualize the overall market direction:
Price above EMA: Indicates an uptrend.
Price below EMA: Indicates a downtrend.
H. Visualization
Big Candle Identification:
The open and close prices of big candles are plotted for easy reference.
Trailing Stop:
Plotted on the chart to visualize its progression during the trade.
Green Line: Indicates the trailing stop for long positions.
Red Line: Indicates the trailing stop for short positions.
RSI Divergence:
Positive divergence is shown in green.
Negative divergence is shown in red.
3. Key Parameters
trail_start_ticks: The number of ticks required before the trailing stop activates (default: 200 ticks).
trail_distance_ticks: The distance between the trailing stop and price once the trailing stop starts (default: 150 ticks).
initial_stop_loss_points: The fixed stop loss in points applied at entry (default: 200 points).
tick_size: Automatically calculates the minimum tick size for the trading instrument.
4. Workflow of the Strategy
Step 1: Entry Signal
The strategy identifies a big candle (bullish or bearish).
If conditions are met, a trade is entered with a fixed stop loss.
Step 2: Initial Risk Management
The trade starts with an initial stop loss of 200 points.
Step 3: Trailing Stop Activation
If the trade moves 200 ticks in the profitable direction:
The trailing stop is activated and follows the price at a distance of 150 ticks.
Step 4: Exit the Trade
The trade is exited if:
The price hits the trailing stop.
The price hits the initial stop loss.
5. Advantages of the Strategy
Risk Management:
The fixed stop loss ensures that losses are capped.
The trailing stop locks in profits after the trade becomes profitable.
Momentum-Based Entries:
The strategy uses big candles as entry triggers, which often indicate strong price momentum.
Divergence Confirmation:
RSI divergence helps validate momentum and avoid false signals.
Dynamic Profit Protection:
The trailing stop adjusts dynamically, allowing the trade to capture larger moves while protecting gains.
6. Ideal Market Conditions
This strategy performs best in:
Trending Markets:
Big candles and momentum signals are more effective in capturing directional moves.
High Volatility:
Larger price swings improve the probability of reaching the trailing stop activation level (200 ticks).
Internals Elite NYSE [Beta]Overview:
This indicator is designed to provide traders with a quick overview of key market internals and metrics in a single, easy-to-read table displayed directly on the chart. It incorporates a variety of metrics that help gauge market sentiment, momentum, and overall market conditions.
The table dynamically updates in real-time and uses color-coding to highlight significant changes or thresholds, allowing traders to quickly interpret the data and make informed trading decisions.
Features:
Market Internals:
TICK: Measures the difference between the number of stocks ticking up versus those ticking down on the NYSE. Green or red background indicates if it crosses a user-defined threshold.
Advance/Decline (ADD): Shows the net number of advancing versus declining stocks on the NYSE. Color-coded to show positive, negative, or neutral conditions.
Volatility Metrics:
VIX Change (%): Displays the percentage change in the Volatility Index (VIX), a key gauge of market fear or complacency. Color-coded for direction.
VIX Price: Displays the current VIX price with thresholds to indicate low, medium, or high volatility.
Other Market Metrics:
DXY Change (%): Percentage change in the US Dollar Index (DXY), indicating dollar strength or weakness.
VWAP Deviation (%): Percentage of stocks above VWAP (Volume Weighted Average Price), helping traders assess intraday buying and selling pressure.
Asset-Specific Metrics:
BTCUSD Change (%): Percentage change in Bitcoin (BTC) price, useful for monitoring cryptocurrency sentiment.
SPY Change (%): Percentage change in the S&P 500 ETF (SPY), a proxy for the overall stock market.
Current Ticker Change (%): Percentage change in the currently selected ticker on the chart.
US10Y Change (%): Percentage change in the yield of the 10-Year US Treasury Note (TVC:US10Y), an important macroeconomic indicator.
Customizable Appearance:
Adjustable text size to suit your chart layout.
User-defined thresholds for key metrics (e.g., TICK, ADD, VWAP, VIX).
Dynamic Table Placement:
You can position the table anywhere on the chart: top-right, top-left, bottom-right, bottom-left, middle-right, or middle-left.
How to Use:
Add the Indicator to Your Chart:
Apply the indicator to your chart from the Pine Script editor in TradingView.
Customize the Inputs:
Adjust the thresholds for TICK, ADD, VWAP, and VIX according to your trading style.
Enable or disable the metrics you want to see in the table by toggling the display options for each metric (e.g., Show TICK, Show BTC, Show SPY).
Set the table placement to your preferred position on the chart.
Interpret the Table:
Look for color-coded cells to quickly identify significant changes or breaches of thresholds.
Positive values are typically shown in green, negative values in red, and neutral/insignificant changes in gray.
Use metrics like TICK and ADD to gauge market breadth and momentum.
Refer to VWAP deviation to assess intraday buying or selling pressure.
Monitor the VIX and US10Y changes to stay aware of macroeconomic and volatility shifts.
Incorporate Into Your Strategy:
Use the indicator alongside technical analysis to confirm setups or identify areas of caution.
Keep an eye on correlated metrics (e.g., VIX and SPY) for broader market context.
Use BTCUSD or DXY as additional indicators of risk-on/risk-off sentiment.
Ideal Users:
Day Traders: Quickly gauge intraday market conditions and momentum.
Swing Traders: Identify broader sentiment shifts using metrics like ADD, DXY, and US10Y.
Macro Investors: Stay updated on key macroeconomic indicators like the 10-Year Treasury yield (US10Y) and the US Dollar Index (DXY).
This indicator serves as a comprehensive tool for understanding market conditions at a glance, enabling traders to act decisively based on the latest data.
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.
Request█ OVERVIEW
This library is a tool for Pine Script™ programmers that consolidates access to a wide range of lesser-known data feeds available on TradingView, including metrics from the FRED database, FINRA short sale volume, open interest, and COT data. The functions in this library simplify requests for these data feeds, making them easier to retrieve and use in custom scripts.
█ CONCEPTS
Federal Reserve Economic Data (FRED)
FRED (Federal Reserve Economic Data) is a comprehensive online database curated by the Federal Reserve Bank of St. Louis. It provides free access to extensive economic and financial data from U.S. and international sources. FRED includes numerous economic indicators such as GDP, inflation, employment, and interest rates. Additionally, it provides financial market data, regional statistics, and international metrics such as exchange rates and trade balances.
Sourced from reputable organizations, including U.S. government agencies, international institutions, and other public and private entities, FRED enables users to analyze over 825,000 time series, download their data in various formats, and integrate their information into analytical tools and programming workflows.
On TradingView, FRED data is available from ticker identifiers with the "FRED:" prefix. Users can search for FRED symbols in the "Symbol Search" window, and Pine scripts can retrieve data for these symbols via `request.*()` function calls.
FINRA Short Sale Volume
FINRA (the Financial Industry Regulatory Authority) is a non-governmental organization that supervises and regulates U.S. broker-dealers and securities professionals. Its primary aim is to protect investors and ensure integrity and transparency in financial markets.
FINRA's Short Sale Volume data provides detailed information about daily short-selling activity across U.S. equity markets. This data tracks the volume of short sales reported to FINRA's trade reporting facilities (TRFs), including shares sold on FINRA-regulated Alternative Trading Systems (ATSs) and over-the-counter (OTC) markets, offering transparent access to short-selling information not typically available from exchanges. This data helps market participants, researchers, and regulators monitor trends in short-selling and gain insights into bearish sentiment, hedging strategies, and potential market manipulation. Investors often use this data alongside other metrics to assess stock performance, liquidity, and overall trading activity.
It is important to note that FINRA's Short Sale Volume data does not consolidate short sale information from public exchanges and excludes trading activity that is not publicly disseminated.
TradingView provides ticker identifiers for requesting Short Sale Volume data with the format "FINRA:_SHORT_VOLUME", where "" is a supported U.S. equities symbol (e.g., "AAPL").
Open Interest (OI)
Open interest is a cornerstone indicator of market activity and sentiment in derivatives markets such as options or futures. In contrast to volume, which measures the number of contracts opened or closed within a period, OI measures the number of outstanding contracts that are not yet settled. This distinction makes OI a more robust indicator of how money flows through derivatives, offering meaningful insights into liquidity, market interest, and trends. Many traders and investors analyze OI alongside volume and price action to gain an enhanced perspective on market dynamics and reinforce trading decisions.
TradingView offers many ticker identifiers for requesting OI data with the format "_OI", where "" represents a derivative instrument's ticker ID (e.g., "COMEX:GC1!").
Commitment of Traders (COT)
Commitment of Traders data provides an informative weekly breakdown of the aggregate positions held by various market participants, including commercial hedgers, non-commercial speculators, and small traders, in the U.S. derivative markets. Tallied and managed by the Commodity Futures Trading Commission (CFTC) , these reports provide traders and analysts with detailed insight into an asset's open interest and help them assess the actions of various market players. COT data is valuable for gaining a deeper understanding of market dynamics, sentiment, trends, and liquidity, which helps traders develop informed trading strategies.
TradingView has numerous ticker identifiers that provide access to time series containing data for various COT metrics. To learn about COT ticker IDs and how they work, see our LibraryCOT publication.
█ USING THE LIBRARY
Common function characteristics
• This library's functions construct ticker IDs with valid formats based on their specified parameters, then use them as the `symbol` argument in request.security() to retrieve data from the specified context.
• Most of these functions automatically select the timeframe of a data request because the data feeds are not available for all timeframes.
• All the functions have two overloads. The first overload of each function uses values with the "simple" qualifier to define the requested context, meaning the context does not change after the first script execution. The second accepts "series" values, meaning it can request data from different contexts across executions.
• The `gaps` parameter in most of these functions specifies whether the returned data is `na` when a new value is unavailable for request. By default, its value is `false`, meaning the call returns the last retrieved data when no new data is available.
• The `repaint` parameter in applicable functions determines whether the request can fetch the latest unconfirmed values from a higher timeframe on realtime bars, which might repaint after the script restarts. If `false`, the function only returns confirmed higher-timeframe values to avoid repainting. The default value is `true`.
`fred()`
The `fred()` function retrieves the most recent value of a specified series from the Federal Reserve Economic Data (FRED) database. With this function, programmers can easily fetch macroeconomic indicators, such as GDP and unemployment rates, and use them directly in their scripts.
How it works
The function's `fredCode` parameter accepts a "string" representing the unique identifier of a specific FRED series. Examples include "GDP" for the "Gross Domestic Product" series and "UNRATE" for the "Unemployment Rate" series. Over 825,000 codes are available. To access codes for available series, search the FRED website .
The function adds the "FRED:" prefix to the specified `fredCode` to construct a valid FRED ticker ID (e.g., "FRED:GDP"), which it uses in request.security() to retrieve the series data.
Example Usage
This line of code requests the latest value from the Gross Domestic Product series and assigns the returned value to a `gdpValue` variable:
float gdpValue = fred("GDP")
`finraShortSaleVolume()`
The `finraShortSaleVolume()` function retrieves EOD data from a FINRA Short Sale Volume series. Programmers can call this function to retrieve short-selling information for equities listed on supported exchanges, namely NASDAQ, NYSE, and NYSE ARCA.
How it works
The `symbol` parameter determines which symbol's short sale volume information is retrieved by the function. If the value is na , the function requests short sale volume data for the chart's symbol. The argument can be the name of the symbol from a supported exchange (e.g., "AAPL") or a ticker ID with an exchange prefix ("NASDAQ:AAPL"). If the `symbol` contains an exchange prefix, it must be one of the following: "NASDAQ", "NYSE", "AMEX", or "BATS".
The function constructs a ticker ID in the format "FINRA:ticker_SHORT_VOLUME", where "ticker" is the symbol name without the exchange prefix (e.g., "AAPL"). It then uses the ticker ID in request.security() to retrieve the available data.
Example Usage
This line of code retrieves short sale volume for the chart's symbol and assigns the result to a `shortVolume` variable:
float shortVolume = finraShortSaleVolume(syminfo.tickerid)
This example requests short sale volume for the "NASDAQ:AAPL" symbol, irrespective of the current chart:
float shortVolume = finraShortSaleVolume("NASDAQ:AAPL")
`openInterestFutures()` and `openInterestCrypto()`
The `openInterestFutures()` function retrieves EOD open interest (OI) data for futures contracts. The `openInterestCrypto()` function provides more granular OI data for cryptocurrency contracts.
How they work
The `openInterestFutures()` function retrieves EOD closing OI information. Its design is focused primarily on retrieving OI data for futures, as only EOD OI data is available for these instruments. If the chart uses an intraday timeframe, the function requests data from the "1D" timeframe. Otherwise, it uses the chart's timeframe.
The `openInterestCrypto()` function retrieves opening, high, low, and closing OI data for a cryptocurrency contract on a specified timeframe. Unlike `openInterest()`, this function can also retrieve granular data from intraday timeframes.
Both functions contain a `symbol` parameter that determines the symbol for which the calls request OI data. The functions construct a valid OI ticker ID from the chosen symbol by appending "_OI" to the end (e.g., "CME:ES1!_OI").
The `openInterestFutures()` function requests and returns a two-element tuple containing the futures instrument's EOD closing OI and a "bool" condition indicating whether OI is rising.
The `openInterestCrypto()` function requests and returns a five-element tuple containing the cryptocurrency contract's opening, high, low, and closing OI, and a "bool" condition indicating whether OI is rising.
Example usage
This code line calls `openInterest()` to retrieve EOD OI and the OI rising condition for a futures symbol on the chart, assigning the values to two variables in a tuple:
= openInterestFutures(syminfo.tickerid)
This line retrieves the EOD OI data for "CME:ES1!", irrespective of the current chart's symbol:
= openInterestFutures("CME:ES1!")
This example uses `openInterestCrypto()` to retrieve OHLC OI data and the OI rising condition for a cryptocurrency contract on the chart, sampled at the chart's timeframe. It assigns the returned values to five variables in a tuple:
= openInterestCrypto(syminfo.tickerid, timeframe.period)
This call retrieves OI OHLC and rising information for "BINANCE:BTCUSDT.P" on the "1D" timeframe:
= openInterestCrypto("BINANCE:BTCUSDT.P", "1D")
`commitmentOfTraders()`
The `commitmentOfTraders()` function retrieves data from the Commitment of Traders (COT) reports published by the Commodity Futures Trading Commission (CFTC). This function significantly simplifies the COT request process, making it easier for programmers to access and utilize the available data.
How It Works
This function's parameters determine different parts of a valid ticker ID for retrieving COT data, offering a streamlined alternative to constructing complex COT ticker IDs manually. The `metricName`, `metricDirection`, and `includeOptions` parameters are required. They specify the name of the reported metric, the direction, and whether it includes information from options contracts.
The function also includes several optional parameters. The `CFTCCode` parameter allows programmers to request data for a specific report code. If unspecified, the function requests data based on the chart symbol's root prefix, base currency, or quoted currency, depending on the `mode` argument. The call can specify the report type ("Legacy", "Disaggregated", or "Financial") and metric type ("All", "Old", or "Other") with the `typeCOT` and `metricType` parameters.
Explore the CFTC website to find valid report codes for specific assets. To find detailed information about the metrics included in the reports and their meanings, see the CFTC's Explanatory Notes .
View the function's documentation below for detailed explanations of its parameters. For in-depth information about COT ticker IDs and more advanced functionality, refer to our previously published COT library .
Available metrics
Different COT report types provide different metrics . The tables below list all available metrics for each type and their applicable directions:
+------------------------------+------------------------+
| Legacy (COT) Metric Names | Directions |
+------------------------------+------------------------+
| Open Interest | No direction |
| Noncommercial Positions | Long, Short, Spreading |
| Commercial Positions | Long, Short |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No direction |
| Traders Noncommercial | Long, Short, Spreading |
| Traders Commercial | Long, Short |
| Traders Total Reportable | Long, Short |
| Concentration Gross LT 4 TDR | Long, Short |
| Concentration Gross LT 8 TDR | Long, Short |
| Concentration Net LT 4 TDR | Long, Short |
| Concentration Net LT 8 TDR | Long, Short |
+------------------------------+------------------------+
+-----------------------------------+------------------------+
| Disaggregated (COT2) Metric Names | Directions |
+-----------------------------------+------------------------+
| Open Interest | No Direction |
| Producer Merchant Positions | Long, Short |
| Swap Positions | Long, Short, Spreading |
| Managed Money Positions | Long, Short, Spreading |
| Other Reportable Positions | Long, Short, Spreading |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No Direction |
| Traders Producer Merchant | Long, Short |
| Traders Swap | Long, Short, Spreading |
| Traders Managed Money | Long, Short, Spreading |
| Traders Other Reportable | Long, Short, Spreading |
| Traders Total Reportable | Long, Short |
| Concentration Gross LE 4 TDR | Long, Short |
| Concentration Gross LE 8 TDR | Long, Short |
| Concentration Net LE 4 TDR | Long, Short |
| Concentration Net LE 8 TDR | Long, Short |
+-----------------------------------+------------------------+
+-------------------------------+------------------------+
| Financial (COT3) Metric Names | Directions |
+-------------------------------+------------------------+
| Open Interest | No Direction |
| Dealer Positions | Long, Short, Spreading |
| Asset Manager Positions | Long, Short, Spreading |
| Leveraged Funds Positions | Long, Short, Spreading |
| Other Reportable Positions | Long, Short, Spreading |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No Direction |
| Traders Dealer | Long, Short, Spreading |
| Traders Asset Manager | Long, Short, Spreading |
| Traders Leveraged Funds | Long, Short, Spreading |
| Traders Other Reportable | Long, Short, Spreading |
| Traders Total Reportable | Long, Short |
| Concentration Gross LE 4 TDR | Long, Short |
| Concentration Gross LE 8 TDR | Long, Short |
| Concentration Net LE 4 TDR | Long, Short |
| Concentration Net LE 8 TDR | Long, Short |
+-------------------------------+------------------------+
Example usage
This code line retrieves "Noncommercial Positions (Long)" data, without options information, from the "Legacy" report for the chart symbol's root, base currency, or quote currency:
float nonCommercialLong = commitmentOfTraders("Noncommercial Positions", "Long", false)
This example retrieves "Managed Money Positions (Short)" data, with options included, from the "Disaggregated" report:
float disaggregatedData = commitmentOfTraders("Managed Money Positions", "Short", true, "", "Disaggregated")
█ NOTES
• This library uses dynamic requests , allowing dynamic ("series") arguments for the parameters defining the context (ticker ID, timeframe, etc.) of a `request.*()` function call. With this feature, a single `request.*()` call instance can flexibly retrieve data from different feeds across historical executions. Additionally, scripts can use such calls in the local scopes of loops, conditional structures, and even exported library functions, as demonstrated in this script. All scripts coded in Pine Script™ v6 have dynamic requests enabled by default. To learn more about the behaviors and limitations of this feature, see the Dynamic requests section of the Pine Script™ User Manual.
• The library's example code offers a simple demonstration of the exported functions. The script retrieves available data using the function specified by the "Series type" input. The code requests a FRED series or COT (Legacy), FINRA Short Sale Volume, or Open Interest series for the chart's symbol with specific parameters, then plots the retrieved data as a step-line with diamond markers.
Look first. Then leap.
█ EXPORTED FUNCTIONS
This library exports the following functions:
fred(fredCode, gaps)
Requests a value from a specified Federal Reserve Economic Data (FRED) series. FRED is a comprehensive source that hosts numerous U.S. economic datasets. To explore available FRED datasets and codes, search for specific categories or keywords at fred.stlouisfed.org Calls to this function count toward a script's `request.*()` call limit.
Parameters:
fredCode (series string) : The unique identifier of the FRED series. The function uses the value to create a valid ticker ID for retrieving FRED data in the format `"FRED:fredCode"`. For example, `"GDP"` refers to the "Gross Domestic Product" series ("FRED:GDP"), and `"GFDEBTN"` refers to the "Federal Debt: Total Public Debt" series ("FRED:GFDEBTN").
gaps (simple bool) : Optional. If `true`, the function returns a non-na value only when a new value is available from the requested context. If `false`, the function returns the latest retrieved value when new data is unavailable. The default is `false`.
Returns: (float) The value from the requested FRED series.
finraShortSaleVolume(symbol, gaps, repaint)
Requests FINRA daily short sale volume data for a specified symbol from one of the following exchanges: NASDAQ, NYSE, NYSE ARCA. If the chart uses an intraday timeframe, the function requests data from the "1D" timeframe. Otherwise, it uses the chart's timeframe. Calls to this function count toward a script's `request.*()` call limit.
Parameters:
symbol (series string) : The symbol for which to request short sale volume data. If the specified value contains an exchange prefix, it must be one of the following: "NASDAQ", "NYSE", "AMEX", "BATS".
gaps (simple bool) : Optional. If `true`, the function returns a non-na value only when a new value is available from the requested context. If `false`, the function returns the latest retrieved value when new data is unavailable. The default is `false`.
repaint (simple bool) : Optional. If `true` and the chart's timeframe is intraday, the value requested on realtime bars may change its time offset after the script restarts its executions. If `false`, the function returns the last confirmed period's values to avoid repainting. The default is `true`.
Returns: (float) The short sale volume for the specified symbol or the chart's symbol.
openInterestFutures(symbol, gaps, repaint)
Requests EOD open interest (OI) and OI rising information for a valid futures symbol. If the chart uses an intraday timeframe, the function requests data from the "1D" timeframe. Otherwise, it uses the chart's timeframe. Calls to this function count toward a script's `request.*()` call limit.
Parameters:
symbol (series string) : The symbol for which to request open interest data.
gaps (simple bool) : Optional. If `true`, the function returns non-na values only when new values are available from the requested context. If `false`, the function returns the latest retrieved values when new data is unavailable. The default is `false`.
repaint (simple bool) : Optional. If `true` and the chart's timeframe is intraday, the value requested on realtime bars may change its time offset after the script restarts its executions. If `false`, the function returns the last confirmed period's values to avoid repainting. The default is `true`.
Returns: ( ) A tuple containing the following values:
- The closing OI value for the symbol.
- `true` if the closing OI is above the previous period's value, `false` otherwise.
openInterestCrypto(symbol, timeframe, gaps, repaint)
Requests opening, high, low, and closing open interest (OI) data and OI rising information for a valid cryptocurrency contract on a specified timeframe. Calls to this function count toward a script's `request.*()` call limit.
Parameters:
symbol (series string) : The symbol for which to request open interest data.
timeframe (series string) : The timeframe of the data request. If the timeframe is lower than the chart's timeframe, it causes a runtime error.
gaps (simple bool) : Optional. If `true`, the function returns non-na values only when new values are available from the requested context. If `false`, the function returns the latest retrieved values when new data is unavailable. The default is `false`.
repaint (simple bool) : Optional. If `true` and the `timeframe` represents a higher timeframe, the function returns unconfirmed values from the timeframe on realtime bars, which repaint when the script restarts its executions. If `false`, it returns only confirmed higher-timeframe values to avoid repainting. The default is `true`.
Returns: ( ) A tuple containing the following values:
- The opening, high, low, and closing OI values for the symbol, respectively.
- `true` if the closing OI is above the previous period's value, `false` otherwise.
commitmentOfTraders(metricName, metricDirection, includeOptions, CFTCCode, typeCOT, mode, metricType)
Requests Commitment of Traders (COT) data with specified parameters. This function provides a simplified way to access CFTC COT data available on TradingView. Calls to this function count toward a script's `request.*()` call limit. For more advanced tools and detailed information about COT data, see TradingView's LibraryCOT library.
Parameters:
metricName (series string) : One of the valid metric names listed in the library's documentation and source code.
metricDirection (series string) : Metric direction. Possible values are: "Long", "Short", "Spreading", and "No direction". Consult the library's documentation or code to see which direction values apply to the specified metric.
includeOptions (series bool) : If `true`, the COT symbol includes options information. Otherwise, it does not.
CFTCCode (series string) : Optional. The CFTC code for the asset. For example, wheat futures (root "ZW") have the code "001602". If one is not specified, the function will attempt to get a valid code for the chart symbol's root, base currency, or main currency.
typeCOT (series string) : Optional. The type of report to request. Possible values are: "Legacy", "Disaggregated", "Financial". The default is "Legacy".
mode (series string) : Optional. Specifies the information the function extracts from a symbol. Possible modes are:
- "Root": The function extracts the futures symbol's root prefix information (e.g., "ES" for "ESH2020").
- "Base currency": The function extracts the first currency from a currency pair (e.g., "EUR" for "EURUSD").
- "Currency": The function extracts the currency of the symbol's quoted values (e.g., "JPY" for "TSE:9984" or "USDJPY").
- "Auto": The function tries the first three modes (Root -> Base currency -> Currency) until it finds a match.
The default is "Auto". If the specified mode is not available for the symbol, it causes a runtime error.
metricType (series string) : Optional. The metric type. Possible values are: "All", "Old", "Other". The default is "All".
Returns: (float) The specified Commitment of Traders data series. If no data is available, it causes a runtime error.
Silver Bullet SessionsThe Silver Bullet Sessions indicator is a specialized timing tool designed to highlight key market sessions throughout the trading day. By marking specific hours with vertical lines, it helps traders identify potentially significant market moments that often coincide with increased volatility and trading opportunities.
This indicator plots vertical lines at six strategic times during the trading day: 3:00 AM, 4:00 AM, 10:00 AM, 11:00 AM, 2:00 PM, and 3:00 PM. These times are carefully selected to correspond with important market events and session overlaps in the global trading cycle. The early morning hours (3-4 AM) often capture significant Asian market movements and the European market opening. The mid-morning period (10-11 AM) typically corresponds with peak European trading hours and the pre-US market dynamics. The afternoon times (2-3 PM) coincide with key US market activities and the European market close.
The indicator is implemented using Pine Script version 6, ensuring compatibility with the latest TradingView platform features. It employs a clean, efficient coding structure that minimizes resource usage while maintaining reliable performance. The vertical lines are rendered in blue for clear visibility against any chart background, and their width is optimized for easy identification without obscuring price action.
Traders can use these visual markers to:
Plan their entries and exits around these key time periods
Anticipate potential market volatility
Structure their trading sessions around these significant market hours
Identify session-based trading patterns