200 EMA Breakout & Retest Strategy200 EMA Breakout & Retest Strategy
This script is designed for traders who rely on the 200 EMA as a key indicator for trend direction and trade setups. The strategy identifies potential buy and sell opportunities based on breakouts and subsequent retests of the 200 EMA.
How It Works
EMA Breakout Detection:
The script monitors when the price crosses and closes above or below the 200 EMA.
No signal is generated immediately upon the breakout.
Retest Confirmation:
After the breakout, the price must retrace to touch the 200 EMA.
A valid signal occurs only when the price touches the EMA and the candle closes above (for buy) or below (for sell).
Trade Signal Generation:
Once the retest is confirmed:
A Buy Signal is generated if the price closes above the 200 EMA after the retest.
A Sell Signal is generated if the price closes below the 200 EMA after the retest.
The script calculates:
Stop Loss: Placed at the low of the candle for a buy signal and at the high of the candle for a sell signal.
Take Profit: Based on a customizable Risk-Reward Ratio (default is 1:2).
Visual Indicators:
The 200 EMA is plotted on the chart for reference.
Buy/Sell signals are displayed as labels on the chart.
Stop loss and take profit levels are drawn using dotted lines.
Customization Options
EMA Length: Adjustable (default is 200).
Risk-Reward Ratio: Customizable to suit different trading styles.
Who Is This For?
This strategy is ideal for traders who:
Prefer trading with the trend using EMA-based strategies.
Look for precise entry points with confirmation from retests.
Require automated calculation of risk-reward levels.
Statistics
CAD CHF JPY (Index) vs USDDescription:
Analyze the combined performance of CAD, CHF, and JPY against the USD with this customized Forex currency index. This tool enables traders to gain a broader perspective of how these three currencies behave relative to the US Dollar by aggregating their movements into a single index. It’s a versatile tool designed for traders seeking actionable insights and trend identification.
Core Features:
Flexible Display Options:
Choose between Line Mode for a simplified view of the index trend or Candlestick Mode for detailed analysis of price action.
Custom Weight Adjustments:
Fine-tune the weight of each currency pair (USD/CAD, USD/CHF, USD/JPY) to better reflect your trading priorities or market expectations.
Moving Average Integration:
Add a moving average to smooth the data and identify trends more effectively. Choose your preferred type: SMA, EMA, WMA, or VWMA, and configure the number of periods to suit your strategy.
Streamlined Calculation:
The index aggregates data from USD/CAD, USD/CHF, and USD/JPY using a weighted average of their OHLC (Open, High, Low, Close) values, ensuring accuracy and adaptability to different market conditions.
Practical Applications:
Trend Identification:
Use the Line Mode with a moving average to confirm whether CAD, CHF, and JPY collectively show strength or weakness against the USD. A rising trendline signals currency strength, while a declining line suggests USD dominance.
Weight-Based Analysis:
If CAD is expected to lead, adjust its weight higher relative to CHF and JPY to emphasize its influence in the index. This customization makes the indicator adaptable to your market outlook.
Actionable Insights:
Identify key reversal points or breakout opportunities by analyzing the interaction of the index with its moving average. Combined with other technical tools, this indicator becomes a robust addition to any trader’s toolkit.
Additional Notes:
This indicator is a valuable resource for comparing the collective behavior of CAD, CHF, and JPY against the USD. Pair it with additional oscillators or divergence tools for a comprehensive market overview.
Perfect for both intraday analysis and swing trading strategies. Combine it with EUR GPB AUD (Index) indicator.
Good Profits!
Futuristic Indicator v3 - Enhanced Glow & Strength MetersTo ensure candles are display by script go to trading view settings and uncheck default Candle, Body and Wick to prevent them from plotting over your modified candles.
Futuristic Indicator v3 - Enhanced Glow & Strength Meters: Detailed Breakdown
This Modern styled Pine Script indicator is designed to enhance technical analysis by providing a visually striking OLED-style dashboard with multiple market insights. It integrates trend detection, momentum analysis, volatility tracking, and strength meters into a single, streamlined interface for traders.
1️⃣ Customizable Features for Flexibility
The indicator offers multiple user-configurable settings, allowing traders to adjust the display based on their trading strategy and preferences. Users can toggle elements such as strength meters, volatility indicators, trend arrows, moving averages, and buy/sell alerts. Additionally, background and candle colors can be customized for better readability.
🔹 Why is this useful?
Traders can customize their charts to focus on the data they care about.
Reduces chart clutter by allowing users to toggle features on or off.
2️⃣ Trend Detection Using EMAs
This indicator detects market trends using two Exponential Moving Averages (EMA):
A "Fast" EMA (shorter period) for quick trend shifts.
A "Slow" EMA (longer period) to confirm trends.
Comparison of the two EMAs determines if the trend is bullish (uptrend) or bearish (downtrend).
The indicator colors the trend lines accordingly and adds a trend arrow 📈📉 for quick visual cues.
🔹 Why is this useful?
EMA crossovers are widely used to identify trend reversals.
Provides clear visual cues for traders to confirm entry & exit points.
3️⃣ RSI-Based Momentum Analysis
The indicator integrates the Relative Strength Index (RSI) to gauge market momentum. The momentum value changes color dynamically based on whether it's in bullish (>50) or bearish (<50) territory.
🔹 Why is this useful?
RSI helps identify overbought and oversold conditions.
Detects trend strength by measuring the speed of price movements.
4️⃣ Bullish & Bearish Strength Meters
The indicator quantifies bullish and bearish market strength based on RSI and converts it into a percentage-based meter:
Bullish Strength (Long Strength)
Bearish Strength (Short Strength)
Strength meters are displayed using OLED-styled bars, dynamically changing in real-time.
🔹 Why is this useful?
Allows traders to visually gauge market sentiment at a glance.
Helps confirm if a trend has strong momentum or is losing strength.
5️⃣ Market Volatility Indicator (ATR-Based)
The indicator includes a volatility tracker using the Average True Range (ATR):
ATR is scaled up to provide easier readability.
Higher ATR values indicate higher market volatility.
🔹 Why is this useful?
Helps traders identify potential breakout or consolidation phases.
Allows better risk management by understanding price fluctuations.
6️⃣ Trend Strength Calculation
The indicator calculates trend strength based on the difference between the EMAs:
A higher trend strength value suggests a stronger directional trend.
Displayed as a percentage for better clarity.
🔹 Why is this useful?
Helps traders differentiate between strong and weak trends.
Reduces the likelihood of entering weak or choppy markets.
7️⃣ OLED-Style Dashboard for Market Data
A futuristic OLED-styled table is used to display critical market data in a visually appealing way:
Trend direction (Bullish/Bearish with an arrow 📈📉).
Current price.
Momentum value.
Strength meters (Bullish/Bearish).
Trend strength percentage.
Volatility Meter
The dashboard uses high-contrast colors and neon glow effects, making it easier to read against dark backgrounds.
🔹 Why is this useful?
Provides a centralized view of key trading metrics.
Eliminates the need to manually calculate trend strength.
8️⃣ Modern Style Neon Glow Effects
To enhance visibility, the indicator applies glowing effects to:
Moving Averages (EMAs): Highlighted with layered glow effects.
Candlesticks: Borders and wicks dynamically change color based on trend direction.
🔹 Why is this useful?
Improves readability in low-contrast or dark-mode charts.
Helps traders spot trends faster without reading numerical data.
9️⃣ Automated Buy & Sell Alerts
The script triggers alerts when momentum crosses key levels:
Above 55 → Potential Long Setup
Below 45 → Potential Short Setup.
🔹 Why is this useful?
Alerts help traders react quickly without constantly monitoring the chart.
Reduces the risk of missing critical trade opportunities.
🔹 Final Summary: Why is This Indicator Useful?
This futuristic cyberpunk-styled trading tool enhances traditional market analysis by combining technical indicators with high-visibility visuals.
🔹 Key Benefits:
✅ Customizable Display – Toggle elements based on trading needs.
✅ Trend Detection – EMAs highlight uptrends & downtrends.
✅ Momentum Tracking – RSI-based momentum gauge identifies strong moves.
✅ Strength Meters – Bullish/Bearish power is clearly visualized.
✅ Volatility Insights – ATR-based metric highlights market turbulence.
✅ Trend Strength Analysis – Quantifies trend intensity.
✅ Dashboard – Provides a centralized, easy-to-read data panel.
✅ Cyberpunk Neon Glow – Enhances clarity with stylish aesthetics.
✅ Real-Time Alerts – Helps traders react to key opportunities.
This indicator is designed to be both functional and visually appealing, making market analysis more intuitive and efficient. 🚀
Multiple Values TableThis Pine Script indicator, named "Multiple Values Table," provides a comprehensive view of various technical indicators in a tabular format directly on your trading chart. It allows traders to quickly assess multiple metrics without switching between different charts or panels.
Key Features:
Table Position and Size:
Users can choose the position of the table on the chart (e.g., top left, top right).
The size of the table can be adjusted (e.g., tiny, small, normal, large).
Moving Averages:
Calculates the 5-day Exponential Moving Average (5DEMA) using daily data.
Calculates the 5-week and 20-week EMAs (5WEMA and 20WEMA) using weekly data.
Indicates whether the current price is above or below these moving averages in percentage terms.
Drawdown and Williams VIX Fix:
Computes the drawdown from the 365-day high to the current close.
Calculates the Williams VIX Fix (WVF), which measures the volatility of the asset.
Shows both the current WVF and a 2% drawdown level.
Relative Strength Index (RSI):
Displays the current RSI and compares it to the RSI from 14 days ago.
Indicates whether the RSI is increasing, decreasing, or flat.
Stochastic RSI:
Computes the Stochastic RSI and compares it to the value from 14 days ago.
Indicates whether the Stochastic RSI is increasing, decreasing, or flat.
Normalized MACD (NMACD):
Calculates the Normalized MACD values.
Indicates whether the MACD is increasing, decreasing, or flat.
Awesome Oscillator (AO):
Calculates the AO on a daily timeframe.
Indicates whether the AO is increasing, decreasing, or flat.
Volume Analysis:
Displays the average volume over the last 22 days.
Shows the current day's volume as a percentage of the average volume.
Percentile Calculations:
Calculates the current percentile rank of the WVF and ATH over specified periods.
Indicates the percentile rank of the current volume percentage over the past period.
Table Display:
All these values are presented in a neatly formatted table.
The table updates dynamically with the latest data.
Example Use Cases:
Comprehensive Market Analysis: Quickly assess multiple indicators at a glance.
Trend and Momentum Analysis: Identify trends and momentum changes based on various moving averages and oscillators.
Volatility and Drawdown Monitoring: Track volatility and drawdown levels to manage risk effectively.
This script offers a powerful tool for traders who want to have a holistic view of various technical indicators in one place. It provides flexibility in customization and a user-friendly interface to enhance your trading experience.
Trading IQ - Razor IQIntroducing TradingIQ's first dip buying/shorting all-in-one trading system: Razor IQ.
Razor IQ is an exclusive trading algorithm developed by TradingIQ, designed to trade upside/downside price dips of varying significance in trending markets. By integrating artificial intelligence and IQ Technology, Razor IQ analyzes historical and real-time price data to construct a dynamic trading system adaptable to various asset and timeframe combinations.
Philosophy of Razor IQ
Razor IQ operates on a single premise: Trends must retrace, and these retracements offer traders an opportunity to join in the overarching trend. At some point traders will enter against a trend in aggregate and traders in profitable positions entered during the trend will scale out. When occurring simultaneously, a trend will retrace against itself, offering an opportunity for traders not yet in the trend to join in the move and continue the trend.
Razor IQ is designed to work straight out of the box. In fact, its simplicity requires just a few user settings to manage output, making it incredibly straightforward to manage.
Long Limit Order Stop Loss and Minimum ATR TP/SL are the only settings that manage the performance of Razor IQ!
Traders don’t have to spend hours adjusting settings and trying to find what works best - Razor IQ handles this on its own.
Key Features of Razor IQ
Self-Learning Retracement Detection
Employs AI and IQ Technology to identify notable price dips in real-time.
AI-Generated Trading Signals
Provides retracement trading signals derived from self-learning algorithms.
Comprehensive Trading System
Offers clear entry and exit labels.
Performance Tracking
Records and presents trading performance data, easily accessible for user analysis.
Self-Learning Trading Exits
Razor IQ learns where to exit positions.
Long and Short Trading Capabilities
Supports both long and short positions to trade various market conditions.
How It Works
Razor IQ operates on a straightforward heuristic: go long during the retracement of significant upside price moves and go short during the retracement of significant downside price moves.
IQ Technology, TradingIQ's proprietary AI algorithm, defines what constitutes a “trend” and a “retracement” and what’s considered a tradable dip buying/shorting opportunity. For Razor IQ, this algorithm evaluates all historical trends and retracements, how much trends generally retrace and how long trends generally persist. For instance, the "dip" following an uptrend is measured and learned from, including the significance of the identified trend level (how long it has been active, how much price has increased, etc). By analyzing these patterns, Razor IQ adapts to identify and trade similar future retracements and trends.
In simple terms, Razor IQ clusters previous trend and retracement data in an attempt to trade similar price sequences when they repeat in the future. Using this knowledge, it determines the optimal, current price level where joining in the current trend (during a retracement) has a calculated chance of not stopping out before trend continuation.
For long positions, Razor IQ enters using a market order at the AI-identified long entry price point. If price closes beneath this level a market order will be placed and a long position entered. Of course, this is how the algorithm trades, users can elect to use a stop-limit order amongst other order types for position entry. After the position is entered TP1 is placed (identifiable on the price chart). TP1 has a twofold purpose:
Acts as a legitimate profit target to exit 50% of the position.
Once TP1 is achieved, a stop-loss order is immediately placed at breakeven, and a trailing stop loss controls the remainder of the trade. With this, so long as TP1 is achieved, the position will not endure a loss. So long as price continues to uptrend, Razor IQ will remain in the position.
For short positions, Razor IQ provides an AI-identified short entry level. If price closes above this level a market order will be placed and a short position entered. Again, this is how the algorithm trades, users can elect to use a stop-limit order amongst other order types for position entry. Upon entry Razor IQ implements a TP order and SL order (identifiable on the price chart).
Downtrends, in most markets, usually operate differently than uptrends. With uptrends, price usually increases at a modest pace with consistency over an extended period of time. Downtrends behave in an opposite manner - price decreases rapidly for a much shorter duration.
With this observation, the long dip entry heuristic differs slightly from the short dip entry heuristic.
The long dip entry heuristic specializes in identifying larger, long-term uptrends and entering on retracement of the uptrends. With a dedicated trailing stop loss, so long as the uptrend persists, Razor IQ will remain in the position.
The short dip entry heuristic specializes in identifying sharp, significant downside price moves, and entering short on upside volatility during these moves. A fixed stop loss and profit target are implemented for short positions - no trailing stop is used.
As a trading system, Razor IQ exits all TP orders using a limit order, with all stop losses exited as stop market orders.
What Classifies As a Tradable Dip?
For Razor IQ, tradable price dips are not manually set but are instead learned by the system. What qualifies as an exploitable price dip in one market might not hold the same significance in another. Razor IQ continuously analyzes historical and current trends (if one exists), how far price has moved during the trend, the duration of the trend, the raw-dollar price move of price dips during trends, and more, to determine which future price retracements offer a smart chance to join in any current price trend.
The image above illustrates the Razor Line Long Entry point.
The green line represents the Long Retracement Entry Point.
The blue upper line represents the first profit target for the trade.
The blue lower line represents the trailing stop loss start point for the long position.
The position is entered once price closes below the green line.
The green Razor Lazor long entry point will only appear during uptrends.
The image above shows a long position being entered after the Long Razor Lazor was closed beneath.
Green arrows indicate that the strategy entered a long position at the highlighted price level.
Blue arrows indicate that the strategy exited a position, whether at TP1, the initial stop loss, or at the trailing stop.
Blue lines above the entry price indicate the TP1 level for the current long trade. Blue lines below the current price indicate the initial stop loss price.
If price reaches TP1, a stop loss will be immediately placed at breakeven, and the in-built trailing stop will determine the future exit price.
A blue line (similar to the blue line shown for TP1) will trail price and correspond to the trailing stop price of the trade.
If the trailing stop is above the breakeven stop loss, then the trailing stop will be hit before the breakeven stop loss, which means the remainder of the trade will be exited at a profit.
If the breakeven stop loss is above the trailing stop, then the breakeven stop loss will be hit first. In this case, the remainder of the position will be exited at breakeven.
The image above shows the trailing stop price, represented by a blue line, and the breakeven stop loss price, represented by a pink line, used for the long position!
You can also hover over the trade labels to get more information about the trade—such as the entry price and exit price.
The image above exemplifies Razor IQ's output when a downtrend is active.
When a downtrend is active, Razor IQ will switch to "short mode". In short mode, Razor IQ will display a neon red line. This neon red line indicates the Razor Lazor short entry point. When price closes above the red Razor Lazor line a short position is entered.
The image above shows Razor IQ during an active short position.
The image above shows Razor IQ after completing a short trade.
Red arrows indicate that the strategy entered a short position at the highlighted price level.
Blue arrows indicate that the strategy exited a position, whether at the profit target or the fixed stop loss.
Blue lines indicate the profit target level for the current trade when below price. and blue lines above the current price indicate the stop loss level for the short trade.
Short traders do not utilize a trailing stop - only a fixed profit target and fixed stop loss are used.
You can also hover over the trade labels to get more information about the trade—such as the entry price and exit price.
Minimum Profit Target And Stop Loss
The Minimum ATR Profit Target and Minimum ATR Stop Loss setting control the minimum allowed profit target and stop loss distance. On most timeframes users won’t have to alter these settings; however, on very-low timeframes such as the 1-minute chart, users can increase these values so gross profits exceed commission.
After changing either setting, Razor IQ will retrain on historical data - accounting for the newly defined minimum profit target or stop loss.
AI Direction
The AI Direction setting controls the trade direction Razor IQ is allowed to take.
“Trade Longs” allows for long trades.
“Trade Shorts” allows for short trades.
Verifying Razor IQ’s Effectiveness
Razor IQ automatically tracks its performance and displays the profit factor for the long strategy and the short strategy it uses. This information can be found in the table located in the top-right corner of your chart showing.
This table shows the long strategy profit factor and the short strategy profit factor.
The image above shows the long strategy profit factor and the short strategy profit factor for Razor IQ.
A profit factor greater than 1 indicates a strategy profitably traded historical price data.
A profit factor less than 1 indicates a strategy unprofitably traded historical price data.
A profit factor equal to 1 indicates a strategy did not lose or gain money when trading historical price data.
Using Razor IQ
While Razor IQ is a full-fledged trading system with entries and exits - manual traders can certainly make use of its on chart indications and visualizations.
The hallmark feature of Razor IQ is its ability to signal an acceptable dip entry opportunity - for both uptrends and downtrends. Long entries are often signaled near the bottom of a retracement for an uptrend; short entries are often signaled near the top of a retracement for a downtrend.
Razor IQ will always operate on exact price levels; however, users can certainly take advantage of Razor IQ's trend identification mechanism and retracement identification mechanism to use as confluence with their personally crafted trading strategy.
Of course, every trend will reverse at some point, and a good dip buying/shorting strategy will often trade the reversal in expectation of the prior trend continuing (retracement). It's important not to aggressively filter retracement entries in hopes of avoiding an entry when a trend reversal finally occurs, as this will ultimately filter out good dip buying/shorting opportunities. This is a reality of any dip trading strategy - not just Razor IQ.
Of course, you can set alerts for all Razor IQ entry and exit signals, effectively following along its systematic conquest of price movement.
Crodl Position Size CalculatorThe Crodl Size Position Calculator is a powerful and intuitive tool designed for traders to calculate their position size, risk, and reward before entering a trade. This indicator simplifies trade planning by providing clear calculations of key metrics such as risk-to-reward ratio, position size, expected profit, and current PnL (Profit and Loss).
Features:
Dynamic Input Fields: Customize your trade parameters, including risk loss, leverage, entry price, stop loss, and take profit.
Position Size Calculation: Automatically calculate the number of units to trade based on your risk tolerance and leverage.
Risk/Reward Ratio: See the ratio of potential profit to risk for informed decision-making.
Real-Time PnL Tracking: Monitor your current profit or loss directly on the chart.
Expected Profit Projection: Displays the profit potential based on your risk-to-reward ratio.
Position Plotting: Visualize your entry, stop loss, and take profit levels directly on the chart with color-coded lines and zones.
User-Friendly Table: A detailed table provides clear visibility of all trade metrics, including:
Risk Loss
Leverage
Entry Price
Stop Loss
Take Profit
Risk/Reward Ratio
Bet Amount
Crypto Units
Real-Time PnL
Expected Profit
How It Works:
Set Your Parameters: Input your desired risk loss, leverage, entry price, stop loss, and take profit levels in the settings.
Get Instant Results: The indicator calculates position size, PnL, expected profit, and other key metrics.
Visualize on the Chart: See your entry, stop loss, and take profit levels plotted on the chart for clarity.
Review the Trade Table: A table at the bottom-right of the screen summarizes all calculations and updates dynamically as the market price changes.
Who is it for? This indicator is ideal for traders of all experience levels, whether you're a beginner learning risk management or a professional looking for efficient trade planning tools.
Customization Options:
Adjust the size of the plotted position zones.
Enable or disable zone plotting for a cleaner chart.
Tailor inputs to match your trading strategy.
Note: Always use proper risk management and ensure your trading parameters align with your personal trading goals and strategy. Use at Own Risk
Closing Prices for Indices AMMOthe "Closing Prices for Indices" indicator displays the daily closing prices of four major stock indices: FTSE 100, DAX 40, Dow Jones Industrial Average, and NASDAQ Composite. The indicator updates the prices based on their respective market closing times:
FTSE 100 and DAX 40: Updates at 4:30 PM UK time.
Dow Jones and NASDAQ Composite: Updates at 9:00 PM UK time.
Key features:
Customizable Labels: Option to display labels showing the closing prices directly on the chart.
Color-Coded Lines: Plots each index's closing price using distinct, customizable colors for easy differentiation.
User-Friendly Settings: Includes options for customizing line and label colors.
This indicator is perfect for traders and analysts looking to monitor and compare key index closing prices visually on their charts.
Best Buffett Ratio w/ Std-Dev Offset + Conditional PlotSummary:
This script provides a visually clear way to track the so-called “Buffett Ratio,”
a popular market valuation gauge which compares the total US stock market cap
to the country’s GDP. In addition, it plots a “hardcoded” long-term trend line,
along with fixed standard-deviation bands (in log space), and uses background colors
to signal potentially overvalued or undervalued zones.
What Is the Buffett Ratio?
Often credited to Warren Buffett, the Buffett Ratio (or Buffett Indicator) measures:
(Total US Stock Market Capitalization) / (US GDP)
• A higher ratio typically means equities are more expensive relative to the size of the economy.
• A lower ratio suggests equities may be more attractively valued compared to GDP.
Historically, the ratio has tended to drift upward over many decades,
as the US economy and stock markets grow, but it still oscillates around some trend over time.
How to Use
1) Add to Chart:
- In TradingView, simply apply the indicator (it internally fetches CRSPTM1 & GDP data).
2) Tweak Inputs:
- Log Offset for 1σ: Adjust how wide the ±1σ/±2σ bands appear around the trend.
- Anchor Points: Edit startYear , endYear , startRatio , endRatio
if you want a different slope or different “fair value” anchors.
3) Interpretation:
- If the indicator is above +2σ (red line) , it’s historically “very expensive,”
often leading to lower future returns over the long term.
- If it’s below –2σ (green line) , it’s historically “deep undervaluation,”
often pointing to better future returns over time.
- The intermediate zones show degrees of mild over- or undervaluation.
How This Script Works
1) Buffett Ratio Calculation:
- The script requests data from TradingView’s built-in CRSPTM1 index (total US market cap).
- It also requests US GDP data via request.economic("US", "GDP") .
- If GDP data is missing, the ratio becomes na on that bar.
2) Hardcoded Trend Line:
- Rather than a rolling average, the script uses two “anchors” (e.g. 1950 → 0.30 ratio, 2024 → 1.25 ratio)
and solves for a single log-growth rate to produce a steady upward slope.
3) Fixed Standard Deviations in Log Space:
- The script takes the log of the trend line, then applies a fixed offset for ±1σ and ±2σ,
creating proportional bands that do not “expand/contract” from a rolling window.
4) Conditional Plotting:
- The script only begins plotting once the Buffett Ratio actually has data (around 2011).
5) Color-Coded Zones:
- Above +2σ: red background (historically very expensive)
- Between +1σ and +2σ: yellow background (moderately expensive)
- Between –1σ and +1σ: no background color (around normal)
- Between –2σ and –1σ: aqua background (moderately undervalued)
- Below –2σ: green background (historically deep undervaluation)
Final Notes
• Data Limitations: US GDP data and CRSPTM1 only go back so far, so this starts around 2011.
• Long-Term vs. Short-Term: Best viewed on monthly/quarterly charts and interpreted over years.
• Tuning: If you believe structural changes have shifted the ratio’s fair slope,
adjust the code’s anchors or log offsets.
Enjoy, and use responsibly!
Countdown Candle RRS// Countdown Candle RRS Indicator
//
// This indicator displays a countdown timer for the current candle on the chart.
// It shows the remaining time until the current candle closes, providing traders
// with a visual reference for time-based decision making.
//
// Features:
// - Customizable countdown display (size, position, and color)
// - Adapts to different timeframes (daily, hourly, and minute-based)
// - Displays time in appropriate format based on the chart timeframe
// - Daily or higher: XdHH:MM:SS (e.g., 2d05:30:15)
// - Hourly: HH:MM:SS
// - Minute or lower: MM:SS
// - Updates in real-time on the last candle
//
// Usage:
// - Add this indicator to your chart to see the countdown timer
// - Use the input options to customize the appearance and position of the timer
// - The timer will update on each tick, showing the time remaining until the current candle closes
//
// Note: This indicator is particularly useful for traders who need precise timing
// for entry or exit decisions, especially in fast-moving markets or when using
// specific time-based strategies.
//
// Author: reza rashidi
// Version: 1.0
Comprehensive Volume and Metrics with Pre-Market Volume Data
This script is designed for traders who want a detailed view of market activity, including regular market and pre-market volume, dollar volume, relative volume (RVOL), average daily range (ADR), average true range (ATR), relative strength index (RSI), and the QQQ’s percentage change.
The script includes customizable metrics displayed in tables on the chart for easy analysis, with the option to toggle the visibility of each metric.
Key Features:
Volume and Dollar Volume:
Displays the volume of shares traded during the current day (or pre-market, if enabled).
Includes a calculation of dollar volume, representing the total dollar amount of trades (Volume × Close Price).
Relative Volume (RVOL):
Displays RVOL Day, which is the relative volume of the current day compared to the 2-day moving average.
Shows RVOL 90D, indicating relative volume over the past 90 days.
Both RVOL metrics are calculated as percentages and display the percentage change compared to the standard (100%).
Pre-Market Data:
Includes pre-market volume (PVOL) and pre-market dollar volume (P$ VOL) which are displayed only if pre-market data is enabled.
Tracks volume and dollar volume during pre-market hours (4:00 AM to 9:30 AM Eastern Time) for more in-depth analysis.
Optionally, shows pre-market RSI based on volume-weighted close prices.
Average Daily Range (ADR):
Displays the percentage change between the highest and lowest prices over the defined ADR period (default is 20 days).
Average True Range (ATR):
Shows the ATR, a popular volatility indicator, for a given period (default is 14 bars).
RSI (Relative Strength Index):
Displays RSI for the given period (default is 14).
RSI is calculated using pre-market data when available.
QQQ:
Shows the percentage change of the QQQ ETF from the previous day’s close.
The QQQ percentage change is color-coded: green for positive, red for negative, and gray for no change.
Customizable Inputs:
Visibility Options: Toggle the visibility of each metric, such as volume, dollar volume, RVOL, ADR, ATR, RSI, and QQQ.
Pre-Market Data: Enable or disable the display of pre-market data for volume and dollar volume.
Table Positioning: Adjust the position of tables displaying the metrics either at the bottom-left or bottom-right of the chart.
Text Color and Table Background: Choose between white or black text for the tables and customize the background color.
Tables:
The script utilizes tables to display multiple metrics in an organized and easy-to-read format.
The values are updated dynamically, reflecting real-time data as the market moves.
Pre-Market Data:
The script calculates pre-market volume and dollar volume, along with other key metrics like RSI and RVOL, to help assess market sentiment before the market officially opens.
The pre-market data is accumulated from 4:00 AM to 9:30 AM ET, allowing for pre-market analysis and comparison to regular market hours.
User-Friendly and Flexible:
This script is designed to be highly customizable, giving you the ability to toggle which metrics to display and where they appear on the chart. You can easily focus on the data that matters most to your trading strategy.
DCA Simulation for CryptoCommunity v1.1Overview
This script provides a detailed simulation of a Dollar-Cost Averaging (DCA) strategy tailored for crypto traders. It allows users to visualize how their DCA strategy would perform historically under specific parameters. The script is designed to help traders understand the mechanics of DCA and how it influences average price movement, budget utilization, and trade outcomes.
Key Features:
Combines Interval and Safety Order DCA:
Interval DCA: Regular purchases based on predefined time intervals.
Safety Order DCA: Additional buys triggered by percentage price drops.
Interactive Visualization:
Displays buy levels, average price, and profit-taking points on the chart.
Allows traders to assess how their strategy adapts to price movements.
Comprehensive Dashboard:
Tracks money spent, contracts acquired, and budget utilization.
Shows maximum amounts used if profit-taking is active.
Dynamic Safety Orders:
Resets safety orders when a new higher high is established.
Customizable Parameters:
Adjustable buy frequency, safety order settings, and profit-taking levels.
Suitable for traders with varying budgets and risk tolerances.
Default Strategy Settings:
Account Size: Default account size is set to $10,000 to represent a realistic budget for the average trader.
Commission & Slippage: Includes realistic trading fees and slippage assumptions to ensure accurate backtesting results.
Risk Management: Defaults to risking no more than 5% of the account balance per trade.
Sample Size: Optimized to generate a minimum of 100 trades for meaningful statistical analysis. Users can adjust parameters to fit longer timeframes or different datasets.
Usage Instructions:
Configure Your Strategy: Set the base order, safety order size, and buy frequency based on your preferred DCA approach.
Analyze Historical Performance: Use the chart and dashboard to understand how the strategy performs under different market conditions.
Optimize Parameters: Adjust settings to align with your risk tolerance and trading objectives.
Important Notes:
This script is for educational and simulation purposes. It is not intended to provide financial advice or guarantee profitability.
If the strategy's default settings do not meet your needs, feel free to adjust them while keeping risk management in mind.
TradingView limits the number of open trades to 999, so reduce the buy frequency if necessary to fit longer timeframes.
Price Move DetectorThe Price Move Detector is a powerful technical analysis tool that automatically detects and highlights significant price movements over a user-defined time frame. This indicator allows traders to quickly identify instances where an asset has experienced a large price change, making it easier to spot potential trading opportunities.
Key Features
Customizable Parameters: Adjust the percentage change and time period (bars or sessions) to define what qualifies as a "significant" price move.
Automatic Highlighting: The indicator overlays a background highlight on the chart whenever the price moves by the specified percentage within the chosen time period.
Flexible Time Frame: Use this indicator across various timeframes and adjust the settings to suit your trading strategy, such as detecting 100% price moves over 20 sessions.
Ideal for Historical Analysis: Perfect for backtesting and screening for past price surges, helping traders spot explosive price action and market trends.
Use Cases
Spot Potential Breakouts: Use the detector to identify stocks or assets that have made significant moves, potentially signaling the start of a breakout or new trend.
Quickly Identify Major Market Moves: Scan historical data to pinpoint times when an asset experienced substantial price changes, providing insight into past performance and future potential.
How to Use
Customize the Settings
Percentage Threshold: Set the minimum percentage increase (e.g., 50%, 100%) that qualifies as a significant move. You can experiment with different percentages to suit your analysis.
Time Period (Bars): Define the lookback period (in bars/sessions) over which the price move should be measured. For example, set it to 20 bars for a one-month time frame on a daily chart.
Analyze the Highlights
Whenever the price increases by the defined percentage over the set period, the indicator will highlight that section of the chart with a background color.
The highlighted sections will make it easy to identify historical periods of large price movements, which can be useful for spotting trends, potential breakouts, or other market behaviors.
Adjust the Parameters for Your Strategy
You can fine-tune the settings to detect smaller or larger price moves depending on your trading goals.
The indicator is flexible enough for use on different timeframes and assets, providing valuable insights across various markets.
Codi's Perp-Spot Basis# Perp-Spot Basis Indicator
This indicator calculates the percentage basis between perpetual futures and spot prices for crypto assets. It is inspired by the original concept from **Krugermacro**, with the added improvement of **automatic detection of the asset pairs** based on the current chart symbol. This enhancement makes it faster and easier to apply across different assets without manual configuration.
## How It Works
The indicator compares the perpetual futures price (e.g., `BTCUSDT.P`) to the spot price (e.g., `BTCUSDT`) on Binance. The difference is expressed as a percentage: (Perp - Spot) / Spot * 100
The results are displayed in a color-coded graph:
- **Blue (Positive Basis):** Perpetual futures are trading at a premium, indicating **bullish sentiment** among derivatives traders.
- **Red (Negative Basis):** Perpetual futures are trading at a discount, indicating **bearish sentiment** among derivatives traders.
This percentage basis is a core component in understanding funding rates and derivatives market dynamics. It serves as a faster proxy for funding rates, which typically lag behind real-time price movements.
---
## How to Use It
### General Concept
- **Red (Negative Basis):** Ideal to execute **longs** when derivatives traders are overly bearish.
- **Blue (Positive Basis):** Ideal to execute **shorts** when derivatives traders are overly bullish.
### Pullback Sniping
1. During an **uptrend**:
- If the basis turns **red** temporarily, it can signal an opportunity to **buy the dip**.
2. During a **downtrend**:
- If the basis turns **blue** temporarily, it can signal an opportunity to **sell the rip**.
3. Wait for the basis to **pop back** (higher in uptrend, lower in downtrend) to time entries more effectively—this often coincides with **stop runs** or **liquidations**.
### Intraday Execution
- **When price is falling**:
- If the basis is **red**, the move is derivatives-led (**normal**).
- If the basis is **blue**, spot traders are leading, and perps are offside—wait for **price dumps** before longing.
- **When price is rising**:
- If the basis is **blue**, the move is derivatives-led (**normal**).
- If the basis is **red**, spot traders are leading, and perps are offside—wait for **price pops** before shorting.
### Larger Time Frames
- **Consistently Blue Basis:** Indicates a **bull market** as derivatives traders are bullish over the long term.
- **Consistently Red Basis:** Indicates a **bear market** as derivatives traders are bearish over the long term.
---
## Improvements Over the Original
This version of the Perp-Spot Basis indicator **automatically detects the Binance perpetual futures and spot pairs** based on the current chart symbol. For example:
- If you are viewing `ETHUSDT`, it automatically references `ETHUSDT.P` for the perpetual futures pair and `ETHUSDT` for the spot pair in BINANCE.
lib_statemachine_modifiedLibrary "lib_statemachine_modified"
Modified to fix bugs and create getState and priorState methods.
method step(this, before, after, condition)
Namespace types: StateMachine
Parameters:
this (StateMachine)
before (int) : (int): Current state before transition
after (int) : (int): State to transition to
condition (bool) : (bool): Condition to trigger the transition
Returns: (bool): True if the state changed, else False
method step(this, after, condition)
Namespace types: StateMachine
Parameters:
this (StateMachine)
after (int) : (int): State to transition to
condition (bool) : (bool): Condition to trigger the transition
Returns: (bool): True if the state changed, else False
method currentState(this)
Namespace types: StateMachine
Parameters:
this (StateMachine)
method previousState(this)
Namespace types: StateMachine
Parameters:
this (StateMachine)
method changed(this, within_bars)
Namespace types: StateMachine
Parameters:
this (StateMachine)
within_bars (int) : (int): Number of bars to look back for a state change
Returns: (bool): True if a state change occurred within the timeframe, else False
method reset(this, condition, min_occurrences)
Namespace types: StateMachine
Parameters:
this (StateMachine)
condition (bool) : (bool): Condition to trigger the reset
min_occurrences (int) : (int): Minimum number of times the condition must be true to reset
Returns: (bool): True if the state was reset, else False
StateMachine
Fields:
state (series int)
neutral (series int)
enabled (series bool)
reset_counter (series int)
prior_state (series int)
last_change_bar (series int)
Mxwll Hedge Suite [Mxwll]Hello Traders!
The Mxwll Hedge Suite determines the best asset to hedge against the asset on your chart!
By determining correlation between the asset on your chart and a group of internally listed assets, the Mxwll Hedge Suite determines which asset from the list exhibits the highest negative correlation, and then determines exactly how many coins/shares/contracts of the asset must be bought to achieve a perfect 1:1 hedge!
The image above exemplifies the process!
The purple box on the chart shows the eligible price action used to determine correlation between the asset on my chart (BTCUSDT.P) and the list of cryptocurrencies that can be used as a hedge!
From this price action, the coin determined to have to greatest negative correlation to BTCUSDT.P is FTMUSD.
The image above further outlines the hedge table located in the bottom-right corner of your chart!
The hedge table shows exactly how many coins you’d need to purchase for the hedge asset at various leverages to achieve a perfect 1:1 hedge!
Hedge Suite works on any asset on any timeframe!
And that’s all! A short and sweet script that is hopefully helpful to traders looking to hedge their positions with a negatively correlated asset!
Thank you, Traders!
Mean Reversion Pro Strategy [tradeviZion]Mean Reversion Pro Strategy : User Guide
A mean reversion trading strategy for daily timeframe trading.
Introduction
Mean Reversion Pro Strategy is a technical trading system that operates on the daily timeframe. The strategy uses a dual Simple Moving Average (SMA) system combined with price range analysis to identify potential trading opportunities. It can be used on major indices and other markets with sufficient liquidity.
The strategy includes:
Trading System
Fast SMA for entry/exit points (5, 10, 15, 20 periods)
Slow SMA for trend reference (100, 200 periods)
Price range analysis (20% threshold)
Position management rules
Visual Elements
Gradient color indicators
Three themes (Dark/Light/Custom)
ATR-based visuals
Signal zones
Status Table
Current position information
Basic performance metrics
Strategy parameters
Optional messages
📊 Strategy Settings
Main Settings
Trading Mode
Options: Long Only, Short Only, Both
Default: Long Only
Position Size: 10% of equity
Starting Capital: $20,000
Moving Averages
Fast SMA: 5, 10, 15, or 20 periods
Slow SMA: 100 or 200 periods
Default: Fast=5, Slow=100
🎯 Entry and Exit Rules
Long Entry Conditions
All conditions must be met:
Price below Fast SMA
Price below 20% of current bar's range
Price above Slow SMA
No existing position
Short Entry Conditions
All conditions must be met:
Price above Fast SMA
Price above 80% of current bar's range
Price below Slow SMA
No existing position
Exit Rules
Long Positions
Exit when price crosses above Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
Short Positions
Exit when price crosses below Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
💼 Risk Management
Position Sizing
Default: 10% of equity per trade
Initial capital: $20,000
Commission: 0.01%
Slippage: 2 points
Maximum one position at a time
Risk Control
Use daily timeframe only
Avoid trading during major news events
Consider market conditions
Monitor overall exposure
📊 Performance Dashboard
The strategy includes a comprehensive status table displaying:
Strategy Parameters
Current SMA settings
Trading direction
Fast/Slow SMA ratio
Current Status
Active position (Flat/Long/Short)
Current price with color coding
Position status indicators
Performance Metrics
Net Profit (USD and %)
Win Rate with color grading
Profit Factor with thresholds
Maximum Drawdown percentage
Average Trade value
📱 Alert Settings
Entry Alerts
Long Entry (Buy Signal)
Short Entry (Sell Signal)
Exit Alerts
Long Exit (Take Profit)
Short Exit (Take Profit)
Alert Message Format
Strategy name
Signal type and direction
Current price
Fast SMA value
Slow SMA value
💡 Usage Tips
Consider starting with Long Only mode
Begin with default settings
Keep track of your trades
Review results regularly
Adjust settings as needed
Follow your trading plan
⚠️ Disclaimer
This strategy is for educational and informational purposes only. It is not financial advice. Always:
Conduct your own research
Test thoroughly before live trading
Use proper risk management
Consider your trading goals
Monitor market conditions
Never risk more than you can afford to lose
📋 Release Notes
14 January 2025
Added New Fast & Slow SMA Options:
Fibonacci-based periods: 8, 13, 21, 144, 233, 377
Additional period: 50
Complete Fast SMA options now: 5, 8, 10, 13, 15, 20, 21, 34, 50
Complete Slow SMA options now: 100, 144, 200, 233, 377
Bug Fixes:
Fixed Maximum Drawdown calculation in the performance table
Now using strategy.max_drawdown_percent for accurate DD reporting
Previous version showed incorrect DD values
Performance metrics now accurately reflect trading results
Performance Note:
Strategy tested with Fast/Slow SMA 13/377
Test conducted with 10% equity risk allocation
Daily Timeframe
For Beginners - How to Modify SMA Levels:
Find this line in the code:
fastLength = input.int(title="Fast SMA Length", defval=5, options= )
To add a new Fast SMA period: Add the number to the options list, e.g.,
To remove a Fast SMA period: Remove the number from the options list
For Slow SMA, find:
slowLength = input.int(title="Slow SMA Length", defval=100, options= )
Modify the options list the same way
⚠️ Note: Keep the periods that make sense for your trading timeframe
💡 Tip: Test any new combinations thoroughly before live trading
"Trade with Discipline, Manage Risk, Stay Consistent" - tradeviZion
IU Trailing Stop Loss MethodsThe 'IU Trailing Stop Loss Methods' it's a risk management tool which allows users to apply 12 trailing stop-loss (SL) methods for risk management of their trades and gives live alerts when the trailing Stop loss has hit. Below is a detailed explanation of each input and the working of the Script.
Main Inputs:
- bar_time: Specifies the date from which the trade begins and entry price will be the open of the first candle.
- entry_type: Choose between 'Long' or 'Short' positions.
- trailing_method: Select the trailing stop-loss method. Options include ATR, Parabolic SAR, Supertrend, Point/Pip based, Percentage, EMA, Highest/Lowest, Standard Deviation, and multiple target-based methods.
- exit_after_close: If checked, exits the trade only after the candle closes.
Optional Inputs:
ATR Settings:
- atr_Length: Length for the ATR calculation.
- atr_factor: ATR multiplier for SL calculation.
Parabolic SAR Settings:
- start, increment, maximum: Parameters for the Parabolic SAR indicator.
Supertrend Settings:
- supertrend_Length, supertrend_factor: Length and factor for the Supertrend indicator.
Point/Pip Based:
- point_base: Set trailing SL in points/pips.
Percentage Based:
- percentage_base: Set SL as a percentage of entry price.
EMA Settings:
- ema_Length: Length for EMA calculation.
Standard Deviation Settings:
- std_Length, std_factor: Length and factor for standard deviation calculation.
Highest/Lowest Settings:
- highest_lowest_Length: Length for the highest/lowest SL calculation.
Target-Based Inputs:
- ATR, Point, Percentage, and Standard Deviation based target SL settings with customizable lengths and multipliers.
Entry Logic:
- Trades initiate based on the entry_type selected and the specified bar_time.
- If Long is selected, a long trade is initiated when the conditions match, and vice versa for Short.
Trailing Stop-Loss (SL) Methods Explained:
The strategy dynamically adjusts stop-loss based on the chosen method. Each method has its calculation logic:
- ATR: Stop-loss calculated using ATR multiplied by a user-defined factor.
- Parabolic SAR: Uses the Parabolic SAR indicator for trailing stop-loss.
- Supertrend: Utilizes the Supertrend indicator as the stop-loss line.
- Point/Pip Based: Fixed point-based stop-loss.
- Percentage Based: SL set as a percentage of entry price.
- EMA: SL based on the Exponential Moving Average.
- Highest/Lowest: Uses the highest high or lowest low over a specified period.
- Standard Deviation: SL calculated using standard deviation.
Exit Conditions:
- If exit_after_close is enabled, the position will only close after the candle confirms the stop-loss hit.
- If exit_after_close is disabled, the strategy will close the trade immediately when the SL is breached.
Visualization:
The script plots the chosen trailing stop-loss method on the chart for easy visualization.
Target-Based Trailing SL Logic:
- When a position is opened, the strategy calculates the initial stop-loss and progressively adjusts it as the price moves favorably.
- Each SL adjustment is stored in an array for accurate tracking and visualization.
Alerts and Labels:
- When the Entry or trailing stop loss is hit this scripts draws a label and give alert to the user that trailing stop has been hit for the trade.
Note - on the historical data The Script will show nothing if the entry and the exit has happened on the same candle, because we don't know what was hit first SL or TP (basically how the candle was formed on the lower timeframe).
Summary:
This script offers flexible trailing stop-loss options for traders who want dynamic risk management in their strategies. By offering multiple methods like ATR, SAR, Supertrend, and EMA, it caters to various trading styles and risk preferences.
Uptrick: Oracle Metrics +
Introduction
Uptrick: Oracle Metrics + is a multi-dimensional trading indicator designed to consolidate various technical and risk-oriented signals into one accessible framework. It allows traders to observe market volatility, identify potential reversal points, and assess numerous performance metrics, all within a single interface.
Purpose
The main goal of this indicator is to simplify a broad array of market insights. It merges trend analysis, volatility indicators, on-chart signals, and risk-performance metrics to help traders quickly evaluate the state of a market and make more informed decisions.
Features
1. Cloud Visualization
A colored cloud overlays the chart, indicating market conditions. When the cloud narrows, it can signal upcoming breakout scenarios, as volatility compresses and price movement may accelerate. In contrast, when the cloud is wide, this could hint at an extended trend that might be nearing a pullback or retracement. Observing shifts between narrow and wide phases helps anticipate shifts in momentum.
This can be seen here:
Simple Cloud Overlay
You can also use the cloud like this: when it turns purple you sell when it turns aqua color you buy. These signals are not very accurate in ranging markets but therefore they are usually better on almost all timeframes and assets in trending markets. :
Bounces of cloud. The cloud can also be used as a type of support/resistance. In the example below you can see how the trend bounces off of the cloud. For example, you could add up to your position every time it touches the cloud and then you could fully exit when the cloud turns purple or the trend breaks below the cloud:
An example of a way you could use this indicator as a confirmation is here. In the image below, a fake signal is generated, you can eliminate this signal by waiting for the cloud to turn purple in order to have confirmation for a potential downward move:
2. Bar Coloring for Volatility and System States
Traders can choose between two bar-coloring methods:
• Volatility: Bars change color intensity based on the level of current volatility relative to a historical average. This helps in spotting abrupt changes in market behavior, where bars become more pronounced when volatility is higher. You can see the volatility information in the volatility table.
• System Score: Bars receive a color gradient determined by the indicator’s final overall score. This simplifies spotting bullish, bearish, or neutral phases without needing to inspect multiple metrics separately. The closer the final score is to zero the less the color difference between bullish and bearish is.
3. Reversion Signals and Potential Reversal Alerts
Two sets of on-chart markers help in spotting sudden shifts in momentum:
• Reversion Signals marked with the letter R: These signals combine RSI thresholds, stochastic crossovers, and EMA confirmation to identify potential reversals. RSI highlights overbought (above 70) or oversold (below 30) conditions, while stochastic crossovers confirm shifts in momentum. The EMA ensures signals align with the broader trend, reducing false positives in volatile markets. Together, these components provide a reliable way to spot potential market corrections or reversals.
• Potential Reversal Signals marked with small circles: These signals detect subtle shifts in momentum using a smoothed RSI (via TEMA) and changes in its slope. When the slope turns positive or negative near key levels, it highlights early-stage reversals. This approach helps traders identify timely entry or exit opportunities by capturing potential trend changes before they fully develop.
4. Main Metrics Table
A primary dashboard shows detailed performance measures and market analytics. Next to each value, there is a bullish or bearish arrow to hint at the current direction of that metric. The table includes the following:
• Sharpe Ratio: Offers a view of risk-adjusted returns, hinting at whether rewards outweigh the variability in price.
• Sortino Ratio: A variation of risk-adjusted return focusing more on downside risk.
• Treynor Ratio: Displays returns relative to systematic risk, referencing a user-provided beta.
• Information Ratio: Shows how the instrument is outperforming or underperforming a benchmark, scaled by tracking error.
• ROC: Rate of change in price over a specified period, reflecting momentum.
• MACD Histogram: The difference between fast and slow moving average convergence, illustrating momentum shifts.
• CMF: Chaikin Money Flow, evaluating buying or selling pressure by combining price and volume.
• Ulcer Index: A measure of drawdown intensity to gauge how severe downtrends or pullbacks have been.
• Amihud Ratio: Assesses illiquidity by comparing price impact to volume.
• Market Depth Ratio: Looks at price ranges relative to volume activity, indicating how deeply the market can absorb trades.
• S2F Ratio: Incorporates the asset’s circulating supply relative to its yearly production, sometimes referenced in markets with a defined issuance schedule.
• NVT Ratio: A network value to transactions ratio, typically applied to on-chain data.
• MVRV Ratio: Compares the asset’s market value with its realized value, highlighting overall valuation conditions.
• Autocorrelation: Shows how current price movement may be echoing previous price changes.
• Alpha: Measures excess return over what might be expected from a risk-free rate plus systematic market exposure.
• Skewness: Reveals the asymmetry of the return distribution.
• Kurtosis: Looks at whether returns have heavier or lighter tails than typical distributions.
• Max Drawdown: The largest peak-to-trough drop within a lookback window, a key measure of downside risk.
• Calmar Ratio: Evaluates returns in light of drawdowns, relating performance to the severity of pullbacks.
• Omega Ratio: Considers gains versus losses around a threshold return level to measure reward-to-risk balance.
• January Performance: A snapshot of how price behaves in January over a lookback, connected to the idea of seasonality.
• Bid-Ask Spread: Reflects the percentage difference between highest and lowest price in a period, hinting at market liquidity costs.
5. Final Score Table
After analyzing individual metrics, the indicator calculates an overall score that determines if the broader environment appears bullish, bearish, or neutral. This final score then influences optional color schemes across the chart, allowing traders to see at a glance how multiple data points combine into one stance. For those who prefer a visual “gauge,” an additional grid table can be enabled, where boxes fill with varying color intensities based on the current score. The score calculation is complex and uses a similar technique to TPI. It assigns values to each metric and then divides the score by the amount of metrics. The score is then visualized in the System Generation bar coloring option according to how intense the signal is.
Grids (visualization of how much more the score needs to be a full signal.):
6. Volatility Table
A separate table focuses on how current volatility compares with an average measure. When current volatility differs significantly from historical norms, the bars become more vividly colored. If volatility nears its average, the bars are more subdued. This helps traders know when to be cautious of sudden moves or to adapt their position sizing.
Indicator Inputs
Users can tailor numerous inputs to suit the nature of each instrument:
• Risk-Free Rate (annualized rate used for risk calculations)
• Benchmark Return (expected return of the market benchmark)
• Beta (measure of systematic risk, particularly for Treynor Ratio calculations)
• Lookback Period (window of time used for many rolling calculations)
• ROC Period (time span for the rate of change calculation)
• CMF Period (window for the Chaikin Money Flow measure)
• Ulcer Index Period (depth for the Ulcer Index reading)
• Amihud Illiquidity Period (period for measuring price impact relative to volume)
• Market Depth Ratio Period (time range for examining price breadth versus volume)
• Circulating Supply (used for the stock-to-flow calculation)
• Yearly Production (helps update the stock-to-flow ratio)
• Market Cap (overall value of the instrument, often used in ratio metrics)
• Transaction Volume (on-chain or traded volume data for NVT ratio)
• Realized Value (alternative valuation data, used in MVRV calculation)
• Threshold Return for Omega (sets a custom threshold above which returns are considered favorable)
• Bar Coloring Method (choose between volatility-based or final-score-based color themes)
• Table Text Size (adjust the display size of table entries)
• Additional parameters related to internal signals (like RSI lengths or smoothing settings) can be fine-tuned for different market behaviors. It is important to customize these fields according to the characteristics of the specific asset you are trading.
Important!
Adjust the inputs according to your current asset! The inputs under the 'Vital' section have to be adjusted so that the metrics function properly. If not well adjusted to your asset, your final score will be mixed up and System Bar coloring as well! These inputs include: Circulating Supply, Yearly Production, Market Cap, Transaction Volume, and Realized Value!
Originality and Uniqueness
Uptrick: Oracle Metrics + stands out by combining complex metrics, including calculations similar to the Trend Probability Indicator (TPI), to provide a deeper analysis of market conditions. The indicator offers multiple signals tailored to different trading scenarios, allowing users to filter and customize them manually through a variety of features. This flexibility, combined with its advanced risk and trend analysis tools, makes it a versatile solution for both momentum and long-term trading strategies.
Warnings
In some scenarios, overlapping numbers or markers may crowd the chart. A practical fix for any visual overlap is removing the indicator and then reapplying it, which generally resets the tables and color overlays.
Summary
Uptrick: Oracle Metrics + merges cloud-based analytics, bar-coloring for volatility or system state, reversion alerts, and a detailed metrics dashboard into one seamless interface. This synergy of short-term signals and long-term performance metrics aims to give traders a fuller perspective on risk, trend changes, and valuation. By tuning the inputs to each asset, traders can capture more relevant data, while the color-coded approach simplifies quick decision-making in a dynamic market environment.
Disclaimer
The Uptrick: Oracle Metrics + indicator is a tool designed to assist traders in analyzing market conditions and making informed decisions. It is not a guarantee of future performance or a substitute for independent financial advice. Trading involves significant risk, and past results do not guarantee future outcomes. Users are advised to conduct their own research, consider their financial situation, and consult with a licensed financial professional if necessary. Uptrick and its affiliates are not responsible for any financial losses incurred while using this indicator. Use at your own discretion and risk.
Liquidity Trading Algorithm (LTA)
The Liquidity Trading Algorithm is an algorithm designed to provide trade signals based on
liquidity conditions in the market. The underlying algorithm is based on the Liquidity
Dependent Price Movement (LDPM) metric and the Liquidity Dependent Price Stability (LDPS)
algorithm.
Together, LDPM and LDPS demonstrate statistically significant forecasting capabilities for price-
action on equities, cryptocurrencies, and futures. LTA takes these liquidity measurements and
translates them into actionable insights by way of entering or exiting a position based
on the future outlooks, as measured by the current liquidity status.
The benefit of LTA is that it can incorporate these powerful liquidity measurements into
actionable insights with several features designed to help you tailor LTA's behavior and
measurements to your desired vantage point. These customizable features come by the way of determining LTA's assessment style, and additional monitoring systems for avoiding bear and bull traps, along with various other quality of life features, discussed in more detail below.
First, a few quick facts:
- LTA is compatible on a wide array of instruments, including Equities, Futures, Cryptocurrencies, and Forex.
- LTA is compatible on most intervals in so long as the data can be calculated appropriately,
(be sure to do a backtest on timescales less than 1-minue to ensure the data can be computed).
- LTA only measures liquidity at the end of the interval of the chart chosen, and does not respond to conditions during the candle interval, unless specified (such as with `Stops`).
- LTA is interval-dependent, this means it will measure and behave differently on different
intervals as the underlying algorithms are dependent on the interval chosen.
- LTA can utilize fractional share sizing for cryptocurrencies.
- LTA can be restricted to either bullish or bearish indications.
- Additional Monitoring Systems are available for additional risk mitigation.
In short, LTA is a widely applicable, unique algorithm designed to translate liquidity measurements into liquidity insights.
Before getting more into the details, here is a quick list of the main features and settings
available for customization:
- Backtesting Start Date: Manual selection of the start date for the algorithm during backtesting.
- Assessment Style: adjust how LDPM and LDPS measure and respond to changes in liquidity.
- Impose Wait: force LTA to wait before entering or exiting a position to ensure conditions have remained conducive.
- Trade Direction Allowance: Restrict LTA to only long or only short, if desired.
- Position Sizing Method: determine how LTA calculates position sizing.
- Fractional Share Sizing: allow LTA to calculate fractional share sizes for cryptocurrencies
- Max Size Limit: Impose a maximum size on LTA's positions.
- Initial Capital: Indicate how much capital LTA should stat with.
- Portfolio Allotment: Indicate to LTA how much (in percentages) of the available balance should be considered when calculating position size.
- Enact Additional Monitoring Systems: Indicate if LTA should impose additional safety criteria when monitoring liquidity.
- Configure Take Profit, Stop-Loss, Trailing Stop Loss
- Display Information tables on the current position, overall strategy performance, along
with a text output showing LTA's processes.
- Real-time text output and updates on LTA's inner workings.
Let's get into some more of the details.
LTA's Assessment Style
LTA's assessment style determines how LTA collects and responds to changing data. In traditional terms, this is akin to (but not quite exactly the same as) the sensitivity versus specificity spectrum, whereby on one end (the sensitive end), an algorithm responds to changes in data in a reactive manner (which tends to lower its specificity, or how often it is correct in its indications), and on the other end, the opposite one, the algorithm foresakes quick changes for longevity of outlook.
While this is in part true, it is not a full view of the underlying mechanisms that changing the assessment style augments. A better analogy would be that the sensitive end of the spectrum (`Aggressive`) is in a state such that the algorithm wants to changing its outlooks, and as such, with changes in data, the algorithm has to be convinced as to why that is not a good idea to change outlooks, whereas the the more specific states (`Conservative`, `Diamond`) must be convinced that their view is no longer valid and that it needs to be changed.
This means the `Aggressive` and the `Diamond` settings fundamentally differ not just in their
data collection, but also in the data processing such that the `Aggressive` decision tree has to
be convinced that the data is the same (as its defualt is that it has changed),
and the `Diamond` decision tree has to be convinced that the data is not the same, and as such, the outlook need changed.
From there, the algorithm cooks through the data and determines to what the outlook should be changed to, given the current state of liquidity.
`Balanced` lies in the middle of this balance, attempting to balance being open to new ideas while not removing the wisdom of the past, as it were.
On a scale of most `sensitive` to most `specific`, it is as follows: `Aggressive`, `Balanced`,
`Conservative`, `Diamond`.
Functionally, these different modes can help in different liquidity environments, as certain
environments are more conducive to an eager approach (such as found near `Aggressive`) or are more conducive to a more conservative approach, where sudden changes in liquidity are known to be short-lived and unremarkable (such as many previously identified bull or bear traps).
For instance, on low interval views, it can often-times be beneficial to keep the algorithm towards the `Sensitive` end, since on the lower-timeframes, the crosswinds can change quite dramatically; whereas on the longer intervals, it may be useful to maintain a more `Specific` algorithm (such as found near `Diamond` mode) setting since longer intervals typically lend themselves to longer time-horizons, which themselves typically lend themselves to "weathering the storm", as it were.
LTA's Assessment Style is also supported by the Additional Monitoring Systems which works
to add sensitivity without sacrificing specificity by enacting a separate monitoring system, as described below.
Additional Monitoring Systems
The Additional Monitoring System (AMS) attempts to add more context to any changes in liquidity conditions as measured, such that LTA as a whole will have an expanded view into any rapidly changing liquidity conditions before these changes manifest in the traditional data streams. The ideal is that this allows for early exits or early entrances to positions "a head of time".
The traditional use of this system is to indicate when liquidity is suggestive of the end of a particular run (be it a bear run or a bull run), so an early exit can be initiated (and thus,
downside averted) even before the data officially showcase such changes. In such cases (when AMS becomes activated), the algorithm will signal to exit any open positions, and will restrict the opening of any new positions.
When a position is exited because of AMS, it is denoted as an `Early Exit` and if a position is prevented from being entered, the text output will display `AM prevented entry...` to indicate that conditions are not meeting AMS' additional standards.
The algorithm will wait to make any actions while `AMS` is `active` and will only enter into a new position once `AMS` has been `deactivated` and overall liquidity conditions are appropriate.
Functionally, the benefits of AMS translate to:
- Toggeling AMS on will typically see a net reduction in overall profitability, but
- AMS will typically (almost always) reduce max drawdown,
an increases in max runup, and increase return-over-maxdrawdown, and
- AMS can provide benefit for equities that experience a lot of "traps" by navigating early
entrance and early exits.
So in short, AMS is way of adding an additional level of liquidity monitoring that attempts to
exit positions if conditions look to be deteriorating, and to enter conditions if they look to be
improving. The cost of this additional monitoring, however, is a greater number of trades indicated, and a lower overall profitability.
Impose Wait
Note: `Impose Wait` will not force Take Profit, Stop Loss, or Trailing Stop Loss to
wait.
LTA can be indicated to `wait` before entering or exiting a position if desired. This means that if conditions change, whereas without a `wait` imposed, the algorithm would immediately indicate this change via a signal to alter the strategy's position, with a `wait` imposed, the algorithm will `wait` the indicated number of bars, and then re-check conditions before proceeding.
If, while waiting, conditions change to a state that is no longer compatible with the "order-in-
waiting", then the order-in-waiting is removed, and the counts reset (i.e.: conditions must remain favorable to the intended positional change throughout the wait period).
Since LTA works at the end-of-intervals, there is an inherently "built-in" wait of 1 bar when
switching directly from long to short (i.e.: if a full switch is indicated, then it is indicated as
conditions change -> exit new position -> wait until -> check conditions ->
enter new position as indicated). Thus, to impose a wait of `1 bar` would be to effectively have a total of two candles' ends prior to the entrance of the new position).
There are two main styles of `Impose Wait` that you can utilize:
- `Wait` : this mode will cause LTA to `wait` when both entering and exiting a position (in so long as it is not an exit signaled via a Take Profit, Stop Loss or Trailing Stop Loss).
- `Exit-Wait` : This mode will >not< cause LTA to `wait` if conditions require the closing of a position, but will force LTA to wait before entering into a position.
Position:
In addition to the availability to restrict LTA to either a long-only or short-only strategy, LTA
also comprises additional flexibility when deciding on how it should navigate the markets with
regards to sizing. Notably, this flexibility benefits several aspects of LTA's existence, namely the ability to determine the `Sizing Method`, or if `Fractional Share Sizing` should be employed, and more, as discussed below.
Position Sizing Method
There are two main ways LTA can determine the size of a position. Either via the `Fixed-Share` choice, or the `Fixed-Percentage` choice.
- `Fixed-Share` will use the amount indicated in the `Max Sizing Limit` field as the position size, always.
Note: With `Fixed-Share` sizing, LTA will >not< check if the balance is sufficient
prior to signaling an entrance.
- `Fixed-Percentage` will use the percentage amount indicated in the `Portfolio Allotment` field as the percentage of available funds to use when calculating the position size. Additionally, with the `Fixed-Percentage` choice, you can set the `Max Sizing Limit` if desired, which will ensure that no position will be entered greater than the amount indicated in the field.
Fractional Share Sizing
If the underlying instrument supports it (typically only cryptocurrencies), share sizing can be
fractionalized. If this is done, the resulting positin size is rounded to `4 digits`. This means any
position with a size less than `0.00005` will be rounded to `0.0000`
Note: Ensure that the underlying instrument supports fractional share sizing prior
to initiating.
Max Sizing Limit
As discussed above, the `Max Sizing Limit` will determine:
- The position size for every position, if `Sizing Method : Fixed-Share` is utilized, or
- The maximum allowed size, regardless of available capital, if `Sizing Method : Fixed-Percentage` is utilized.
Note: There is an internal maximum of 100,000 units.
Initial Capital
Note: There are 2 `Initial Capital` settings; one in LTA's settings and one in the
`Properties` tab. Ensure these two are the same when doing backtesting.
The initial capital field will be used to determine the starting balanace of the strategy, and
is used to calculate the internal data reporting (the data tables).
Portfolio Allotment
You can specify how much of the total available balance should be used when calculating the share size. The default is 100%.
Stops
Note: Stops over-ride `AMS` and `Impose Wait`, and are not restricted to only the
end-of-candle and will occur instantaneously upon their activation. Neither `AMS` nor `Impose Wait` can over-ride a signal from a `Take-Profit`, `Stop-Loss`, or a `Trailing-Stop Loss`.
LTA enhouses three stops that can be configured, a `Take-Profit`, a `Stop-Loss` and a `Trailing-Stop Loss`. The configurations can be set in the settings in percent terms. These exit signals will always over-ride AMS or any other restrictions on position exit.
Their configuration is rather standard; set the percentages you want the signal to be sent at and so it will be done.
Some quick notes on the `Trailing-Stop Loss`:
- The activation percentage must be reached (in profits) prior to the `Traililng-Stop Loss`
from activating the downside protection. For example, if the `Activation Percentage` is 10%, then unless the position reaches (at any point) a 10% profit, then it will not signal any exits on the downside, should it occur.
- The downside price-point is continuously updated and is calculated from the maximum profit reached in the given position and the loss percentage placed in the appropriate field.
Data Tables and Data Output
LTA provides real-time data output through a variety of mechanisms:
- `Position Table`
The `Position Table` displays information about the current position, including:
> Position Duration : how long the position has been open for.
> Indicates if the side is Long or Short, depending on if it is long or short.
> Entry Price: the price the position was entered at.
> Current Price (% Dif): the current price of the underlying and the %-difference between the entry price and the current price.
> Max Profit ($/%): the maximum profit reached in $ and % terms.
> Current PnL ($/%) : the current PnL for the open position.
- `Performance Table`
The `Performance Table` displays information regarding the overall performance of the algorithm since its `Start Date`. These data include:
> Initial Equity ($): The initial equity the algorithm started with.
> Current Equity ($): The current total equity of the account (including open positions)
> Net Profits ($|%) : The overall net profit in $ and % terms.
> Long / Short Trade Counts: The respective trade counts for the positions entered.
> Total Closed Trades: The running sum of the number of trades closed.
> Profitability: The calculation of the number of profitable trades over the total number of
trades.
> Avg. Profit / Trade: The calculation of the average profit per trade in both $ and % terms.
> Avg. Loss / Trade: The calculation of the average loss per trade in both $ and % terms.
> Max Run-Up: The maximum run-up the algorithm has seen in both $ and % terms.
> Max Drawdown: The maximum draw-down the algorithm has seen in both $ and % terms.
> Return-Over-Max-Drawdown: the ratio of the maximum drawdown against the current net profits.
- `Text Output`
LTA will output, if desired, signals to the text output field every time it analysis or performs and action. These messages can include information such as:
"
08:00:00 >> AM Protocol activated ... exiting position ...
08:00:00 >> Exit Order Created for qty: 2, profit: 380 (4.34%)
...
09:30:00 >> Checking conditions ...
09:30:00 >> AM protocol prevented entry ... waiting ...
"
This way, you can keep an eye out on what is happening "under the hood", as it were.
LTA will produce a message at the end of its assessment at the end of each candle interval, as well as when a position is exited due to a `Stop` or due to `AMS` being activated.
Additionally, the `Text Output` includes a initial message, but for space-constraints, this
can be toggled off with the `Blank Text Output` option within LTA's configurations.
For additional information, please refer to the Author's Instructions below.
Advanced Options Trading Indicator: Buy & Sell Signal Generator This powerful custom indicator combines the Relative Strength Index (RSI) and Moving Average (MA) to help traders identify optimal entry and exit points in the options market. The indicator generates real-time buy and sell signals based on RSI crossovers and price positioning relative to the moving average, providing actionable insights for traders seeking to make informed decisions. Additionally, it calculates potential call and put option strike prices with a buffer for added flexibility and precision, ensuring a well-rounded approach to options trading.
Project R
Project R : Advanced Trading Strategy with Dynamic Entry Signals
Overview
Project R is a comprehensive trading script tailored for traders seeking accuracy in market entries and exits. It merges multiple technical indicators—CCI, Momentum, RSI, and Mean Reversion Bands—with advanced trading tools like supply and demand zone detection, ATR-based stop-loss levels, and tiered take-profit targets. The script is designed to cater to both trend-following and mean-reversion strategies, offering dynamic adaptability to various market conditions. Its robust functionality and user-focused customization make it an invaluable tool for traders aiming to optimize their performance in live markets.
---
🔶 Key Features
1. Customizable Entry Signal Source
- Traders can select between CCI (Commodity Channel Index) and Momentum as the primary entry signal generator, depending on their preferred strategy.
- Additional confirmation through detection of regular bullish or bearish divergences within overbought and oversold zones of the RSI enhances signal reliability. This ensures the trader has an added layer of confidence in their decision-making.
2. Supply and Demand Area Tracking
- The script scans historical price action to detect critical supply and demand zones , areas where significant buying or selling interest has previously occurred.
- These zones are plotted on the chart to help traders anticipate reversals or breakouts, making it easier to identify high-probability entry and exit points.
3. Mean Reversion Bands
- EMA-based mean reversion bands provide clear visual guidance for traders employing mean-reversion strategies.
- The bands are calculated with adjustable multipliers, allowing traders to customize their sensitivity and identify optimal buy and sell zones within ranging markets.
4. ATR-Based Stop Loss and Take Profit Levels
- Dynamic risk management is achieved by calculating stop-loss levels and up to four take-profit targets using Average True Range (ATR) multipliers.
- This ensures that stop-loss and take-profit levels adjust automatically to market volatility, providing consistent risk-reward ratios tailored to prevailing conditions.
5. Higher Time Frame Confirmation
- The integration of a higher time frame EMA (Exponential Moving Average) filter ensures that trades are executed in alignment with broader market trends, increasing the probability of success.
- This feature is especially useful for traders who prioritize trend-following strategies and seek confirmation from larger time frames.
6. Status Tracking
- A dynamic status system displays the current state of the trade (e.g., "Waiting for Confirmation," "Enter Buy," or "Enter Sell") directly on the chart.
- The script also monitors and logs whether the stop loss or individual take-profit targets have been achieved, providing real-time updates for active trades.
---
🔹 Usage
How It Works
- Buy Signals : A buy signal is generated when the following conditions are met:
1. The chosen entry signal (CCI/Momentum) crosses upward, indicating bullish momentum.
2. RSI is in the oversold range or exhibits bullish divergence, signaling potential upward reversal.
3. Price is positioned above the higher time frame EMA and approaches identified demand zones, reinforcing a high-probability entry.
- Sell Signals: A sell signal is triggered when:
1. The chosen entry signal crosses downward, indicating bearish momentum.
2. RSI is in the overbought range or exhibits bearish divergence, suggesting potential downward reversal.
3. Price is positioned below the higher time frame EMA and approaches supply zones, aligning with bearish market sentiment.
- Stop Loss and Take Profit:
- Stop-loss levels are calculated dynamically based on ATR values, ensuring they adapt to market volatility.
- Multiple take-profit levels are provided to enable traders to scale out of positions incrementally, optimizing profit-taking strategies.
---
🔹 Practical Examples
- Mean Reversion Strategy: In ranging markets, traders can use the lower band as a buy zone and the upper band as a sell zone. For instance, when the price approaches the lower mean reversion band near a demand area, a buy signal is generated if other criteria are met.
- Trend Following Strategy: By aligning entries with the direction of the higher time frame EMA, traders can participate in long-term trends with greater confidence. For example, entering a buy trade when price crosses above the 50 EMA on a 1-hour chart ensures alignment with the dominant trend.
---
🔹 Visual Options
- Users can fully customize the color schemes, line styles, and visibility of key features, including:
- Mean reversion bands.
- Supply and demand zones.
- Take-profit and stop-loss levels.
- Entry points and trade progression are visually marked, ensuring traders can track real-time performance effortlessly.
---
🔶 Why Invite-Only?
Innovative Design
- Project R integrates advanced techniques, such as combining multiple indicators with supply and demand zone detection, to create a holistic and adaptable strategy.
- The use of ATR-based dynamic risk management and higher time frame confirmation offers traders a competitive edge in volatile markets.
Comprehensive Features
- The script provides a seamless trading experience by combining analysis, execution, and risk management in one tool.
- Its ability to cater to different trading styles (trend-following, mean-reversion, and divergence-based trading) ensures versatility and wide appeal.
Performance and Utility
- Real-time tracking, dynamic risk management, and precision in signal generation position Project R as a professional-grade tool that is suitable for traders of all levels.
- These features merit invite-only access to ensure the integrity of its use and provide exclusivity to dedicated traders who seek advanced functionality.
---
🔹 Settings
- Entry Signal Source: Choose between CCI and Momentum as the primary signal generator.
- RSI Levels: Adjust overbought and oversold thresholds to fine-tune divergence detection.
- ATR Multipliers: Customize stop-loss and take-profit levels based on your risk tolerance.
- Higher Time Frame EMA: Configure the higher time frame and EMA period to align with your preferred strategy.
- Supply/Demand Lookback Period: Modify the range for identifying supply and demand zones to suit market conditions.
- Mean Reversion Bands: Toggle the bands on or off and adjust their multipliers for a tailored mean-reversion strategy.
Machine Learning Price Target Prediction Signals [AlgoAlpha]Introducing the Machine Learning Price Target Predictions, a cutting-edge trading tool that leverages kernel regression to provide accurate price targets and enhance your trading strategy. This indicator combines trend-based signals with advanced machine learning techniques, offering predictive insights into potential price movements. Perfect for traders looking to make data-driven decisions with confidence.
What is Kernel Regression and How It Works
Kernel regression is a non-parametric machine learning technique that estimates the relationship between variables by weighting data points based on their similarity to a given input. The similarity is determined using a kernel function, such as the Gaussian (RBF) kernel, which assigns higher weights to closer data points and progressively lower weights to farther ones. This allows the model to make smooth and adaptive predictions, balancing recent data and historical trends.
Key Features
🎯 Predictive Price Targets : Uses kernel regression to estimate the magnitude of price movements.
📈 Dynamic Trend Analysis : Multiple trend detection methods, including EMA crossovers, Hull Moving Average, and SuperTrend.
🔧 Customizable Settings : Adjust bandwidth for kernel regression and tweak trend indicator parameters to suit your strategy.
📊 Visual Trade Levels : Displays take-profit and stop-loss levels directly on the chart with customizable colors.
📋 Performance Metrics : Real-time win rate, recommended risk-reward ratio, and training data size displayed in an on-chart table.
🔔 Alerts : Get notified for new trends, take-profit hits, and stop-loss triggers.
How to Use
🛠 Add the Indicator : Add it to your favorites and apply it to your chart. Configure the trend detection method (SuperTrend, HMA, or EMA crossover) and other parameters based on your preferences.
📊 Analyze Predictions : Observe the predicted move size, recommended risk-reward ratio, and trend direction. Use the displayed levels for trade planning.
🔔 Set Alerts : Enable alerts for trend signals, take-profit hits, or stop-loss triggers to stay informed without constant monitoring.
How It Works
The indicator calculates features such as price volatility, relative strength, and trend signals, which are stored during training periods. When a trend change is detected, the kernel regression model predicts the likely price move based on these features. Predictions are smoothed using the specified bandwidth to avoid overfitting while ensuring timely responses to feature changes. Visualized take-profit and stop-loss levels help traders optimize risk management. Real-time metrics like win rate and recommended risk-reward ratios provide actionable insights for decision-making.
Accurate Bollinger Bands mcbw_ [True Volatility Distribution]The Bollinger Bands have become a very important technical tool for discretionary and algorithmic traders alike over the last decades. It was designed to give traders an edge on the markets by setting probabilistic values to different levels of volatility. However, some of the assumptions that go into its calculations make it unusable for traders who want to get a correct understanding of the volatility that the bands are trying to be used for. Let's go through what the Bollinger Bands are said to show, how their calculations work, the problems in the calculations, and how the current indicator I am presenting today fixes these.
--> If you just want to know how the settings work then skip straight to the end or click on the little (i) symbol next to the values in the indicator settings window when its on your chart <--
--------------------------- What Are Bollinger Bands ---------------------------
The Bollinger Bands were formed in the 1980's, a time when many retail traders interacted with their symbols via physically printed charts and computer memory for personal computer memory was measured in Kb (about a factor of 1 million smaller than today). Bollinger Bands are designed to help a trader or algorithm see the likelihood of price expanding outside of its typical range, the further the lines are from the current price implies the less often they will get hit. With a hands on understanding many strategies use these levels for designated levels of breakout trades or to assist in defining price ranges.
--------------------------- How Bollinger Bands Work ---------------------------
The calculations that go into Bollinger Bands are rather simple. There is a moving average that centers the indicator and an equidistant top band and bottom band are drawn at a fixed width away. The moving average is just a typical moving average (or common variant) that tracks the price action, while the distance to the top and bottom bands is a direct function of recent price volatility. The way that the distance to the bands is calculated is inspired by formulas from statistics. The standard deviation is taken from the candles that go into the moving average and then this is multiplied by a user defined value to set the bands position, I will call this value 'the multiple'. When discussing Bollinger Bands, that trading community at large normally discusses 'the multiple' as a multiplier of the standard deviation as it applies to a normal distribution (gaußian probability). On a normal distribution the number of standard deviations away (which trades directly use as 'the multiple') you are directly corresponds to how likely/unlikely something is to happen:
1 standard deviation equals 68.3%, meaning that the price should stay inside the 1 standard deviation 68.3% of the time and be outside of it 31.7% of the time;
2 standard deviation equals 95.5%, meaning that the price should stay inside the 2 standard deviation 95.5% of the time and be outside of it 4.5% of the time;
3 standard deviation equals 99.7%, meaning that the price should stay inside the 3 standard deviation 99.7% of the time and be outside of it 0.3% of the time.
Therefore when traders set 'the multiple' to 2, they interpret this as meaning that price will not reach there 95.5% of the time.
---------------- The Problem With The Math of Bollinger Bands ----------------
In and of themselves the Bollinger Bands are a great tool, but they have become misconstrued with some incorrect sense of statistical meaning, when they should really just be taken at face value without any further interpretation or implication.
In order to explain this it is going to get a bit technical so I will give a little math background and try to simplify things. First let's review some statistics topics (distributions, percentiles, standard deviations) and then with that understanding explore the incorrect logic of how Bollinger Bands have been interpreted/employed.
---------------- Quick Stats Review ----------------
.
(If you are comfortable with statistics feel free to skip ahead to the next section)
.
-------- I: Probability distributions --------
When you have a lot of data it is helpful to see how many times different results appear in your dataset. To visualize this people use "histograms", which just shows how many times each element appears in the dataset by stacking each of the same elements on top of each other to form a graph. You may be familiar with the bell curve (also called the "normal distribution", which we will be calling it by). The normal distribution histogram looks like a big hump around zero and then drops off super quickly the further you get from it. This shape (the bell curve) is very nice because it has a lot of very nifty mathematical properties and seems to show up in nature all the time. Since it pops up in so many places, society has developed many different shortcuts related to it that speed up all kinds of calculations, including the shortcut that 1 standard deviation = 68.3%, 2 standard deviations = 95.5%, and 3 standard deviations = 99.7% (these only apply to the normal distribution). Despite how handy the normal distribution is and all the shortcuts we have for it are, and how much it shows up in the natural world, there is nothing that forces your specific dataset to look like it. In fact, your data can actually have any possible shape. As we will explore later, economic and financial datasets *rarely* follow the normal distribution.
-------- II: Percentiles --------
After you have made the histogram of your dataset you have built the "probability distribution" of your own dataset that is specific to all the data you have collected. There is a whole complicated framework for how to accurately calculate percentiles but we will dramatically simplify it for our use. The 'percentile' in our case is just the number of data points we are away from the "middle" of the data set (normally just 0). Lets say I took the difference of the daily close of a symbol for the last two weeks, green candles would be positive and red would be negative. In this example my dataset of day by day closing price difference is:
week 1:
week 2:
sorting all of these value into a single dataset I have:
I can separate the positive and negative returns and explore their distributions separately:
negative return distribution =
positive return distribution =
Taking the 25th% percentile of these would just be taking the value that is 25% towards the end of the end of these returns. Or akin the 100%th percentile would just be taking the vale that is 100% at the end of those:
negative return distribution (50%) = -5
positive return distribution (50%) = +4
negative return distribution (100%) = -10
positive return distribution (100%) = +20
Or instead of separating the positive and negative returns we can also look at all of the differences in the daily close as just pure price movement and not account for the direction, in this case we would pool all of the data together by ignoring the negative signs of the negative reruns
combined return distribution =
In this case the 50%th and 100%th percentile of the combined return distribution would be:
combined return distribution (50%) = 4
combined return distribution (100%) = 10
Sometimes taking the positive and negative distributions separately is better than pooling them into a combined distribution for some purposes. Other times the combined distribution is better.
Most financial data has very different distributions for negative returns and positive returns. This is encapsulated in sayings like "Price takes the stairs up and the elevator down".
-------- III: Standard Deviation --------
The formula for the standard deviation (refereed to here by its shorthand 'STDEV') can be intimidating, but going through each of its elements will illuminate what it does. The formula for STDEV is equal to:
square root ( (sum ) / N )
Going back the the dataset that you might have, the variables in the formula above are:
'mean' is the average of your entire dataset
'x' is just representative of a single point in your dataset (one point at a time)
'N' is the total number of things in your dataset.
Going back to the STDEV formula above we can see how each part of it works. Starting with the '(x - mean)' part. What this does is it takes every single point of the dataset and measure how far away it is from the mean of the entire dataset. Taking this value to the power of two: '(x - mean) ^ 2', means that points that are very far away from the dataset mean get 'penalized' twice as much. Points that are very close to the dataset mean are not impacted as much. In practice, this would mean that if your dataset had a bunch of values that were in a wide range but always stayed in that range, this value ('(x - mean) ^ 2') would end up being small. On the other hand, if your dataset was full of the exact same number, but had a couple outliers very far away, this would have a much larger value since the square par of '(x - mean) ^ 2' make them grow massive. Now including the sum part of 'sum ', this just adds up all the of the squared distanced from the dataset mean. Then this is divided by the number of values in the dataset ('N'), and then the square root of that value is taken.
There is nothing inherently special or definitive about the STDEV formula, it is just a tool with extremely widespread use and adoption. As we saw here, all the STDEV formula is really doing is measuring the intensity of the outliers.
--------------------------- Flaws of Bollinger Bands ---------------------------
The largest problem with Bollinger Bands is the assumption that price has a normal distribution. This is assumption is massively incorrect for many reasons that I will try to encapsulate into two points:
Price return do not follow a normal distribution, every single symbol on every single timeframe has is own unique distribution that is specific to only itself. Therefore all the tools, shortcuts, and ideas that we use for normal distributions do not apply to price returns, and since they do not apply here they should not be used. A more general approach is needed that allows each specific symbol on every specific timeframe to be treated uniquely.
The distributions of price returns on the positive and negative side are almost never the same. A more general approach is needed that allows positive and negative returns to be calculated separately.
In addition to the issues of the normal distribution assumption, the standard deviation formula (as shown above in the quick stats review) is essentially just a tame measurement of outliers (a more aggressive form of outlier measurement might be taking the differences to the power of 3 rather than 2). Despite this being a bit of a philosophical question, does the measurement of outlier intensity as defined by the STDEV formula really measure what we want to know as traders when we're experiencing volatility? Or would adjustments to that formula better reflect what we *experience* as volatility when we are actively trading? This is an open ended question that I will leave here, but I wanted to pose this question because it is a key part of what how the Bollinger Bands work that we all assume as a given.
Circling back on the normal distribution assumption, the standard deviation formula used in the calculation of the bands only encompasses the deviation of the candles that go into the moving average and have no knowledge of the historical price action. Therefore the level of the bands may not really reflect how the price action behaves over a longer period of time.
------------ Delivering Factually Accurate Data That Traders Need------------
In light of the problems identified above, this indicator fixes all of these issue and delivers statistically correct information that discretionary and algorithmic traders can use, with truly accurate probabilities. It takes the price action of the last 2,000 candles and builds a huge dataset of distributions that you can directly select your percentiles from. It also allows you to have the positive and negative distributions calculated separately, or if you would like, you can pool all of them together in a combined distribution. In addition to this, there is a wide selection of moving averages directly available in the indicator to choose from.
Hedge funds, quant shops, algo prop firms, and advanced mechanical groups all employ the true return distributions in their work. Now you have access to the same type of data with this indicator, wherein it's doing all the lifting for you.
------------------------------ Indicator Settings ------------------------------
.
---- Moving average ----
Select the type of moving average you would like and its length
---- Bands ----
The percentiles that you enter here will be pulled directly from the return distribution of the last 2,000 candles. With the typical Bollinger Bands, traders would select 2 standard deviations and incorrectly think that the levels it highlights are the 95.5% levels. Now, if you want the true 95.5% level, you can just enter 95.5 into the percentile value here. Each of the three available bands takes the true percentile you enter here.
---- Separate Positive & Negative Distributions----
If this box is checked the positive and negative distributions are treated indecently, completely separate from each other. You will see that the width of the top and bottom bands will be different for each of the percentiles you enter.
If this box is unchecked then all the negative and positive distributions are pooled together. You will notice that the width of the top and bottom bands will be the exact same.
---- Distribution Size ----
This is the number of candles that the price return is calculated over. EG: to collect the price return over the last 33 candles, the difference of price from now to 33 candles ago is calculated for the last 2,000 candles, to build a return distribution of 2000 points of price differences over 33 candles.
NEGATIVE NUMBERS(<0) == exact number of candles to include;
EG: setting this value to -20 will always collect volatility distributions of 20 candles
POSITIVE NUMBERS(>0) == number of candles to include as a multiple of the Moving Average Length value set above;
EG: if the Moving Average Length value is set to 22, setting this value to 2 will use the last 22*2 = 44 candles for the collection of volatility distributions
MORE candles being include will generally make the bands WIDER and their size will change SLOWER over time.
I wish you focus, dedication, and earnest success on your journey.
Happy trading :)