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
Göstergeler ve stratejiler
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
Options Levels Support and ResistanceAre you sometimes clueless of where you are going to find support or resistance for the stock price? Nothing can be more powerful than market positioning via options levels.
This indicator visualizes key institutional options levels including short-term and longer-term Put/Call Walls, and projected implied move ranges.
Key Features:
Displays major support/resistance levels derived from options data
Shows institutional Put Walls (PW) and Call Walls (CW) - areas of significant options activity
Identifies short-term and longer-term gamma levels for more precise trading
Includes an option statistics (IV, Put/Call ratio, trend) in a clean dashboard
Automatically(*) updates throughout the trading day to reflect current market positioning
Currently supporting 440 of the most popular tickers.
Presents gamma flip levels for indexes SPX, RUT, NDX and VIX
Trading Applications:
Identify key price levels where institutional options activity may influence price movement
Gauge market sentiment through IV levels, Put/Call ratios, and options positioning
Plan entries/exits around major Put/Call walls where price reversals are more likely
Monitor changes in institutional positioning through level trends
Levels are calculated externally using comprehensive options data and updated into the indicator multiple times per day. Note that I can't guarantee it will be timely updated since TradingView offers no access to external data nor a way to programmatically update the script.
This code simply renders the levels I calculate using external software. I had to make the code as short as possible to accommodate more tickers, reason why there is no commenting.
The last update time (New York/EST) is shown in the dashboard.
ICT CRT Model Range with EquilibriumICT CRT Model Range with Equilibrium Indicator
This indicator calculates and displays the high, low, and equilibrium levels within a custom-defined session (9:00 am to 10:00 am New York Time and the lines will stop appearing at 16:00pm ). It draws horizontal lines to represent the session's range and marks the equilibrium point as a reference.
What is CRT (Candle Range Theory)?
Candle Range Theory (CRT) is based on the concept that every candle on any timeframe forms its own range. These ranges can either be manipulated—through strategies like Turtle Soup—or broken, resulting in price movements such as engulfing patterns, breakouts, and retests beyond the candle's high or low.
CRT is commonly visualized as a 3-candle model, but it can include more candles due to the presence of inside bars. An inside bar is a candle whose high is not higher than the previous candle's high and whose low is not lower than the previous candle's low.
The CRT model follows the A-M-D structure:
Accumulation (A): The first candle or group of candles (inside bars) represents market consolidation.
Manipulation (M): The second candle signals a false move, often a Turtle Soup setup designed to trap traders.
Distribution (D): The third candle confirms the true market move, breaking out of the range and establishing the trend.
Customizable Settings:
Line Colors: Choose your preferred colors for the high, low, and equilibrium lines.
Line Widths: Adjust the thickness of the lines for better visibility.
Line Styles: Select from solid, dotted, or dashed styles for each line.
Label Settings: Customize the text and colors of the labels for the high, low, and equilibrium points.
Traders can easily modify these settings to suit their visual preferences and trading strategies. This indicator is ideal for identifying price action within a specific range, offering clear visual cues for potential CRT Setup.
[MAD] Self-Optimizing RSIOverview
This script evaluates multiple RSI lengths within a specified range, calculates performance metrics for each, and identifies the top 3 configurations based on a custom scoring system. It then plots the three best RSI curves and optionally displays a summary table and label.
How It Works
The script calculates a custom RSI for each length in the range.
It simulates entering a long position when RSI crosses below the Buy Value and exits when RSI crosses above the Sell Value.
Each trade's return is stored in the relevant StatsContainer.
Metrics Computation
After all bars have been processed,
* Net Profit,
* Sharpe Ratio, and
* Win Rate
are computed for each RSI length.
A weighted score is then derived using the input weights.
Top 3 Identification
The script finds the three RSI lengths with the highest scores.
The RSI lines for these top 3 lengths are plotted in different colors.
If enabled, a table listing the top 3 results (Rank, RSI length, Sharpe, NetPnL, Win Rate) is shown.
If enabled, a label with the highest-scoring RSI length and its score is placed on the final bar.
Usage Tips
Adjust Min RSI Length and Max RSI Length to explore a narrower or wider range of periods.
Be aware, to high settings will slow down the calculation.
Experiment with different RSI Buy Value and RSI Sell Value settings if you prefer more or fewer trade signals.
Confirm that Min Trades Required aligns with the desired confidence level for the computed metrics.
Modify Weight: Sharpe, Weight: NetProfit, and Weight: WinRate to reflect which metrics are most important.
Troubleshooting
If metrics remain - or NaN, confirm enough trades (Min Trades Required) have occurred.
If no top 3 lines appear, it could mean no valid trades were taken in the specified range, or the script lacks sufficient bars to calculate RSI for some lengths. In this case set better buyvalue and sellvalues in the inputs
Disclaimer
Past performance is not indicative of future results specialy as this indicator can repaint based on max candles in memory which are limited by your subscription
ADX and DI with HistogramThe "ADX and DI with Histogram" indicator is designed to help traders analyze market trends using the Average Directional Index (ADX) and Directional Indicators (DI+ and DI-). It provides a visual representation of trend strength and direction, along with a histogram to illustrate the difference between the DI+ and DI- values.
Features:
Inputs:
Length (len): Sets the period for the ADX and DI calculations (default: 14).
Threshold Level (th): Defines the ADX threshold for trend strength (default: 20).
Shape Color: Customizes the color of the shape markers plotted on the chart.
Shape Size: Adjusts the size of the shape markers (default: 10).
Shape Type: Selects the type of shape to display (Circle or Square).
Calculations:
Computes the True Range, Directional Movement (both plus and minus), and applies Exponential Moving Averages to these values to derive DI+ and DI-.
The ADX is calculated using the smoothed directional movement indicators.
Visual Outputs:
Plots DI+ (green line), DI- (red line), and ADX (navy line) on the main chart.
Includes a horizontal line representing the threshold level for easy trend assessment.
Displays a histogram that reflects the difference between DI+ and DI- with color coding to indicate directional strength (green for DI+ > DI- and red for DI+ < DI-).
Shape Markers:
When the ADX crosses above the specified threshold, a shape marker (Circle or Square) appears on the chart indicating a potential trend initiation.
Conversely, when the ADX crosses below the threshold, a shape marker is also plotted, signaling potential trend weakening.
Here is the description translated into Arabic:
---
مؤشر ADX و DI مع الهيستوجرام
نظرة عامة:
يُصمم مؤشر "ADX و DI مع الهيستوجرام" لمساعدة المتداولين في تحليل اتجاهات السوق باستخدام مؤشر الاتجاه المتوسط (ADX) ومؤشرات الاتجاه (DI+ و DI-). يوفر تمثيلًا بصريًا لقوة الاتجاه والاتجاه، بالإضافة إلى هيستوجرام لتوضيح الفرق بين قيم DI+ و DI-.
الميزات:
- **المدخلات:**
- **الطول (len):** يحدد الفترة لحسابات ADX و DI (افتراضي: 14).
- **مستوى العتبة (th):** يحدد عتبة ADX لقوة الاتجاه (افتراضي: 20).
- **لون الشكل:** يخصص لون علامات الشكل المرسومة على المخطط.
- **حجم الشكل:** يضبط حجم علامات الشكل (افتراضي: 10).
- **نوع الشكل:** يحدد نوع الشكل الذي يتم عرضه (دائرة أو مربع).
- **الحسابات:**
- يحسب النطاق الحقيقي، الحركة الاتجاهية (كلاهما زائد وناقص)، ويطبق المتوسطات المتحركة الأسية على هذه القيم للحصول على DI+ و DI-.
- يتم حساب ADX باستخدام مؤشرات الحركة الاتجاهية.
- **المخرجات :**
- يرسم DI+ (خط أخضر) و DI- (خط أحمر) و ADX (خط بحري) على المخطط الرئيسي.
- يتضمن خط أفقي يمثل مستوى العتبة لتقييم الاتجاه بسهولة.
- يعرض هيستوجرام يعكس الفرق بين DI+ و DI- مع ترميز لوني للإشارة إلى القوة الاتجاهية (أخضر عندما يكون DI+ أكبر من DI- وأحمر عندما يكون DI+ أقل من DI-).
- **علامات الشكل:**
- عندما يتجاوز ADX العتبة المحددة، تظهر علامة شكل (دائرة أو مربع) على المخطط تشير إلى احتمال بدء اتجاه جديد.
- على العكس، عندما يتجاوز ADX العتبة إلى الأسفل، يتم رسم علامة شكل أيضًا، مما يدل على احتمال ضعف الاتجاه.
### حالات الاستخدام:
هذا المؤشر مناسب للمتداولين الذين يتطلعون إلى تحديد الاتجاهات وتأكيدها، وتقييم قوة السوق، واتخاذ قرارات تداول مستنيرة بناءً على إشارات ADX و DI.
---
Prior Day High and Low RaysPrior Day High and Low Rays
This custom TradingView indicator projects rays from the prior day's high and low prices, helping you visualize key levels of support and resistance from the previous trading day. The rays extend to the right, continuing from the prior day's high and low throughout the current trading day.
Features:
Displays a ray starting at the prior day's high price.
Displays a ray starting at the prior day's low price.
Rays extend to the right and are only plotted for the immediate prior day.
Customizable ray color and width through the indicator settings.
Use Case:
Track important price levels from the previous day that can act as support or resistance.
Customize the appearance of the rays to match your chart's style and preferences.
This tool is designed for traders who want to incorporate prior day price action into their analysis and maintain a clean, customized chart display.
Session Bar/Candle ColoringChange the color of candles within a user-defined trading session. Borders and wicks can be changed as well, not just the body color.
PREFACE
This script can be used an educational resource for those who are interested in learning Pine Script. Therefore, the script is published open source and is organized in a manner that follows the recommended Style Guide .
While the main premise of the indicator is rather simple, the script showcases various things that can be achieved such as conditional plotting, alignment of indicator settings, user input validation, script optimization, and more. The script also has examples of taking into consideration the chart timeframe and/or different chart types (Heikin Ashi, Renko, etc.) that a user might be running it on. Note: for complete beginners, I strongly suggest going through the Pine Script User Manual (possibly more than once).
FEATURES
Besides being able to select a specific time window, the indicator also provides additional color settings for changing the background color or changing the colors of neutral/indecisive candles, as shown in the image below.
This allows for a higher level of customization beyond the TradingView chart settings or other similar scripts that are currently available.
HOW TO USE
First, define the intraday trading session that will contain the candles to modify. The session can be limited to specific days of the week.
Next, select the parts of the candles that should be modified: Body, Borders, Wick, and/or Background.
For each of the candle parts that were enabled, you can select the colors that will be used depending on whether a candle is bullish (⇧), bearish (⇩), or neutral (⇆).
All other indicator settings will have a detailed tooltip to describe its usage and/or effect.
LIMITATIONS
The indicator is not intended to function on Daily or higher timeframes due to the intraday nature of session time windows.
The indicator cannot always automatically detect the chart type being used, therefore the user is requested to manually input the chart type via the " Chart Style " setting.
Depending on the available historical data and the selected choice for the " Portion of bar in session " setting, the indicator may not be able to update very old candles on the chart.
EXAMPLE USAGE
This section will show examples of different scenarios that the indicator can be used for.
Emphasizing a main trading session.
Defining a "Pre/post market hours background" like is available for some symbols (e.g., NASDAQ:AAPL ).
Highlighting in which bar the midnight candle occurs.
Hiding indecision bars (neutral candles).
Showing only "Regular Trading Hours" for a chart that does not have the option to toggle ETH/RTH. To achieve this, the actual chart data is hidden, and only the indicator is visible; alternatively, a 2nd instance of the indicator could change colors to match the chart background.
Using a combination of Bars and Japanese Candlesticks. Alternatively, this could be done by hiding the main chart data and using 2 instances of the indicator (one with " Chart Style " setting as Bars , and the other set to Candles ).
Using a combination of thin and thick bars on Range charts. Note: requires disabling the "Thin Bars" setting for Bar charts in the TradingView chart settings.
NOTES
If using more than one instance of this indicator on the same chart, you can use the TradingView "Save Indicator Template" feature to avoid having to re-configure the multiple indicators at a later time.
This indicator is intended to work "out-of-the-box" thanks to the behind_chart option introduced to Pine Script in October 2024. But you can always manually bring the indicator to the front just in case the color changes are not being seen (using the "More" option in the indicator status line: More > Visual Order > Bring to front ).
Many thanks to fikira for their help and inspiring me to create open source scripts.
Any feedback including bug reports or suggestions for improving the indicator (or source code itself) are always welcome in the comments section.
Simple Trend Strength & MomentumThis indicator will show a combination of Trend Strength, Volatility using an Adaptive Moving Average (AMA), and Market Momentum.
You can use this indicator to identify trends, volatility, and momentum shifts in real-time, making it an excellent tool for both trend-following and breakout strategies.
The three main features of this indicator are:
Adaptive Moving Average (AMA): Tracks the trend direction with a dynamic smoothing factor that adjusts based on market volatility. The AMA line changes color based on trend strength (green for bullish, red for bearish). I manually compute the Adaptive Moving Average (AMA) using a smoothing factor derived from the market's efficiency ratio. I have used fastLength and slowLength to control the responsiveness of the AMA.
Volatility Bands: Plots upper and lower bands around the AMA line, indicating price volatility. These bands dynamically adjust based on ATR, with a color gradient that changes intensity based on market volatility.
Momentum Circles: Positive momentum (ROC above the threshold) is shown as a green circle below the bar, while negative momentum is marked by a red circle above the bar. This makes it easy to spot momentum shifts.
The green dots in the indicator represent positive momentum. Specifically, they are displayed when the Rate of Change (ROC) of the price exceeds a predefined threshold (set as threshold in the input). This indicates that the market is experiencing upward price movement at a rate faster than the defined threshold.
How it works:
Rate of Change (ROC) measures the percentage change in price over a specified period (in this case, 14 periods).
When the ROC is greater than the set threshold (1.5 by default), a green circle (dot) is plotted below the price bar to signal that there is significant positive momentum.
This can be seen as an indicator of bullish momentum, where price is increasing at a relatively fast pace compared to previous periods.
The green dots help you spot when the price is moving upward rapidly, potentially signaling a good time to enter a long position or watch for further price action.
NOTE: It is vice versa for red dots.
PDL By iofexPrevious day levels
A Previous Day Level Indicator is a trading tool designed to highlight the key levels from the previous trading session, such as the high, low, and close prices. These levels act as significant support and resistance points, helping traders make informed decisions. By analyzing these levels, traders can anticipate potential price reversals, breakouts, or continuations in the current trading session. This indicator is particularly useful for day traders and scalpers aiming to align their strategies with market trends.
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.
JJ Psychological Levels (125 Increments)Psychological Levels Indicator
Description:
The Psychological Levels Indicator is a versatile tool designed for traders to identify key price levels that often act as support or resistance zones in the market. These levels are plotted at regular intervals, customizable by the user, starting from a base price level. This is particularly useful for spotting psychological price points that traders and investors frequently monitor.
Key Features:
1.Dynamic Psychological Levels:
- The script calculates and displays horizontal lines at price levels separated by customizable increments (default: 125 points).
- These levels are dynamically adjusted to the visible range of the chart.
2. Customizable Inputs:
- Starting Level: Set the base level from which increments are calculated (e.g., 0 or 1000).
- Step Size: Define the interval between levels (e.g., 125 for indices like Bank NIFTY).
3. Visual Representation:
- Horizontal lines are drawn at each psychological level, helping traders quickly identify key zones.
- Labels are placed next to each level, displaying the corresponding price for easy reference.
4. Application Across Instruments:
- This indicator works seamlessly with various asset classes, including stocks, indices, forex, and cryptocurrencies.
How to Use:
1.Identify Key Price Zones:
- Use the plotted psychological levels to spot areas where price action is likely to react.
- Levels such as 1125, 1250, and 1375 (for a step size of 125) are visually highlighted.
2. Plan Trades Around Key Levels:
- These levels can act as support/resistance or breakout points, providing opportunities for entry, exit, and stop-loss placement.
3. Customizable Settings:
- Adjust the starting level and step size to tailor the indicator to your trading instrument or strategy.
Why Psychological Levels Matter:
Psychological levels are widely followed by traders and often coincide with key market turning points due to their significance in human behavior and market psychology. They are frequently used by institutional traders, making them valuable reference points for intraday and swing trading.
Custom Settings:
- **Starting Level:** Default: `0`
- **Step Size:** Default: `125`
Disclaimer:
This indicator is a technical analysis tool and is not intended to provide financial advice. Always combine it with other indicators and perform your due diligence before making trading decisions.