TSLA2DTesla Swing Indicator
Overview
The Tesla Swing Indicator is a powerful and versatile trading tool designed to help traders identify swing trading opportunities, with a primary focus on Tesla (TSLA) stock. While optimized for TSLA, this indicator can also be applied to other stocks, making it a flexible addition to any trader’s toolkit. It combines multiple technical elements—Moving Averages (MAs), Stochastic signals, RSI-based background coloring, high volume detection, and a unique Bottom Line trend indicator—to provide a comprehensive view of market conditions.
Key Features
Moving Averages (MAs): The indicator plots four customizable MAs (default lengths: 20, 50, 150, and 300) to help identify trends and potential reversals. You can toggle between SMA and EMA for each MA and adjust their lengths and linewidths to suit your trading style.
MA1 (20-period EMA, yellow).
MA2 (50-period SMA, blue).
MA3 (150-period SMA, red).
MA4 (300-period SMA, white).
Stochastic Signals: The indicator uses Stochastic %K and %D to generate buy and sell signals:
Pre-Buy Signal (blue circles below candles): Indicates a potential buy when %K crosses above %D in oversold territory (below 20).
Crossover in Oversold (gold squares below candles): Confirms a buy signal when %K crosses above %D while both are below 20.
Crossunder in Overbought (pink squares above candles): Signals a potential sell when %K crosses below %D in overbought territory (above 80).
Note: While the Stochastic component works well for TSLA, it may produce less reliable signals on other stocks due to differences in volatility and price behavior. Adjust the Stochastic parameters (e.g., lengths) or test thoroughly when applying to non-TSLA stocks.
RSI Background Coloring: The background turns green when the 15-period RSI is above 50, indicating bullish momentum. This helps traders quickly gauge the strength of the current trend.
High Volume Background: The background highlights in yellow when volume exceeds 1.5 times the 20-period average volume, signaling significant market activity that often precedes big moves.
Bottom Line Trend Indicator: Positioned at the bottom of the chart, the Bottom Line acts as a trend indicator based on price interactions with the MAs:
Green: Indicates a bullish trend when the price is above MA2 (50-period).
Red: Signals a bearish trend when the price is below MA3 (150-period).
Gray: Reflects a neutral or transitional state when the price crosses below MA2 but isn’t below MA3, or when MA1 is above MA2 in a neutral context.
The Bottom Line provides a quick visual cue for the overall trend direction, helping traders align their strategies accordingly.
PVSRA Candle Coloring: The indicator applies Price-Volume-Sentiment-Range Analysis (PVSRA) to color candles based on volume and price action:
Lime (200% Bullish): High volume bullish candle (volume ≥ 2x average or weighted range condition).
Red (200% Bearish): High volume bearish candle.
Blue (150% Bullish): Rising volume bullish candle (volume ≥ 1.5x average).
Fuchsia (150% Bearish): Rising volume bearish candle.
White (Normal Bullish): Normal volume bullish candle.
Gray (Normal Bearish): Normal volume bearish candle.
This coloring helps traders identify significant candles driven by strong volume, often indicating potential trend continuations or reversals.
MACD Divergence Detection (Disabled by Default): The indicator includes logic to detect bullish and bearish MACD divergences, which can be enabled via the code for advanced users.
Usage
Best for Tesla (TSLA): The indicator is fine-tuned for TSLA, leveraging its volatility and volume characteristics to generate reliable signals. The Stochastic signals, in particular, are optimized for TSLA’s price action.
Other Stocks: The indicator can be applied to other stocks, but caution is advised with the Stochastic component. Stocks with different volatility profiles may require adjustments to the Stochastic parameters (e.g., k_length, k_smoothing, d_smoothing) to improve signal accuracy. Test thoroughly on your chosen stock and consider disabling Stochastic signals if they underperform.
Timeframes: Works on any timeframe, but swing traders may find the best results on daily higher. Ensure your chart has enough historical data (at least 300 bars) to calculate the longest MA (300 periods).
Customization: Adjust MA lengths, toggle between SMA/EMA, and tweak RSI and volume thresholds via the indicator settings to match your trading preferences.
How to Interpret
Trend Direction: Use the Bottom Line’s color (green, red, gray) to assess the overall trend. Green suggests a bullish bias, red indicates bearish conditions, and gray signals neutrality or a potential transition.
Momentum and Strength: The green RSI background (RSI > 50) confirms bullish momentum, while the absence of green indicates weaker momentum. Yellow high volume backgrounds highlight periods of significant market activity, often preceding major price movements.
Entry/Exit Signals: Look for Pre-Buy Signals (blue circles) and Crossover in Oversold (gold squares) for potential buy opportunities, and Crossunder in Overbought (pink squares) for sell signals. Confirm these signals with the trend direction (Bottom Line) and volume activity (yellow background).
Significant Candles: PVSRA candle colors help identify key price action. Lime and red candles (200% volume) indicate strong momentum, while blue and fuchsia (150% volume) suggest rising interest that may lead to bigger moves.
Limitations
Stochastic on Other Stocks: As noted, the Stochastic signals are optimized for TSLA and may generate false signals on stocks with different price behaviors. Adjust parameters or disable if necessary.
Historical Data: Ensure your chart has sufficient historical bars (at least 300) to calculate the longest MA. If not, reduce the MA4 length in the settings.
Volatility: The indicator assumes a certain level of volatility (as seen in TSLA). On low-volatility stocks, signals may be less frequent or less reliable.
Final Notes
The Tesla Swing Indicator is a robust tool for swing traders looking to capitalize on TSLA’s price movements, with the flexibility to adapt to other stocks with proper adjustments. Its combination of trend analysis (Bottom Line), momentum (RSI background), volume detection (high volume background), and entry/exit signals (Stochastic) provides a well-rounded approach to technical analysis. Use it as part of a broader trading strategy, and always backtest on your chosen stock and timeframe to ensure optimal performance.
Portföy Yönetimi
SBC ProtfoSBC Portfo PNL Indicator
Description
The SBC Portfo PNL Indicator is a powerful and user-friendly tool designed specifically for Hebrew-speaking traders to track the Profit and Loss (PNL) of their stock portfolios directly on TradingView charts. This indicator allows users to manage up to **5 distinct portfolios**, each capable of holding an **unlimited number of stocks** with **unlimited buy commands**. It provides a seamless way to input and analyze purchase data, making it ideal for traders who want to monitor their portfolio performance in real-time.
Key Features
- **Multi-Portfolio Support**: Create and track up to 5 separate portfolios, allowing flexibility for different trading strategies or accounts.
- **Unlimited Stock Entries**: Each portfolio can include an unlimited number of stocks, with no restrictions on the number of buy commands per stock.
- **Detailed Buy Commands**: For each stock, input the following data:
- **Stock Ticker**: The symbol of the stock (e.g., `AAPL`, `TSLA`).
- **Buy Price**: The price at which the stock was purchased (e.g., `150.25`).
- **Buy Amount**: The quantity of shares purchased (e.g., `10`).
- **Hebrew-Friendly Interface**: Designed with Hebrew-speaking users in mind, ensuring intuitive navigation and clear instructions in the TradingView settings dialog.
- **Customizable PNL Tracking**: Visualize the profit and loss of your portfolios directly on your TradingView charts, with real-time updates based on market data.
How to Use
1. **Add the Indicator**:
- Open TradingView, go to the chart, and add the "SBC Portfo PNL Indicator" from the Indicators menu.
2. **Configure Portfolios**:
- Open the indicator’s settings dialog.
- For each portfolio (up to 5), manually enter the portfolio data in the provided input fields using the following format:
```
PortfolioName:StockTicker:BuyPricexBuyAmount;StockTicker:BuyPricexBuyAmount
```
**Example**:
```
Portfolio1:AAPL:150.25x10;TSLA:266.72x5
```
- This example represents a portfolio named "Portfolio1" with two buy commands:
- 10 shares of AAPL bought at $150.25.
- 5 shares of TSLA bought at $266.72.
- Repeat for additional portfolios (e.g., `Portfolio2`, `Portfolio3`, etc.), each in its own input field.
- You can add multiple buy commands for the same stock within a portfolio by including additional entries (e.g., `AAPL:160.50x20`).
3. **Apply Settings**:
- Save the settings to apply the portfolio data to the chart.
- The indicator will calculate and display the PNL based on the current market prices of the entered stocks.
4. **Monitor PNL**:
- View the profit and loss for each portfolio directly on the chart, with customizable display options (e.g., table, labels, or graphical overlays, depending on indicator settings).
## Input Format
Each portfolio’s data must be entered manually in the indicator’s settings dialog, with one input field per portfolio. The format is as follows:
```
PortfolioName:StockTicker:BuyPricexBuyAmount;StockTicker:BuyPricexBuyAmount
```
- **PortfolioName**: A unique name for the portfolio (e.g., `Portfolio1`, `Growth`, `Tech`).
- **StockTicker**: The stock symbol (e.g., `AAPL`, `GOOGL`).
- **BuyPrice**: The purchase price per share (e.g., `150.25`).
- **BuyAmount**: The number of shares purchased (e.g., `10`).
- **Separator**: Use `:` to separate portfolio name, ticker, and buy data; `x` to separate price and amount; and `;` to separate multiple stock entries.
**Example Input for Multiple Portfolios**:
- Portfolio 1:
```
GrowthPortfolio:AAPL:150.25x10;TSLA:266.72x5;MSFT:305.10x8
```
- Portfolio 2:
```
DividendPortfolio:KO:55.20x50;PG:145.30x30
```
Companion Tool
To simplify portfolio management, use the **SBC Portfo Manager** desktop app (available separately). This tool allows Hebrew-speaking users to create, edit, and export portfolio data in the correct format, which can then be copied and pasted into the indicator’s settings. Note: The SBC Portfo Manager is an independent tool and not affiliated with TradingView.
Notes
- **Hebrew Support**: Instructions and labels in the settings dialog are optimized for Hebrew users, ensuring clarity and ease of use.
- **Unlimited Flexibility**: Add as many stocks and buy commands as needed per portfolio, with no upper limit.
- **Manual Input**: Portfolio data must be entered manually in the settings dialog. Ensure the format is correct to avoid errors.
- **Compatibility**: Works with any stock ticker supported by TradingView.
Disclaimer
The SBC Portfo PNL Indicator is an independent tool created to assist Hebrew-speaking traders in tracking portfolio performance. It is **not** affiliated with TradingView. Always verify your portfolio data and consult with a financial advisor before making trading decisions.
Support
For questions, issues, or feature requests, please contact the developer via TradingView or check the (github.com) for additional resources.
License
This indicator is provided under the Attribution-NonCommercial 4.0 International license. Please review the terms on the GitHub repository or contact the developer for details.
Live Futures Relative Strength and Position SizerRecommends contract, stoploss and take profit size depending on 1-minute ATR. Also plots a table to show relative strength of YM, NQ, ES and RTY since the latest daily candle open.
ETF Builder & Backtest System [TradeDots]Create, analyze, and monitor your own custom “ETF-like” portfolio directly on TradingView. This script merges up to 10 different assets with user-defined weightings into a single composite chart, allowing you to see how your personalized portfolio would have performed historically. It is an original tool designed to help traders and investors quickly gauge risk and return profiles without leaving the TradingView platform.
📝 HOW IT WORKS
1. Custom Portfolio Construction
Multiple Assets : Combine up to 10 different stocks, ETFs, cryptocurrencies, or other symbols.
User-Defined Weights : Allocate each asset a percentage weight (e.g., 15% in AAPL, 10% in MSFT, etc.).
Single Composite Value : The script calculates a weighted “ETF-style” price, effectively simulating a merged portfolio curve on your chart.
2. Performance Tracking & Return Analysis
Automatic History Capture : The indicator records each asset’s starting price when it first appears in your chosen date range.
Rolling Updates : As time progresses, all asset prices are continually evaluated and the portfolio value is updated in real time.
Buy & Hold Returns : See how each asset—and the overall portfolio—performed from the “start” date to the most recent bar.
Annualized Return : Automatically calculates CAGR (Compound Annual Growth Rate) to help visualize performance over varying timescales.
3. Table & Visual Output
Performance Table : A comprehensive table displays individual asset returns, annualized returns, and portfolio totals.
Normalized Chart Plot : The composite ETF value is scaled to 100 at the start date, making it easy to compare relative growth or decline.
Optional Time Filter : You can define a specific date range (Start/End Dates) to focus on a particular period or to limit historical data.
⚙️ KEY FEATURES
1. Flexible Asset Selection
Choose any symbols from multiple asset classes. The script will only run calculations when data is available—no need to worry about missing quotes.
2. Dynamic Table Reporting
Start Price for each asset
Percentage Weight in the portfolio
Total Return (%) and Annualized Return (%)
3. Simple Backtesting Logic
This script takes a straightforward Buy & Hold perspective. Once the start date is reached, the portfolio remains static until the end date, so you can quickly assess hypothetical growth.
4. Plot Customization
Toggle the main “ETF” plot on/off.
Alter the visual style for tables and text.
Adjust the time filter to limit or extend your performance measurement window.
🚀 HOW TO USE IT
1. Add the Script
Search for “ETF Builder & Backtest System ” in the Indicators & Strategies tab or manually add it to your chart after saving it in your Pine Editor.
2. Configure Inputs
Enable Time Filter : Choose whether to restrict the analysis to a particular date range.
Start & End Date : Define the period you want to measure performance over (e.g., from 2019-12-31 to 2025-01-01).
Assets & Weights : Enter each symbol and specify a percentage weight (up to 10 assets).
Display Options : Pick where you want the Table to appear and choose background/text colors.
3. Interpret the Table & Plots
Asset Rows : Each asset’s ticker, weighting, start price, and performance metrics.
ETF Total Row : Summarizes total weighting, composite starting value, and overall returns.
Normalized Plot : Tracks growth/decline of the combined portfolio, starting at 100 on the chart.
4. Refine Your Strategy
Compare how different weights or a new mix of assets would have performed over the same period.
Assess if certain assets contribute disproportionately to your returns or volatility.
Use the results to guide allocations in your real trading or paper trading accounts.
❗️LIMITATIONS
1. Buy & Hold Only
This script does not handle rebalancing or partial divestments. Once the portfolio starts, weights remain fixed throughout the chosen timeframe.
2. No Reinvestment Tracking
Dividends or other distributions are not factored into performance.
3. Data Availability
If historical data for a particular asset is unavailable on TradingView, related results may display as “N/A.”
4. Market Regimes & Volatility
Past performance does not guarantee similar future behavior. Markets can change rapidly, which may render historical backtests less predictive over time.
⚠️ RISK DISCLAIMER
Trading and investing carry significant risk and can result in financial loss. The “ETF Builder & Backtest System ” is provided for informational and educational purposes only. It does not constitute financial advice.
Always conduct your own research.
Use proper risk management and position sizing.
Past performance does not guarantee future results.
This script is an original creation by TradeDots, published under the Mozilla Public License 2.0.
Use this indicator as part of a broader trading or investment approach—consider fundamental and technical factors, overall market context, and personal risk tolerance. No trading tool can assure profits; exercise caution and responsibility in all financial decisions.
Grid Bot Visualizer V1
📊 Grid Bot Visualizer – V1
A dynamic and visual support tool for grid trading strategies.
🔧 Key Features
• Fixed grid levels based on a central entry price
• Customizable spacing, number of levels, and range
• Color-coded lines (🟢 green above, 🔴 red below)
• Expands automatically when price exceeds boundaries (within the defined box)
• Optional price labels shown outside the grid
• Grid visually framed by a blue box
• Vertical line to mark grid origin
• Built-in alert when price hits a grid level
⚙️ Use Case
Ideal for visualizing grid bot logic in volatile markets.
Monitor how price interacts with predefined zones.
✅ Alert Ready
Use alertcondition to get notified when a grid level is touched.
Max RR CalculatorAutomatically calculates the maximum RR reached during trade. Entry is at the candle close. There is an option available that takes another trade after getting stopped out on the next candle that is in same bias as first trade.
(If the first trade is a long and gets stopped out, then the second trade will wait until the next up candle to enter long again)
EMA/VWAP Signal with AlertsEMA + VWAP with alerts to identify entry and exit points. Recommended for stocks.
Price Map Profile [BigBeluga]An advanced volume-based tool designed to map out how trading activity is distributed across price levels. It combines dynamic volume profiling with structural pivot detection to highlight key levels of interest in the market — including hidden support/resistance zones and dominant liquidity areas.
Unlike traditional volume profiles locked to fixed sessions, this indicator continuously processes historical bars to build a real-time "map" of volume distribution. It intelligently reveals where buyers and sellers were most active, helping traders pinpoint high-impact zones with clarity.
🔵 KEY FEATURES
Creates a volume map profile by scanning price action over a defined lookback window (`length`).
Divides price vertically into volume bins (default: 100) and aggregates either total volume or bar count per bin.
Bins are plotted as horizontal zones extending to the right of the chart — wider offset means more volume at that price.
Each zone is color-coded using gradients to represent volume magnitude:
- Below average volume = cool tones (blue/teal)
- Above average volume = warm tones (red/orange)
The highest volume bin is highlighted with a red label showing the exact volume, helping to identify strong price agreement.
Detects pivot highs and lows using a 15-bar swing method, marking them as potential S/R levels.
If a pivot level is located inside a low-volume zone (volume < average), it is emphasized with a dashed line and label .
Pivot line color matches direction:
- High pivots = yellow
- Low pivots = aqua
The volume of the bin containing the pivot is shown alongside the pivot, providing volume context for the structural level.
Filters out nearby duplicate pivots using ATR-based distance checks to ensure clean and non-redundant signals.
🔵 HOW TO USE
Use the wide red zones as liquidity and consolidation areas where price may stall, reverse, or absorb volume.
Pivot-based dashed lines within low-volume zones highlight hidden support/resistance levels where price may react sharply.
Combine this indicator with trend or order flow tools to validate reversal or breakout setups .
Switch between Volume and Frequency modes to adapt to the type of data your asset provides.
🔵 CONCLUSION
The Price Map Profile transforms raw volume into an actionable visual map. By aligning volume depth with key market structure levels, it helps traders identify where market participants are most active — and where hidden inefficiencies lie. Ideal for traders seeking precision entries, dynamic S/R zones, and deeper volume structure insight.
Advanced Momentum Scanner [QuantAlgo]The Advanced Momentum Scanner is a sophisticated technical indicator designed to identify market momentum and trend direction using multiple exponential moving averages (EMAs), momentum metrics, and adaptive visualization techniques. It is particularly valuable for those looking to identify trading and investing opportunities based on trend changes and momentum shifts across any market and timeframe.
🟢 Technical Foundation
The Advanced Momentum Scanner utilizes a multi-layered approach with four different EMA periods to identify market momentum and trend direction:
Ultra-Fast EMA for quick trend changes detection (default: 5)
Fast EMA for short-term trend analysis (default: 10)
Mid EMA for intermediate confirmation (default: 30)
Slow EMA for long-term trend identification (default: 100)
For momentum detection, the indicator implements a Rate of Change (RoC) calculation to measure price momentum over a specified period. It further enhances analysis by incorporating RSI readings for overbought/oversold conditions, volatility measurements through ATR, and optional volume confirmation. When these elements align, the indicator generates trading signals based on the selected sensitivity mode (Conservative, Balanced, or Aggressive).
🟢 Key Features & Signals
1. Multi-Period Trend Identification
The indicator combines multiple EMAs of different lengths to provide comprehensive trend analysis within the same timeframe, displaying the information through color-coded visual elements on the chart.
When an uptrend is detected, chart elements are colored with the bullish theme color (default: green/teal).
Similarly, when a downtrend is detected, chart elements are colored with the bearish theme color (default: red).
During neutral or indecisive periods, chart elements are colored with a neutral gray color, providing clear visual distinction between trending and non-trending market conditions.
This visualization provides immediate insights into underlying trend direction without requiring separate indicators, helping traders and investors quickly identify the market's current state.
2. Trend Strength Information Panel
The trend panel operates in three different sensitivity modes (Conservative, Aggressive, and Balanced), each affecting how the indicator processes and displays market information.
The Conservative mode prioritizes trend sustainability over frequency, showing only strong trend movements with high probability.
The Aggressive mode detects early trend changes, providing more frequent signals but potentially more false positives.
The Balanced mode offers a middle ground with moderate signal frequency and reliability.
Regardless of the selected mode, the panel displays:
Current trend direction (UPTREND, DOWNTREND, or NEUTRAL)
Trend strength percentage (0-100%)
Early detection signals when applicable
The active sensitivity mode
This comprehensive approach helps traders and investors:
→ Assess the strength of current market trends
→ Identify early potential trend changes before full confirmation
→ Make more informed trading and investing decisions based on trend context
3. Customizable Visualization Settings
This indicator offers extensive visual customization options to suit different trading styles and preferences:
Display options:
→ Fully customizable uptrend, downtrend, and neutral colors
→ Color-coded price bars showing trend direction
→ Dynamic gradient bands visualizing potential trend channels
→ Optional background coloring based on trend intensity
→ Adjustable transparency levels for all visual elements
These visualization settings can be fine-tuned through the indicator's interface, allowing traders and investors to create a personalized chart environment that emphasizes the most relevant information for their strategy.
The indicator also features a comprehensive alert system with notifications for:
New trend formations (uptrend, downtrend, neutral)
Early trend change signals
Momentum threshold crossovers
Other significant market conditions
Alerts can be customized and delivered through TradingView's notification system, making it easy to stay informed of important market developments even when you are away from the charts.
🟢 Practical Usage Tips
→ Trend Analysis and Interpretation: The indicator visualizes trend direction and strength directly on the chart through color-coding and the information panel, allowing traders and investors to immediately identify the current market context. This information helps in assessing the potential for continuation or reversal.
→ Signal Generation Strategies: The indicator generates potential trading signals based on trend direction, momentum confirmation, and selected sensitivity mode. Users can choose between Conservative (fewer but more reliable signals), Balanced (moderate approach), or Aggressive (more frequent but potentially less reliable signals).
→ Multi-Period Trend Assessment: Through its layered EMA approach, the indicator enables users to understand trend conditions across different lookback periods within the same timeframe. This helps in identifying the dominant trend and potential turning points.
🟢 Pro Tips
Adjust EMA periods based on your timeframe:
→ Lower values for shorter timeframes and more frequent signals
→ Higher values for higher timeframes and more reliable signals
Fine-tune sensitivity mode based on your trading style:
→ "Conservative" for position trading/long-term investing and fewer false signals
→ "Balanced" for swing trading/medium-term investing with moderate signal frequency
→ "Aggressive" for scalping/day trading and catching early trend changes
Look for confluence between components:
→ Strong trend strength percentage and direction in the information panel
→ Overall market context aligning with the expected direction
Use for multiple trading approaches:
→ Trend following during strong momentum periods
→ Counter-trend trading at band extremes during overextension
→ Early trend change detection with sensitivity adjustments
→ Stop loss placement using dynamic bands
Combine with:
→ Volume indicators for additional confirmation
→ Support/resistance analysis for strategic entry/exit points
→ Multiple timeframe analysis for broader market context
Vietnamese Stocks: Multi-Ticker Fibonacci AlertThis Pine Script™ indicator is designed specifically for traders monitoring the Vietnamese stock market (HOSE, HNX). Its primary goal is to automate the tracking of Fibonacci retracement levels across a large list of stocks, alerting you when prices breach key support zones.
Core Functionality:
The script calculates Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) for up to 40 tickers simultaneously. The calculation is based on the highest high and lowest low identified since a user-defined Start Time. This allows you to anchor the Fibonacci analysis to a specific market event, trend start, or time period relevant to your strategy.
What it Does For You:
Automated Watchlist Scanning: Instead of drawing Fib levels on dozens of charts, select one of the two pre-configured watchlists (up to 40 symbols each, customizable in settings) populated with popular Vietnamese stocks.
Time-Based Fibonacci: Define a Start Time in the settings. The script uses this date to find the subsequent highest high and lowest low for each symbol in your chosen watchlist, forming the basis for the Fib calculation.
Intelligent Alerts: Get notified via TradingView's alerts when the candle closing price of any stock in your active watchlist falls below the critical 38.2%, 50%, 61.8%, or 78.6% levels relative to its own high/low range since the start time. Alerts are consolidated for efficiency.
Visual Aids:
- Plots the same time-based Fibonacci levels directly on your current chart symbol for quick reference.
- Includes an optional on-chart table showing which monitored stocks are currently below key Fib levels (enable "Show Debug Info").
- Features experimental background coloring to highlight potential bullish signals on the current chart.
Configuration:
Start Time: Crucial input – sets the anchor point for Fib calculations.
WatchList Selection: Choose between WatchList #1 (Bluechip/Midcap focus) or WatchList #2 (Defensive/Other focus) using the boolean toggles.
Symbol Customization: Easily replace the default symbols with your preferred Vietnamese stocks directly in the indicator settings.
Notification Prefix: Add custom text to the beginning of your alert messages.
Alert Setup: Remember to create an alert in TradingView, selecting this indicator and the alert() condition, usually with "Once Per Bar Close" frequency.
This tool is open-source under the MPL 2.0 license. Feel free to use, modify, and learn from it.
Enhanced Execution ToolA comprehensive position sizing calculator for disciplined risk management
Description :
This tool provides traders with precise position sizing calculations based on their account parameters and market conditions. The indicator calculates optimal position sizes for different entry scenarios while maintaining strict risk control.
Key Features:
Multiple entry options (High, Close, Manual)
Flexible stop loss configuration (LoD or Previous Day Low)
Account-based risk management (1% risk by default)
ATR-based distance metrics for volatility assessment
Clear visual table displaying all critical trade parameters
How to Use:
Configure your account size and risk percentage
Select your preferred entry methods (High/Close/Manual)
Choose stop loss reference (Low of Day or Previous Day Low)
View calculated position sizes and risk parameters
For manual entries, input your desired entry and stop prices
Input Parameters:
Account Configuration: Set your capital and risk tolerance
Entry Options: Choose which entry methods to display
Stop Loss: Select stop loss reference level
Technical Settings: Adjust ATR length and distance limits
Display Options: Customize table appearance
Output Includes:
Risk amount in dollars
Risk as percentage of entry price
Entry to stop loss as percentage of ATR
Stop loss price
Entry price
Position size as % of account
Share quantity
Ideal For:
Traders who want to maintain consistent risk management
Those who need quick position sizing calculations
Investors who trade with multiple entry strategies
Note: Always verify calculations before executing trades. This tool is designed to assist with trade planning, not as trade advice.
AI-123's BTC vs Gold (Lag Correlation)
DISCLAIMER
I made this indicator with the help of ChatGPT and using what I have learned so far from The Pine Script Mastery Course, LOTS of edits based on what I have learned so far had to be made as well as additions and modifications to my liking thanks to what I have learned so far. I am aware this already exists but I have done my best to make a first ever script/indicator while learning how to properly publish as well, so please bear that in mind.
Overview
This indicator analyzes the correlation between Bitcoin (BTC) and Gold (XAUUSD), with a customizable lag applied to the Gold price, providing insight into the macro relationship between these two assets.
It is designed for traders and investors who want to track how Bitcoin and Gold move in relation to each other, particularly when Gold is lagged by a specific number of days.
Key Features:
BTC and Gold (Lagged) Price Overlay: Display Bitcoin (BTC) and Gold (XAUUSD) prices on the chart, with an adjustable lag applied to the Gold price.
Rolling Correlation Calculation: Measures the correlation between Bitcoin and lagged Gold prices over a customizable lookback period.
Adjustable Lag: The number of days that Gold is lagged relative to Bitcoin is fully customizable (default: 20 days).
Customizable Correlation Length: Allows you to choose the lookback period for the correlation (default: 50 days), providing flexibility for short-term or long-term analysis.
Normalized Plotting: Prices of Bitcoin and Gold are normalized for better visual alignment with the correlation values. BTC is divided by 1000, and Gold by 100.
Correlation Scaling: The correlation value is amplified by 10 for better visual clarity and comparison with price data.
Zero Line: Horizontal line representing a correlation of 0, making it easier to identify positive or negative correlation shifts.
Maximum Correlation Lines: Horizontal lines at +10 and -10 values for extreme correlation scenarios.
Input Settings:
Gold Symbol: Customize the Gold ticker (default: OANDA:XAUUSD).
Bitcoin Symbol: Customize the Bitcoin ticker (default: BINANCE:BTCUSDT).
Lag (in trading days): Adjust the number of trading days to lag the Gold price relative to Bitcoin (default: 20).
Correlation Length (days): Set the number of days over which the rolling correlation is calculated (default: 50).
How to Use:
Price Comparison: The BTC (Spot) and Lagged Gold plots give you a side-by-side visual comparison of the two assets, normalized for clarity.
Correlation Line: The correlation line helps you gauge the strength and direction of the relationship between BTC and lagged Gold. Positive values indicate a strong positive correlation, while negative values indicate a negative correlation.
Visual Analysis: Watch how the correlation shifts with changes in lag and correlation length to identify potential market dynamics between Bitcoin and Gold.
Potential Applications:
Macro Trading: Track how Bitcoin and Gold behave in relation to each other during periods of economic uncertainty or inflation.
Sentiment Analysis: Use the correlation data to understand the sentiment between digital and traditional assets.
Strategic Timing: Identify potential opportunities where Bitcoin and Gold show a strong correlation or diverge based on the lag adjustment.
Understanding Macro Trends/Correlations.
Disclaimer:
This indicator is for informational purposes only. The correlation between Bitcoin and Gold does not guarantee future performance, and users should conduct their own research and use risk management strategies when making trading decisions.
Notes: This script uses historical data, so results may vary across different timeframes.
Customization options allow users to adjust the lag and correlation length to better fit their trading strategy.
Future Enhancements: Additional Correlation Line: A second correlation line for different lengths of lag or different assets.
Color-Coding of Correlation: Future updates may include color-coded correlation strength, visually indicating positive or negative correlation more effectively.
NQ/MNQ Position Sizing
Despite having my own position sizing calculator in an excel sheet, the manual process of having to identify my next trade, switch tabs/screens, input my values into the sheet, go back into TV, input the trade parameters with appropriate contract sizing, has always really gotten to me. I also found that I would often miss ideal entries due to the delay this caused.
I searched TV for position sizing calculators but almost all the ones I found seemed to be similar: based on some form of manual input for the entry and stop parameters, many of which had way more settings and parameters than I needed, also over complicated things.
I just needed something that would allow me to dynamically set my entry and stop levels directly on the chart, and spit out the appropriate contracts I should be using, either on NQ or MNQ, to maintain my desired level of risk, so I could quickly execute the necessary trade.
So, I coded my own and it's been a huge help to me already, so I thought I may as well publish the script as can't imagine there aren't others out there that also hate the manual data entry process of calculating risk.
Upon first load, the script will ask you to set your Entry and Stop levels, before drawing respective lines for these on the chart, and calculating contract sizing based on your risk settings, which you can update directly. The reset values may be buggy, will be easier to just remove the script and re-apply it to your chart if you ever lose track of the levels you've set.
Hope it's useful.
Lot Size TableLot Size Table Indicator – Pine Script (v5)
This TradingView script, “Lot Size Table,” creates a dynamic on-chart table that helps forex traders quickly calculate position sizes (lot sizes) for different capital and risk settings across various stop-loss (SL) pip scenarios.
🔧 Key Features:
📊 Real-time Forex Price Integration
Retrieves daily forex prices from OANDA for accurate lot size adjustments.
Instruments supported: USDJPY, USDCHF, AUDUSD, GBPUSD, NZDUSD, USDCAD, EURUSD.
🧠 Smart Lot Size Adjustments
Custom function adjustLotSize() adjusts lot sizes based on:
The currency of the instrument (e.g., JPY, GBP, AUD, etc.).
Special multiplier for symbols like US30 (e.g., ×8.5).
🧾 Flexible Capital & Risk Inputs
Supports 3 customizable capital groups, each with its own:
Capital amount
Risk percentage
📉 Multiple Stop-Loss (SL) Scenarios
Users input a comma-separated list of SL pip values (e.g., "20,25,30,...").
For each SL value, lot sizes are calculated for all 3 capital/risk combinations.
📋 Formatted On-Chart Table
Displays in a user-selected corner of the chart.
Customizable size, background color, and border.
Header row includes capital values and risk % (formatted to "k" if over 1,000).
Remaining rows show calculated lot sizes for each SL pip value.
📐 How It Works:
User Inputs: Capital, risk %, SL pip list, and table styling.
Calculation:
Lot size = (capital × risk%) / (SL pips × 10)
Adjusted based on instrument’s currency.
Display:
Table shows all SL pip scenarios and the corresponding adjusted lot sizes for each capital group.
Drawdown Visualizer v1.0Drawdown Visualizer
The Drawdown Visualizer tracks the percentage decline from all-time highs, providing valuable insights into market corrections and potential buying opportunities.
Key Features:
1) Real-Time Drawdown Tracking: The indicator continuously calculates and displays the current percentage drawdown from the all-time high price, color-coded from green (minimal drawdown) to red (severe drawdown) for instant visual feedback.
2) Maximum Drawdown Detection: Permanently tracks and displays the maximum historical drawdown encountered during the analyzed period, helping traders understand worst-case scenarios.
3) Statistical Analysis: Calculates and displays three important statistical measures:
* Average Drawdown: The mean value of all drawdowns recorded
* Median Drawdown: The middle value in the sorted list of all drawdowns, providing insight
into typical decline patterns
* Normal Drawdown Range: Visualizes the expected range of typical drawdowns based on
statistical standard deviation
Practical Applications:
1) Risk Management: Understand typical and extreme drawdowns to set appropriate stop-loss levels
2) Market Context: Gain perspective on whether current corrections are normal or exceptional
3) Entry Point Analysis: Identify potential buying opportunities when drawdowns reach statistical extremes
OverUnder Yield Spread🗺️ OverUnder is a structural regime visualizer , engineered to diagnose the shape, tone, and trajectory of the yield curve. Rather than signaling trades directly, it informs traders of the world they’re operating in. Yield curve steepening or flattening, normalizing or inverting — each regime reflects a macro pressure zone that impacts duration demand, liquidity conditions, and systemic risk appetite. OverUnder abstracts that complexity into a color-coded compression map, helping traders orient themselves before making risk decisions. Whether you’re in bonds, currencies, crypto, or equities, the regime matters — and OverUnder makes it visible.
🧠 Core Logic
Built to show the slope and intent of a selected rate pair, the OverUnder Yield Spread defaults to 🇺🇸US10Y-US2Y, but can just as easily compare global sovereign curves or even dislocated monetary systems. This value is continuously monitored and passed through a debounce filter to determine whether the curve is:
• Inverted, or
• Steepening
If the curve is flattening below zero: the world is bracing for contraction. Policy lags. Risk appetite deteriorates. Duration gets bid, but only as protection. Stocks and speculative assets suffer, regardless of positioning.
📍 Curve Regimes in Bull and Bear Contexts
• Flattening occurs when the short and long ends compress . In a bull regime, flattening may reflect long-end demand or fading growth expectations. In a bear regime, flattening often precedes or confirms central bank tightening.
• Steepening indicates expanding spread . In a bull context, this may signal healthy risk appetite or early expansion. In a bear or crisis context, it may reflect aggressive front-end cuts and dislocation between short- and long-term expectations.
• If the curve is steepening above zero: the world is rotating into early expansion. Risk assets behave constructively. Bond traders position for normalization. Equities and crypto begin trending higher on rising forward expectations.
🖐️ Dynamically Colored Spread Line Reflects 1 of 4 Regime States
• 🟢 Normal / Steepening — early expansion or reflation
• 🔵 Normal / Flattening — late-cycle or neutral slowdown
• 🟠 Inverted / Steepening — policy reversal or soft landing attempt
• 🔴 Inverted / Flattening — hard contraction, credit stress, policy lag
🍋 The Lemon Label
At every bar, an anchored label floats directly on the spread line. It displays the active regime (in plain English) and the precise spread in percent (or basis points, depending on resolution). Colored lemon yellow, neither green nor red, the label is always legible — a design choice to de-emphasize bias and center the data .
🎨 Fill Zones
These bands offer spatial, persistent views of macro compression or inversion depth.
• Blue fill appears above the zero line in normal (non-inverted) conditions
• Red fill appears below the zero line during inversion
🧪 Sample Reading: 1W chart of TLT
OverUnder reveals a multi-year arc of structural inversion and regime transition. From mid-2021 through late 2023, the spread remains decisively inverted, signaling persistent flattening and credit stress as bond prices trended sharply lower. This prolonged inversion aligns with a high-volatility phase in TLT, marked by lower highs and an accelerating downtrend, confirming policy lag and macro tightening conditions.
As of early 2025, the spread has crossed back above the zero baseline into a “Normal / Steepening” regime (annotated at +0.56%), suggesting a macro inflection point. Price action remains subdued, but the shift in yield structure may foreshadow a change in trend context — particularly if follow-through in steepening persists.
🎭 Different Traders Respond Differently:
• Bond traders monitor slope change to anticipate policy pivots or recession signals.
• Equity traders use regime shifts to time rotations, from growth into defense, or from contraction into reflation.
• Currency traders interpret curve steepening as yield compression or divergence depending on region.
• Crypto traders treat inversion as a liquidity vacuum — and steepening as an early-phase risk unlock.
🛡️ Can It Compare Different Bond Markets?
Yes — with caveats. The indicator can be used to compare distinct sovereign yield instruments, for example:
• 🇫🇷FR10Y vs 🇩🇪DE10Y - France vs Germany
• 🇯🇵JP10Y vs 🇺🇸US10Y - BoJ vs Fed policy curves
However:
🙈 This no longer visualizes the domestic yield curve, but rather the differential between rate expectations across regions
🙉 The interpretation of “inversion” changes — it reflects spread compression across nations , not within a domestic yield structure
🙊 Color regimes should then be viewed as relative rate positioning , not absolute curve health
🙋🏻 Example: OverUnder compares French vs German 10Y yields
1. 🇫🇷 Change the long-duration ticker to FR10Y
2. 🇩🇪 Set the short-duration ticker to DE10Y
3. 🤔 Interpret the result as: “How much higher is France’s long-term borrowing cost vs Germany’s?”
You’ll see steepening when the spread rises (France decoupling), flattening when the spread compresses (convergence), and inversions when Germany yields rise above France’s — historically rare and meaningful.
🧐 Suggested Use
OverUnder is not a signal engine — it’s a context map. Its value comes from situating any trade idea within the prevailing yield regime. Use it before entries, not after them.
• On the 1W timeframe, OverUnder excels as a macro overlay. Yield regime shifts unfold over quarters, not days. Weekly structure smooths out rate volatility and reveals the true curvature of policy response and liquidity pressure. Use this view to orient your portfolio, define directional bias, or confirm long-duration trend turns in assets like TLT, SPX, or BTC.
• On the 1D timeframe, the indicator becomes tactically useful — especially when aligning breakout setups or trend continuations with steepening or flattening transitions. Daily views can also identify early-stage regime cracks that may not yet be visible on the weekly.
• Avoid sub-daily use unless you’re anchoring a thesis already built on higher timeframe structure. The yield curve is a macro construct — it doesn’t oscillate cleanly at intraday speeds. Shorter views may offer clarity during event-driven spikes (like FOMC reactions), but they do not replace weekly context.
Ultimately, OverUnder helps you decide: What kind of world am I trading in? Use it to confirm macro context, avoid fighting the curve, and lean into trades aligned with the broader pressure regime.
Correlation Heatmap█ OVERVIEW
This indicator creates a correlation matrix for a user-specified list of symbols based on their time-aligned weekly or monthly price returns. It calculates the Pearson correlation coefficient for each possible symbol pair, and it displays the results in a symmetric table with heatmap-colored cells. This format provides an intuitive view of the linear relationships between various symbols' price movements over a specific time range.
█ CONCEPTS
Correlation
Correlation typically refers to an observable statistical relationship between two datasets. In a financial time series context, it usually represents the extent to which sampled values from a pair of datasets, such as two series of price returns, vary jointly over time. More specifically, in this context, correlation describes the strength and direction of the relationship between the samples from both series.
If two separate time series tend to rise and fall together proportionally, they might be highly correlated. Likewise, if the series often vary in opposite directions, they might have a strong anticorrelation . If the two series do not exhibit a clear relationship, they might be uncorrelated .
Traders frequently analyze asset correlations to help optimize portfolios, assess market behaviors, identify potential risks, and support trading decisions. For instance, correlation often plays a key role in diversification . When two instruments exhibit a strong correlation in their returns, it might indicate that buying or selling both carries elevated unsystematic risk . Therefore, traders often aim to create balanced portfolios of relatively uncorrelated or anticorrelated assets to help promote investment diversity and potentially offset some of the risks.
When using correlation analysis to support investment decisions, it is crucial to understand the following caveats:
• Correlation does not imply causation . Two assets might vary jointly over an analyzed range, resulting in high correlation or anticorrelation in their returns, but that does not indicate that either instrument directly influences the other. Joint variability between assets might occur because of shared sensitivities to external factors, such as interest rates or global sentiment, or it might be entirely coincidental. In other words, correlation does not provide sufficient information to identify cause-and-effect relationships.
• Correlation does not predict the future relationship between two assets. It only reflects the estimated strength and direction of the relationship between the current analyzed samples. Financial time series are ever-changing. A strong trend between two assets can weaken or reverse in the future.
Correlation coefficient
A correlation coefficient is a numeric measure of correlation. Several coefficients exist, each quantifying different types of relationships between two datasets. The most common and widely known measure is the Pearson product-moment correlation coefficient , also known as the Pearson correlation coefficient or Pearson's r . Usually, when the term "correlation coefficient" is used without context, it refers to this correlation measure.
The Pearson correlation coefficient quantifies the strength and direction of the linear relationship between two variables. In other words, it indicates how consistently variables' values move together or in opposite directions in a proportional, linear manner. Its formula is as follows:
𝑟(𝑥, 𝑦) = cov(𝑥, 𝑦) / (𝜎𝑥 * 𝜎𝑦)
Where:
• 𝑥 is the first variable, and 𝑦 is the second variable.
• cov(𝑥, 𝑦) is the covariance between 𝑥 and 𝑦.
• 𝜎𝑥 is the standard deviation of 𝑥.
• 𝜎𝑦 is the standard deviation of 𝑦.
In essence, the correlation coefficient measures the covariance between two variables, normalized by the product of their standard deviations. The coefficient's value ranges from -1 to 1, allowing a more straightforward interpretation of the relationship between two datasets than what covariance alone provides:
• A value of 1 indicates a perfect positive correlation over the analyzed sample. As one variable's value changes, the other variable's value changes proportionally in the same direction .
• A value of -1 indicates a perfect negative correlation (anticorrelation). As one variable's value increases, the other variable's value decreases proportionally.
• A value of 0 indicates no linear relationship between the variables over the analyzed sample.
Aligning returns across instruments
In a financial time series, each data point (i.e., bar) in a sample represents information collected in periodic intervals. For instance, on a "1D" chart, bars form at specific times as successive days elapse.
However, the times of the data points for a symbol's standard dataset depend on its active sessions , and sessions vary across instrument types. For example, the daily session for NYSE stocks is 09:30 - 16:00 UTC-4/-5 on weekdays, Forex instruments have 24-hour sessions that span from 17:00 UTC-4/-5 on one weekday to 17:00 on the next, and new daily sessions for cryptocurrencies start at 00:00 UTC every day because crypto markets are consistently open.
Therefore, comparing the standard datasets for different asset types to identify correlations presents a challenge. If two symbols' datasets have bars that form at unaligned times, their correlation coefficient does not accurately describe their relationship. When calculating correlations between the returns for two assets, both datasets must maintain consistent time alignment in their values and cover identical ranges for meaningful results.
To address the issue of time alignment across instruments, this indicator requests confirmed weekly or monthly data from spread tickers constructed from the chart's ticker and another specified ticker. The datasets for spreads are derived from lower-timeframe data to ensure the values from all symbols come from aligned points in time, allowing a fair comparison between different instrument types. Additionally, each spread ticker ID includes necessary modifiers, such as extended hours and adjustments.
In this indicator, we use the following process to retrieve time-aligned returns for correlation calculations:
1. Request the current and previous prices from a spread representing the sum of the chart symbol and another symbol ( "chartSymbol + anotherSymbol" ).
2. Request the prices from another spread representing the difference between the two symbols ( "chartSymbol - anotherSymbol" ).
3. Calculate half of the difference between the values from both spreads ( 0.5 * (requestedSum - requestedDifference) ). The results represent the symbol's prices at times aligned with the sample points on the current chart.
4. Calculate the arithmetic return of the retrieved prices: (currentPrice - previousPrice) / previousPrice
5. Repeat steps 1-4 for each symbol requiring analysis.
It's crucial to note that because this process retrieves prices for a symbol at times consistent with periodic points on the current chart, the values can represent prices from before or after the closing time of the symbol's usual session.
Additionally, note that the maximum number of weeks or months in the correlation calculations depends on the chart's range and the largest time range common to all the requested symbols. To maximize the amount of data available for the calculations, we recommend setting the chart to use a daily or higher timeframe and specifying a chart symbol that covers a sufficient time range for your needs.
█ FEATURES
This indicator analyzes the correlations between several pairs of user-specified symbols to provide a structured, intuitive view of the relationships in their returns. Below are the indicator's key features:
Requesting a list of securities
The "Symbol list" text box in the indicator's "Settings/Inputs" tab accepts a comma-separated list of symbols or ticker identifiers with optional spaces (e.g., "XOM, MSFT, BITSTAMP:BTCUSD"). The indicator dynamically requests returns for each symbol in the list, then calculates the correlation between each pair of return series for its heatmap display.
Each item in the list must represent a valid symbol or ticker ID. If the list includes an invalid symbol, the script raises a runtime error.
To specify a broker/exchange for a symbol, include its name as a prefix with a colon in the "EXCHANGE:SYMBOL" format. If a symbol in the list does not specify an exchange prefix, the indicator selects the most commonly used exchange when requesting the data.
Note that the number of symbols allowed in the list depends on the user's plan. Users with non-professional plans can compare up to 20 symbols with this indicator, and users with professional plans can compare up to 32 symbols.
Timeframe and data length selection
The "Returns timeframe" input specifies whether the indicator uses weekly or monthly returns in its calculations. By default, its value is "1M", meaning the indicator analyzes monthly returns. Note that this script requires a chart timeframe lower than or equal to "1M". If the chart uses a higher timeframe, it causes a runtime error.
To customize the length of the data used in the correlation calculations, use the "Max periods" input. When enabled, the indicator limits the calculation window to the number of periods specified in the input field. Otherwise, it uses the chart's time range as the limit. The top-left corner of the table shows the number of confirmed weeks or months used in the calculations.
It's important to note that the number of confirmed periods in the correlation calculations is limited to the largest time range common to all the requested datasets, because a meaningful correlation matrix requires analyzing each symbol's returns under the same market conditions. Therefore, the correlation matrix can show different results for the same symbol pair if another listed symbol restricts the aligned data to a shorter time range.
Heatmap display
This indicator displays the correlations for each symbol pair in a heatmap-styled table representing a symmetric correlation matrix. Each row and column corresponds to a specific symbol, and the cells at their intersections correspond to symbol pairs . For example, the cell at the "AAPL" row and "MSFT" column shows the weekly or monthly correlation between those two symbols' returns. Likewise, the cell at the "MSFT" row and "AAPL" column shows the same value.
Note that the main diagonal cells in the display, where the row and column refer to the same symbol, all show a value of 1 because any series of non-na data is always perfectly correlated with itself.
The background of each correlation cell uses a gradient color based on the correlation value. By default, the gradient uses blue hues for positive correlation, orange hues for negative correlation, and white for no correlation. The intensity of each blue or orange hue corresponds to the strength of the measured correlation or anticorrelation. Users can customize the gradient's base colors using the inputs in the "Color gradient" section of the "Settings/Inputs" tab.
█ FOR Pine Script® CODERS
• This script uses the `getArrayFromString()` function from our ValueAtTime library to process the input list of symbols. The function splits the "string" value by its commas, then constructs an array of non-empty strings without leading or trailing whitespaces. Additionally, it uses the str.upper() function to convert each symbol's characters to uppercase.
• The script's `getAlignedReturns()` function requests time-aligned prices with two request.security() calls that use spread tickers based on the chart's symbol and another symbol. Then, it calculates the arithmetic return using the `changePercent()` function from the ta library. The `collectReturns()` function uses `getAlignedReturns()` within a loop and stores the data from each call within a matrix . The script calls the `arrayCorrelation()` function on pairs of rows from the returned matrix to calculate the correlation values.
• For consistency, the `getAlignedReturns()` function includes extended hours and dividend adjustment modifiers in its data requests. Additionally, it includes other settings inherited from the chart's context, such as "settlement-as-close" preferences.
• A Pine script can execute up to 40 or 64 unique `request.*()` function calls, depending on the user's plan. The maximum number of symbols this script compares is half the plan's limit, because `getAlignedReturns()` uses two request.security() calls.
• This script can use the request.security() function within a loop because all scripts in Pine v6 enable dynamic requests by default. Refer to the Dynamic requests section of the Other timeframes and data page to learn more about this feature, and see our v6 migration guide to learn what's new in Pine v6.
• The script's table uses two distinct color.from_gradient() calls in a switch structure to determine the cell colors for positive and negative correlation values. One call calculates the color for values from -1 to 0 based on the first and second input colors, and the other calculates the colors for values from 0 to 1 based on the second and third input colors.
Look first. Then leap.
CME Price Limits (Futures Prop Firm Rule)This indicator shows the CME Price Limit, combined with a safety distance that is used by several futures prop firms. Trading in the highlighted area means a rule violation for many Futures prop firm accounts.
The levels are calculated from the "Settlement as close" closing price of the previous daily candle.
Live Risk/Reward Lines (Dynamic Update: Tick or Bar Close)This script displays dynamic Risk and Reward target lines directly on the chart.
You can choose whether the updates happen live with each price tick or only once a bar closes.
It supports both long and short trading directions, with customizable risk and reward percentages.
Key Features:
Dynamic live updates (per tick or per bar close).
Choose Long or Short trade direction.
Customize risk and reward percentages individually.
Adjustable line length and color.
Option to show or hide risk and reward lines.
How It Works:
For long trades: Risk = Close Price * (1 - Risk %), Reward = Close Price * (1 + Reward %).
For short trades: Risk = Close Price * (1 + Risk %), Reward = Close Price * (1 - Reward %).
Lines are automatically centered around the current bar.
Why It Is Unique:
Unlike static risk/reward indicators, this script allows traders to see real-time dynamic changes based on the latest tick or bar close.
It offers full flexibility for scalpers and swing traders by allowing manual control over update timing and visualization style.
Usage Instructions:
Select your trade direction (Long or Short) from the settings.
Set your preferred risk and reward percentages.
Choose whether lines should update with every tick or only on bar close.
Optionally adjust the length and colors of the lines.
Important:
The script focuses on visualizing risk and reward directly on the price chart without giving buy or sell signals.
Disclaimer:
This tool is intended for educational and informational purposes only and should not be considered financial advice.
Circuit Breaker - MFFUThis Indicator Is Used To Protect User From Over Trading After Market Hit The Circuit Breakers.
The CME Exchange Usually Halts Trading If Market Hit + or - 7%.
To Protect Users From Extreme Volatile Condition MFFU, Halts Trading If Market Hits + or - 5%.
This Indicator helps us to plot the circuit breaking lines helping us to when to stop trading.
Z-Score Normalized Volatility IndicesVolatility is one of the most important measures in financial markets, reflecting the extent of variation in asset prices over time. It is commonly viewed as a risk indicator, with higher volatility signifying greater uncertainty and potential for price swings, which can affect investment decisions. Understanding volatility and its dynamics is crucial for risk management and forecasting in both traditional and alternative asset classes.
Z-Score Normalization in Volatility Analysis
The Z-score is a statistical tool that quantifies how many standard deviations a given data point is from the mean of the dataset. It is calculated as:
Z = \frac{X - \mu}{\sigma}
Where X is the value of the data point, \mu is the mean of the dataset, and \sigma is the standard deviation of the dataset. In the context of volatility indices, the Z-score allows for the normalization of these values, enabling their comparison regardless of the original scale. This is particularly useful when analyzing volatility across multiple assets or asset classes.
This script utilizes the Z-score to normalize various volatility indices:
1. VIX (CBOE Volatility Index): A widely used indicator that measures the implied volatility of S&P 500 options. It is considered a barometer of market fear and uncertainty (Whaley, 2000).
2. VIX3M: Represents the 3-month implied volatility of the S&P 500 options, providing insight into medium-term volatility expectations.
3. VIX9D: The implied volatility for a 9-day S&P 500 options contract, which reflects short-term volatility expectations.
4. VVIX: The volatility of the VIX itself, which measures the uncertainty in the expectations of future volatility.
5. VXN: The Nasdaq-100 volatility index, representing implied volatility in the Nasdaq-100 options.
6. RVX: The Russell 2000 volatility index, tracking the implied volatility of options on the Russell 2000 Index.
7. VXD: Volatility for the Dow Jones Industrial Average.
8. MOVE: The implied volatility index for U.S. Treasury bonds, offering insight into expectations for interest rate volatility.
9. BVIX: Volatility of Bitcoin options, a useful indicator for understanding the risk in the cryptocurrency market.
10. GVZ: Volatility index for gold futures, reflecting the risk perception of gold prices.
11. OVX: Measures implied volatility for crude oil futures.
Volatility Clustering and Z-Score
The concept of volatility clustering—where high volatility tends to be followed by more high volatility—is well documented in financial literature. This phenomenon is fundamental in volatility modeling and highlights the persistence of periods of heightened market uncertainty (Bollerslev, 1986).
Moreover, studies by Andersen et al. (2012) explore how implied volatility indices, like the VIX, serve as predictors for future realized volatility, underlining the relationship between expected volatility and actual market behavior. The Z-score normalization process helps in making volatility data comparable across different asset classes, enabling more effective decision-making in volatility-based strategies.
Applications in Trading and Risk Management
By using Z-score normalization, traders can more easily assess deviations from the mean in volatility, helping to identify periods when volatility is unusually high or low. This can be used to adjust risk exposure or to implement volatility-based trading strategies, such as mean reversion strategies. Research suggests that volatility mean-reversion is a reliable pattern that can be exploited for profit (Christensen & Prabhala, 1998).
References:
• Andersen, T. G., Bollerslev, T., Diebold, F. X., & Vega, C. (2012). Realized volatility and correlation dynamics: A long-run approach. Journal of Financial Economics, 104(3), 385-406.
• Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 31(3), 307-327.
• Christensen, B. J., & Prabhala, N. R. (1998). The relation between implied and realized volatility. Journal of Financial Economics, 50(2), 125-150.
• Whaley, R. E. (2000). Derivatives on market volatility and the VIX index. Journal of Derivatives, 8(1), 71-84.
Option Contract Size CalculatorOption Contract Size Calculator
This indicator helps you to figure out the ideal number of contracts for your trade and its only used for options day trading.
The indicator needs to fill the input section in order to give you the information table that includes Contract size .
The input section consists of two sections. The first section requires user entry of the delta of the options contract from the broker chain and the stop loss size on the chart.
The second section allows you to enter your account balance and risk per trade
(2% recommended) .
There is also the option for where you wish to display your table like bottom right , bottom left or top right, top left.
special thanks to @Mohamedawke for the open source script this code is based off
TP/SL Percentage & RR Visual ToolThis tool is designed to help traders visually and statistically assess their trade setup by calculating Stop Loss (SL), Take Profit (TP), and Risk-to-Reward (RR) based on percentage inputs from the current price.
🔧 How It Works:
Uses the current candle’s close price as your entry.
Calculates TP and SL as percentage-based levels (e.g., 1% SL, 1.5% TP).
Displays horizontal lines and labels on the chart for TP and SL (only on the latest candle to reduce clutter).
Shows a compact table in the top-right corner with all key values:
Entry Price
Current Price
TP Price (+%)
SL Price (-%)
TP Distance from current price
RR Ratio (e.g., 1:1.5)
💡 Use Cases:
Quickly validate if a trade setup meets your desired RR profile (e.g., 1:2).
Perfect for scalpers, swing traders, and position traders who rely on structured risk management.
Combine with your entry signal strategy to visualize targets and stops without manual calculations.
⚙️ Inputs:
Stop Loss % – Sets how far your SL is from the entry.
Take Profit % – Sets how far your TP is from the entry.