Machine Learning Price Target Prediction Signals [AlgoAlpha]Introducing the Machine Learning Price Target Predictions, a cutting-edge trading tool that leverages kernel regression to provide accurate price targets and enhance your trading strategy. This indicator combines trend-based signals with advanced machine learning techniques, offering predictive insights into potential price movements. Perfect for traders looking to make data-driven decisions with confidence.
What is Kernel Regression and How It Works
Kernel regression is a non-parametric machine learning technique that estimates the relationship between variables by weighting data points based on their similarity to a given input. The similarity is determined using a kernel function, such as the Gaussian (RBF) kernel, which assigns higher weights to closer data points and progressively lower weights to farther ones. This allows the model to make smooth and adaptive predictions, balancing recent data and historical trends.
Key Features
🎯 Predictive Price Targets : Uses kernel regression to estimate the magnitude of price movements.
📈 Dynamic Trend Analysis : Multiple trend detection methods, including EMA crossovers, Hull Moving Average, and SuperTrend.
🔧 Customizable Settings : Adjust bandwidth for kernel regression and tweak trend indicator parameters to suit your strategy.
📊 Visual Trade Levels : Displays take-profit and stop-loss levels directly on the chart with customizable colors.
📋 Performance Metrics : Real-time win rate, recommended risk-reward ratio, and training data size displayed in an on-chart table.
🔔 Alerts : Get notified for new trends, take-profit hits, and stop-loss triggers.
How to Use
🛠 Add the Indicator : Add it to your favorites and apply it to your chart. Configure the trend detection method (SuperTrend, HMA, or EMA crossover) and other parameters based on your preferences.
📊 Analyze Predictions : Observe the predicted move size, recommended risk-reward ratio, and trend direction. Use the displayed levels for trade planning.
🔔 Set Alerts : Enable alerts for trend signals, take-profit hits, or stop-loss triggers to stay informed without constant monitoring.
How It Works
The indicator calculates features such as price volatility, relative strength, and trend signals, which are stored during training periods. When a trend change is detected, the kernel regression model predicts the likely price move based on these features. Predictions are smoothed using the specified bandwidth to avoid overfitting while ensuring timely responses to feature changes. Visualized take-profit and stop-loss levels help traders optimize risk management. Real-time metrics like win rate and recommended risk-reward ratios provide actionable insights for decision-making.
Statistics
Godlike Trading StrategyGodlike Trading Strategy Explanation
This strategy combines multiple technical indicators to provide precise buy and sell signals, ensuring high accuracy in trend identification and trade execution. Here's how it works:
Indicators Used:
Supertrend:
Helps identify the overall trend (bullish or bearish).
Provides clear buy and sell signals based on price movements relative to ATR-based bands.
RSI (Relative Strength Index):
Measures momentum and identifies overbought (above 70) or oversold (below 30) conditions.
Helps avoid trades during extreme conditions and confirms trend strength.
MACD (Moving Average Convergence Divergence):
Identifies momentum shifts and trends by comparing two moving averages.
Histogram provides additional confirmation for trend strength.
Crossovers between the MACD line and the signal line indicate potential buy/sell opportunities.
ATR (Average True Range):
Measures market volatility and adjusts stop-loss levels accordingly.
How It Works:
Buy Signal:
The price is above the Supertrend line.
MACD crosses above its signal line, indicating bullish momentum.
RSI is above the oversold level but below overbought (typically between 50-70).
These conditions together confirm a strong bullish trend.
Sell Signal:
The price is below the Supertrend line.
MACD crosses below its signal line, indicating bearish momentum.
RSI is below the overbought level but above oversold (typically between 30-50).
These conditions confirm a bearish trend.
Risk Management:
Stop-loss is dynamically set using ATR to account for market volatility.
Take-profit levels can be set based on a risk-reward ratio (e.g., 1:2 or 1:3) or key support/resistance levels.
Alerts:
Alerts are triggered when buy or sell conditions are met, ensuring the trader never misses an opportunity.
Use Case:
This strategy is versatile and can be applied across various markets (cryptocurrencies, stocks, forex) and timeframes. It’s designed to:
Capture strong trends.
Avoid trades during consolidations or false breakouts.
Provide a clear, rule-based approach to trading.
Advanced Options Trading Indicator: Buy & Sell Signal Generator This powerful custom indicator combines the Relative Strength Index (RSI) and Moving Average (MA) to help traders identify optimal entry and exit points in the options market. The indicator generates real-time buy and sell signals based on RSI crossovers and price positioning relative to the moving average, providing actionable insights for traders seeking to make informed decisions. Additionally, it calculates potential call and put option strike prices with a buffer for added flexibility and precision, ensuring a well-rounded approach to options trading.
kyle trend v1The "Kyle Trend v1" indicator is a custom Pine Script indicator designed for trend detection and analysis on financial charts. It combines multiple moving averages, a custom Supertrend-like algorithm, and Keltner Channels to identify market trends, potential buy/sell signals, and overall market sentiment.
Volume Z-ScoreA simple indicator to remove some of the noise associated with day-to-day volume changes. I find this is much easier to spot large volume spikes at reversal points, or dwindling volume at points of exhaustion.
Select the desired lookback period and the indicator will display how many standard deviations above or below the mean the current volume is.
Happy trading!
MACD DETTAEste indicador é uma versão personalizada do clássico MACD (Moving Average Convergence Divergence), projetado para se ajustar automaticamente às configurações ideais de médias móveis exponenciais (EMAs) e da linha de sinal com base no timeframe do gráfico. Ele combina flexibilidade e automação para simplificar a análise técnica, adaptando-se automaticamente às condições específicas de diferentes períodos.
Buy Low over 18 SMA Strategythis is a customizeable strategy to buy on daily chart where you can select after which days you want to buy
with a 1or2 day trailing stop on prior low
the Nasdaq seams to be most profitable when buying above the wednesdays and fridays high
this avoided entries in the bearish move on july 2024
breakeven stops in aug 2023
only small losses in jan/april/sept 2022
all in all a pretty good strategy when exiting below the low of prior two days
indicador: PatosCriei esta estratégia depois de muito estudo de gráficos. Ela funciona bem para diminuir perdas, mas também ameniza os ganhos. Se alguém tiver ideia de melhoras manda mensagem inbox.
weakly dividesThis indicator takes the last weekly candle and divides it into the number the user wants. This is a great strategy.
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 :)
table_theme_libTable Theme Library
A comprehensive library for creating consistently styled tables across different indicators and strategies. Provides preset themes and specialized table styles for various use cases like scanners and statistics displays.
Each preset includes carefully chosen color schemes for both dark and light themes, ensuring optimal visibility and consistency across different chart themes.
Features:
Dark and Light theme support for optimal visibility
Scanner table presets with condition highlighting
Scanner table presets with divergence indicators
Statistical table presets (basic style)
Shaded statistical table presets for value-based display
Bordered statistical table presets for emphasis
Up/Down condition color schemes
Confirmed/Failed signal highlighting
Active/Inactive state indicators
Human-readable timeframe formatting utility
Consistent styling across different chart themes
Customizable text sizes for headers and cells
Usage Example:
//@version=5
indicator("My Scanner")
import bilsebub/table_theme_lib/1 as theme
// Input options
var string THEME = input.string("Dark", "Theme", options= )
var int HEADER_SIZE = input.int(14, "Header Text Size")
var int CELL_SIZE = input.int(12, "Cell Text Size")
// Create table with scanner preset
if barstate.islast
var t = table.new(position.top_right, 5, 10)
= theme.load_scanner_table_preset(
preset_mode=THEME,
header_bg_color=color.gray,
border_color=color.white,
header_text_color=color.white,
cell_def_bg=color.black,
cell_up_conf_bg=color.green,
cell_dn_conf_bg=color.red,
cell_text_def=color.white,
cell_text_active=color.yellow,
cell_text_failed=color.gray,
cell_text_up=color.lime,
cell_text_dn=color.red,
cell_text_up_conf=color.black,
cell_text_dn_conf=color.white,
frame_color=color.gray,
header_text_size=HEADER_SIZE,
cell_text_size=CELL_SIZE)
// Use returned colors and styles for table cells
table.cell(t, 0, 0, "Header", bgcolor=header_bg, text_color=header_text, text_size=header_text_size)
table.cell(t, 0, 1, "Up Signal", bgcolor=cell_up, text_color=text_up, text_size=cell_text_size)
Available Presets:
load_scanner_table_preset() - For basic scanner tables
load_scanner_table_preset_div() - For scanner tables with divergence indicators
load_stat_table_preset() - For basic statistical tables
load_shaded_stat_table_preset() - For statistical tables with value-based shading
load_bordered_stat_table_preset() - For tables with border emphasis
Utility Functions:
get_timeframe_as_readable() - Converts timeframe strings to human-readable format
get_timeframe_as_readable(my_timeframe)
Parameters:
my_timeframe (string)
load_scanner_table_preset(preset_mode, header_bg_color, border_color, header_text_color, cell_def_bg, cell_up_conf_bg, cell_dn_conf_bg, cell_text_def, cell_text_active, cell_text_failed, cell_text_up, cell_text_dn, cell_text_up_conf, cell_text_dn_conf, frame_color, header_text_size, cell_text_size)
Parameters:
preset_mode (string)
header_bg_color (color)
border_color (color)
header_text_color (color)
cell_def_bg (color)
cell_up_conf_bg (color)
cell_dn_conf_bg (color)
cell_text_def (color)
cell_text_active (color)
cell_text_failed (color)
cell_text_up (color)
cell_text_dn (color)
cell_text_up_conf (color)
cell_text_dn_conf (color)
frame_color (color)
header_text_size (int)
cell_text_size (int)
load_scanner_table_preset_div(preset_mode, header_bg_color, border_color, header_text_color, cell_def_bg, cell_up_conf_bg, cell_dn_conf_bg, cell_text_def, cell_text_active, cell_text_failed, cell_text_up, cell_text_dn, cell_text_up_conf, cell_text_dn_conf, frame_color, div_hid, div_reg, div_hid_conf, div_reg_conf, header_text_size, cell_text_size)
Parameters:
preset_mode (string)
header_bg_color (color)
border_color (color)
header_text_color (color)
cell_def_bg (color)
cell_up_conf_bg (color)
cell_dn_conf_bg (color)
cell_text_def (color)
cell_text_active (color)
cell_text_failed (color)
cell_text_up (color)
cell_text_dn (color)
cell_text_up_conf (color)
cell_text_dn_conf (color)
frame_color (color)
div_hid (color)
div_reg (color)
div_hid_conf (color)
div_reg_conf (color)
header_text_size (int)
cell_text_size (int)
load_stat_table_preset(preset_mode, header_text_size, cell_text_size)
Parameters:
preset_mode (string)
header_text_size (int)
cell_text_size (int)
load_shaded_stat_table_preset(preset_mode, header_text_size, cell_text_size)
Parameters:
preset_mode (string)
header_text_size (int)
cell_text_size (int)
load_bordered_stat_table_preset(preset_mode, header_text_size, cell_text_size)
Parameters:
preset_mode (string)
header_text_size (int)
cell_text_size (int)
Daily OHLC on Lower TFsdisplay the daily Open, High, Low, and Close (OHLC) prices on any timeframe lower than daily
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.).
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.
Volume change(%) and deltaVolume Change (%) Indicator
This indicator is designed to help traders identify significant changes in trading volume during specific market hours. By visually highlighting bars and providing percentage change labels, it helps users detect spikes in volume that could signal important market movements.
Key Features
Customizable Volume Thresholds:
Select from predefined thresholds (e.g., 38.2%, 50%, 61.8%, etc.) to filter only the most relevant volume changes based on your strategy.
Time Filtering:
Focuses on a specific time range (8:30 AM to 2:59 PM by default) to capture critical market activity, such as during the U.S. trading session.
Bar Coloring:
Bars are colored green or red when the volume change exceeds the selected threshold:
Green: Volume increases and the price closes higher.
Red: Volume increases and the price closes lower.
Arrow Labels with Volume Change:
Displays percentage changes above significant bars, accompanied by an arrow:
▲ for price increases.
▼ for price decreases.
Label Customization:
Adjust label size and colors for better visual clarity.
Advantages of Using This Indicator
Improved Volume Analysis:
Highlights when volume surges, helping you spot potential reversals, breakouts, or continuation signals.
Enhanced Focus on Relevant Data:
By limiting the analysis to a specific time window and threshold, it avoids distractions from insignificant volume changes.
Visual Clarity:
Combines bar colors and labels to provide quick, actionable insights without cluttering your chart.
Versatility:
Works well with intraday strategies, especially in volatile markets like futures, forex, or stocks.
Ease of Use:
Fully customizable with intuitive settings to suit different trading styles.
How to Use This Indicator
Step 1: Add to Your Chart
Open your TradingView account.
Click on the "Pine Script Editor" at the bottom of the platform.
Paste the script provided above into the editor.
Click "Add to Chart" to apply the indicator.
Step 2: Configure the Settings
Select Volume Threshold:
Choose the percentage threshold for highlighting bars (e.g., 50% for moderate changes, 250% for extreme spikes).
Enable/Disable Bar Colors:
Toggle the setting to apply or ignore green/red bar coloring.
Adjust Label Size and Colors:
Customize the size of labels and their colors for better visibility.
Step 3: Analyze the Chart
Look for green or red bars with arrows (▲ or ▼) indicating significant volume and price changes.
Use the labels showing percentage changes to gauge the strength of the movement.
Combine with other indicators (e.g., moving averages, RSI) to validate trade entries or exits.
Practical Example
Scenario: Intraday Trading on a Stock Index
Objective: Spot breakouts during the U.S. session (9:30 AM - 3:59 PM NY time).
Settings:
Volume Threshold: 100%.
Time Range: Default (8:30 AM to 2:59 PM).
Labels: Large size, white background, black text.
Observation:
A green bar with a 150% label and an arrow ▲ appears at 10:00 AM, suggesting strong buying interest.
This could indicate the start of a breakout.
You decide to enter a long position, placing a stop-loss below the breakout bar.
Tips for Maximum Effectiveness
Combine with Price Action:
Use alongside candlestick patterns (e.g., pin bars, engulfing patterns) to confirm entries.
Monitor Key Levels:
Pay attention to bars near support/resistance levels or trendlines.
Adjust Thresholds for Volatility:
In highly volatile markets, use higher thresholds (e.g., 250%); in calm markets, lower thresholds (e.g., 50%).
Test on Different Assets:
Works well on stocks, futures, forex, and even cryptocurrencies.
Conclusion
The Volume Change (%) Indicator is a powerful tool for traders looking to incorporate volume analysis into their intraday strategies. Its customization options, visual simplicity, and actionable insights make it suitable for traders of all experience levels. Try it out and refine it based on your market and style. 🚀
Let me know if you need help with further customizations! 😊
(VERSIÓN EN ESPAÑOL)
Indicador de Cambio de Volumen (%)
Este indicador está diseñado para ayudar a los traders a identificar cambios significativos en el volumen de negociación durante horas específicas del mercado. Al resaltar visualmente las barras y proporcionar etiquetas con el porcentaje de cambio, ayuda a los usuarios a detectar picos de volumen que podrían señalar movimientos importantes del mercado.
Características Principales
Umbrales de Volumen Personalizables:
Selecciona entre umbrales predefinidos (por ejemplo, 38.2%, 50%, 61.8%, etc.) para filtrar solo los cambios de volumen más relevantes según tu estrategia.
Filtrado por Tiempo:
Se enfoca en un rango horario específico (por defecto de 8:30 AM a 2:59 PM) para capturar la actividad crítica del mercado, como la sesión americana.
Coloreado de Barras:
Las barras se colorean de verde o rojo cuando el cambio de volumen supera el umbral seleccionado:
Verde: Aumento de volumen y el precio cierra más alto.
Rojo: Aumento de volumen y el precio cierra más bajo.
Etiquetas con Flechas y Cambio de Volumen:
Muestra el cambio porcentual sobre las barras significativas, acompañado de una flecha:
▲ para aumentos de precio.
▼ para caídas de precio.
Personalización de Etiquetas:
Ajusta el tamaño y los colores de las etiquetas para mejorar la claridad visual.
Ventajas de Usar Este Indicador
Mejora el Análisis de Volumen:
Resalta cuando el volumen se dispara, ayudando a detectar posibles reversas, rupturas o señales de continuación.
Enfoque en Datos Relevantes:
Al limitar el análisis a un rango horario específico y umbrales predefinidos, evita distracciones de cambios de volumen insignificantes.
Claridad Visual:
Combina colores de barras y etiquetas para proporcionar información rápida y útil sin saturar el gráfico.
Versatilidad:
Funciona bien con estrategias intradía, especialmente en mercados volátiles como futuros, forex o acciones.
Facilidad de Uso:
Totalmente personalizable con configuraciones intuitivas para adaptarse a diferentes estilos de trading.
Cómo Usar Este Indicador
Paso 1: Agregar a Tu Gráfico
Abre tu cuenta en TradingView.
Haz clic en el "Editor de Pine Script" en la parte inferior de la plataforma.
Pega el script proporcionado arriba en el editor.
Haz clic en "Agregar al gráfico" para aplicar el indicador.
Paso 2: Configura los Ajustes
Selecciona el Umbral de Volumen:
Elige el umbral de porcentaje para resaltar las barras (por ejemplo, 50% para cambios moderados, 250% para picos extremos).
Habilitar/Deshabilitar Colores de Barras:
Activa o desactiva el coloreado de las barras verde/roja.
Ajusta el Tamaño y Colores de las Etiquetas:
Personaliza el tamaño y los colores de las etiquetas para mejorar la visibilidad.
Paso 3: Analiza el Gráfico
Busca barras verdes o rojas con flechas (▲ o ▼) que indiquen cambios significativos de volumen y precio.
Utiliza las etiquetas con el cambio porcentual para medir la fuerza del movimiento.
Combínalo con otros indicadores (por ejemplo, medias móviles, RSI) para validar entradas o salidas de operaciones.
Ejemplo Práctico
Escenario: Trading Intradía en un Índice Bursátil
Objetivo: Detectar rupturas durante la sesión americana (9:30 AM - 3:59 PM hora de Nueva York).
Configuración:
Umbral de Volumen: 100%.
Rango Horario: Por defecto (8:30 AM a 2:59 PM).
Etiquetas: Tamaño grande, fondo blanco, texto negro.
Observación:
Aparece una barra verde con una etiqueta del 150% y una flecha ▲ a las 10:00 AM, lo que sugiere un fuerte interés comprador.
Esto podría indicar el inicio de una ruptura.
Decides entrar en una posición larga, colocando un stop-loss por debajo de la barra de ruptura.
Consejos para Maximizar la Efectividad
Combina con Acción del Precio:
Utiliza patrones de velas (como barras envolventes, pin bars) para confirmar las entradas.
Monitorea Niveles Clave:
Presta atención a las barras cercanas a niveles de soporte/resistencia o líneas de tendencia.
Ajusta los Umbrales según la Volatilidad:
En mercados altamente volátiles, usa umbrales más altos (por ejemplo, 250%); en mercados calmados, umbrales más bajos (por ejemplo, 50%).
Prueba en Diferentes Activos:
Funciona bien en acciones, futuros, forex e incluso criptomonedas.
Conclusión
El Indicador de Cambio de Volumen (%) es una herramienta poderosa para los traders que buscan incorporar el análisis de volumen en sus estrategias intradía. Sus opciones de personalización, simplicidad visual y sus valiosos insights lo hacen adecuado para traders de todos los niveles. Pruébalo y ajústalo según tu mercado y estilo. 🚀
¡Déjame saber si necesitas más ayuda o ajustes! 😊
STRX - Correlation DominationThis indicator displays the correlation among three selected assets (for example, Gold, Dollar Index, and Nasdaq) on a custom timeframe. A table positioned at the top-right corner of the chart lets you quickly see the correlation between:
Asset 1 vs Asset 2
Asset 1 vs Asset 3
Asset 2 vs Asset 3
Correlations are calculated using the Pearson correlation function (ta.correlation). If the correlation is greater than or equal to 0.4, the value appears in green (strong positive correlation). If it is less than or equal to -0.4, it appears in red (strong negative correlation). Otherwise, it is displayed in yellow (weak correlation).
Multi-asset and multi-timeframe: Compare up to three instruments at once on your chosen timeframe.
Customizable period: Use the “Correlation Period” setting to adjust the correlation calculation window.
Clear table format: The results are immediately visible in an easy-to-read table.
Disclaimer: This script is provided solely for educational and informational purposes. It does not constitute a recommendation or an invitation to invest. Use it as an additional resource and always conduct thorough market analysis before opening any trading positions. Past performance does not guarantee future results.
EMA Proximity (Test)First script. Please don't use it.
Goal: To identify in screener, EMA 10/20 cross over before the cross over.
Pivot Bsquad (Traditional and Fibonacci)Pivot Bsquad (Traditional & Fibonacci) - XAUUSD Scalping Indicator
The Pivot Bsquad Indicator is designed to provide high-precision support and resistance levels for scalping on XAUUSD (Gold). This tool combines Traditional Pivot Points and Fibonacci-based Pivot Points to help traders identify key price levels where reversals or breakouts are likely to occur.
Key Features:
1. Dual Pivot Calculation Modes:
Traditional Pivots: Calculated using classic formulas based on high, low, and close values, ideal for broader support and resistance zones.
Fibonacci Pivots: Incorporates Fibonacci ratios for more dynamic and nuanced levels, perfect for intraday scalping.
2. Color-Coded Zones:
Clear visual representation of support (S1, S2, S3) and resistance (R1, R2, R3) levels.
Enhanced with key pivot lines for quick decision-making.
3. Scalping-Friendly Design:
Optimized for short timeframes (e.g., 1-minute to 15-minute charts).
Highlights high-probability zones for reversals or continuation patterns.
4. Customizable Settings:
Toggle between Traditional and Fibonacci pivots to suit your trading style.
Adjustable timeframes for pivot calculation (Daily, Weekly, Monthly).
Ideal For
Scalpers looking to capitalize on XAUUSD's volatility.
Intraday traders who rely on precise support and resistance levels.
Technical traders seeking a reliable confluence of pivot strategies.
How to Use:
Select your preferred pivot mode (Traditional or Fibonacci) in the settings.
Observe price action around pivot levels for potential entry and exit points.
Use in conjunction with momentum oscillators or candlestick patterns for confirmation.
Note: While this indicator provides a solid framework for scalping, always consider risk management practices and market conditions.
Mean Reversion Pro Strategy [tradeviZion]Mean Reversion Pro Strategy : User Guide
A mean reversion trading strategy for daily timeframe trading.
Introduction
Mean Reversion Pro Strategy is a technical trading system that operates on the daily timeframe. The strategy uses a dual Simple Moving Average (SMA) system combined with price range analysis to identify potential trading opportunities. It can be used on major indices and other markets with sufficient liquidity.
The strategy includes:
Trading System
Fast SMA for entry/exit points (5, 10, 15, 20 periods)
Slow SMA for trend reference (100, 200 periods)
Price range analysis (20% threshold)
Position management rules
Visual Elements
Gradient color indicators
Three themes (Dark/Light/Custom)
ATR-based visuals
Signal zones
Status Table
Current position information
Basic performance metrics
Strategy parameters
Optional messages
📊 Strategy Settings
Main Settings
Trading Mode
Options: Long Only, Short Only, Both
Default: Long Only
Position Size: 10% of equity
Starting Capital: $20,000
Moving Averages
Fast SMA: 5, 10, 15, or 20 periods
Slow SMA: 100 or 200 periods
Default: Fast=5, Slow=100
🎯 Entry and Exit Rules
Long Entry Conditions
All conditions must be met:
Price below Fast SMA
Price below 20% of current bar's range
Price above Slow SMA
No existing position
Short Entry Conditions
All conditions must be met:
Price above Fast SMA
Price above 80% of current bar's range
Price below Slow SMA
No existing position
Exit Rules
Long Positions
Exit when price crosses above Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
Short Positions
Exit when price crosses below Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
💼 Risk Management
Position Sizing
Default: 10% of equity per trade
Initial capital: $20,000
Commission: 0.01%
Slippage: 2 points
Maximum one position at a time
Risk Control
Use daily timeframe only
Avoid trading during major news events
Consider market conditions
Monitor overall exposure
📊 Performance Dashboard
The strategy includes a comprehensive status table displaying:
Strategy Parameters
Current SMA settings
Trading direction
Fast/Slow SMA ratio
Current Status
Active position (Flat/Long/Short)
Current price with color coding
Position status indicators
Performance Metrics
Net Profit (USD and %)
Win Rate with color grading
Profit Factor with thresholds
Maximum Drawdown percentage
Average Trade value
📱 Alert Settings
Entry Alerts
Long Entry (Buy Signal)
Short Entry (Sell Signal)
Exit Alerts
Long Exit (Take Profit)
Short Exit (Take Profit)
Alert Message Format
Strategy name
Signal type and direction
Current price
Fast SMA value
Slow SMA value
💡 Usage Tips
Consider starting with Long Only mode
Begin with default settings
Keep track of your trades
Review results regularly
Adjust settings as needed
Follow your trading plan
⚠️ Disclaimer
This strategy is for educational and informational purposes only. It is not financial advice. Always:
Conduct your own research
Test thoroughly before live trading
Use proper risk management
Consider your trading goals
Monitor market conditions
Never risk more than you can afford to lose
📝 Credits
Inspired by:
"Mean Reversion Trading Strategy for a High Win Rate" - YouTube channel "The Transparent Trader"
"Highly Reliable Mean Reversion Trading Strategy Backtested x Millions of Trades" - YouTube channel "seriousbacktester"
"Trade with Discipline, Manage Risk, Stay Consistent" - tradeviZion
Fibonacci Trend [ChartPrime]Fibonacci Trend Indicator
This powerful indicator leverages supertrend analysis to detect market direction while overlaying dynamic Fibonacci levels to highlight potential support, resistance, and optimal trend entry zones. With its straightforward design, it is perfect for traders looking to simplify their workflow and enhance decision-making.
⯁ KEY FEATURES AND HOW TO USE
⯌ Supertrend Trend Identification :
The indicator uses a supertrend algorithm to identify market direction. It displays purple for downtrends and green for uptrends, ensuring quick and clear trend analysis.
⯌ Fibonacci Levels for Current Swings :
Automatically calculates Fibonacci retracement levels (0.236, 0.382, 0.618, 0.786) for the current swing leg.
- These levels act as key zones for potential support, resistance, and trend continuation.
- The high and low swing points are labeled with exact prices, ensuring clarity.
- If the swing range is insufficient (less than five times ATR), Fibonacci levels are not displayed, avoiding irrelevant data.
⯌ Extended Fibonacci Levels :
User-defined extensions project Fibonacci levels into the future, aiding traders in planning price targets or projecting key zones.
⯌ Optimal Trend Entry Zone :
A filled area between 0.618 and 0.786 levels visually highlights the optimal entry zone for trend continuation. This allows traders to refine their entry points during pullbacks.
⯌ Diagonal Trend Line :
A dashed diagonal line connects the swing high and low, visually confirming the range and trend strength of the current swing.
⯌ Visual Labels for Fibonacci Levels :
Each Fibonacci level is marked with a label displaying its value for quick reference.
⯁ HOW TRADERS CAN POTENTIALLY USE THIS TOOL
Fibonacci Retracements:
Use the Fibonacci retracement levels to find key support or resistance zones where the price may pull back before continuing its trend.
Example: Enter long trades when the price retraces to 0.618–0.786 levels in an uptrend.
Fibonacci Extensions:
Use Fibonacci extensions to project future price targets based on the current trend's swing leg. Levels like 127.2% and 161.8% are commonly used as profit-taking zones.
Reversal Identification:
Spot potential reversals by monitoring price reactions at key Fibonacci retracement levels (e.g., 0.236 or 0.382) or the swing high/low.
Optimal Trend Entries:
The filled zone between 0.618 and 0.786 is a statistically strong area for entering a position in the direction of the trend.
Example: Enter long positions during retracements to this range in an uptrend.
Risk Management:
Set stop-losses below key Fibonacci levels or the swing low/high, and take profits at extension levels, enhancing your trade management strategies.
⯁ CONCLUSION
The Fibonacci Trend Indicator is a straightforward yet effective tool for identifying trends and key Fibonacci levels. It simplifies analysis by integrating supertrend-based trend identification with Fibonacci retracements, extensions, and optimal entry zones. Whether you're a beginner or experienced trader, this indicator is an essential addition to your toolkit for trend trading, reversal spotting, and risk management.
Trend Reversal Probability [Algoalpha]Introducing Trend Reversal Probability by AlgoAlpha – a powerful indicator that estimates the likelihood of trend reversals based on an advanced custom oscillator and duration-based statistics. Designed for traders who want to stay ahead of potential market shifts, this indicator provides actionable insights into trend momentum and reversal probabilities.
Key Features :
🔧 Custom Oscillator Calculation: Combines a dual SMA strategy with a proprietary RSI-like calculation to detect market direction and strength.
📊 Probability Levels & Visualization: Plots average signal durations and their statistical deviations (±1, ±2, ±3 SD) on the chart for clear visual guidance.
🎨 Dynamic Color Customization: Choose your preferred colors for upward and downward trends, ensuring a personalized chart view.
📈 Signal Duration Metrics: Tracks and displays signal durations with columns representing key percentages (80%, 60%, 40%, and 20%).
🔔 Alerts for High Probability Events: Set alerts for significant reversal probabilities (above 84% and 98% or below 14%) to capture key trading moments.
How to Use :
Add the Indicator: Add Trend Reversal Probability to your favorites by clicking the star icon.
Market Analysis: Use the plotted probability levels (average duration and ±SD bands) to identify overextended trends and potential reversals. Use the color of the duration counter to identify the current trend.
Leverage Alerts: Enable alerts to stay informed of high or extreme reversal probabilities without constant chart monitoring.
How It Works :
The indicator begins by calculating a custom oscillator using short and long simple moving averages (SMA) of the midpoint price. A proprietary RSI-like formula then transforms these values to estimate trend direction and momentum. The duration between trend reversals is tracked and averaged, with standard deviations plotted to provide probabilistic guidance on trend longevity. Additionally, the indicator incorporates a cumulative probability function to estimate the likelihood of a trend reversal, displaying the result in a data table for easy reference. When probability levels cross key thresholds, alerts are triggered, helping traders take timely action.
Stop Loss & TargetHow to Use the SL/TP Indicator
The SL/TP indicator is a versatile tool designed for traders to easily visualize entry, stop-loss (SL), and take-profit (TP) levels on their charts. This guide will walk you through the steps to configure and use the indicator effectively.
Features:
Configure Long Trades and Short Trades independently.
Define Entry Price, Stop Loss, and up to three Take Profit levels for each trade.
Customize line colors for better visualization.
Works for both risk-reward and target-based trading.
Adding the Indicator:
Open the TradingView platform.
Search for the indicator name: SL/TP.
Click the Add to Chart button to apply it.
Configuration:
1. Long Trade Settings
Enable Long Trade: Check this option to activate long trade lines on the chart.
Long Entry Price: Input the price at which you plan to enter the long trade.
Long Stop Loss: Input your stop-loss level for the long trade.
Line Colors: You can customize the colors for the Entry, SL, and TP lines in the Long Trade settings group.
Take Profit Levels (Calculated Automatically):
TP1: 1:1 Risk-Reward ratio (difference between Entry and SL added to Entry).
TP2: 1:2 Risk-Reward ratio.
TP3: 1:3 Risk-Reward ratio.
2. Short Trade Settings
Enable Short Trade: Check this option to activate short trade lines on the chart.
Short Entry Price: Input the price at which you plan to enter the short trade.
Short Stop Loss: Input your stop-loss level for the short trade.
Line Colors: You can customize the colors for the Entry, SL, and TP lines in the Short Trade settings group.
Take Profit Levels (Calculated Automatically):
TP1: 1:1 Risk-Reward ratio (difference between Entry and SL subtracted from Entry).
TP2: 1:2 Risk-Reward ratio.
TP3: 1:3 Risk-Reward ratio.
Visualizing on the Chart:
Once you configure the settings and enable the trade, the indicator will draw horizontal lines on the chart for:
Entry Price
Stop Loss
Take Profit Levels (TP1, TP2, TP3)
Each line will extend to three bars ahead of the current bar index.
Customization:
Adjust colors for better visibility depending on your chart theme.
The width and style of lines can also be modified in the source code if needed.
Example Usage:
Long Trade Example:
Enable Long Trade: Check the box.
Set Entry Price: 100.
Set Stop Loss: 95.
The indicator will draw the following lines:
Entry Line: At 100 (customizable color).
Stop Loss Line: At 95 (customizable color).
TP1 Line: At 105 (1:1 Risk-Reward).
TP2 Line: At 110 (1:2 Risk-Reward).
TP3 Line: At 115 (1:3 Risk-Reward).
Short Trade Example:
Enable Short Trade: Check the box.
Set Entry Price: 200.
Set Stop Loss: 205.
The indicator will draw the following lines:
Entry Line: At 200 (customizable color).
Stop Loss Line: At 205 (customizable color).
TP1 Line: At 195 (1:1 Risk-Reward).
TP2 Line: At 190 (1:2 Risk-Reward).
TP3 Line: At 185 (1:3 Risk-Reward).
Notes:
Ensure that you input valid and realistic price levels for Entry and Stop Loss.
The indicator will only display lines if both the Entry Price and Stop Loss are non-zero.
Use this indicator for planning trades visually but always confirm levels with your trading strategy.
Disclaimer: This indicator is a tool to assist in trading. Use it with proper risk management and your own due diligence.