Bitcoin Expectile Model [LuxAlgo]The Bitcoin Expectile Model is a novel approach to forecasting Bitcoin, inspired by the popular Bitcoin Quantile Model by PlanC. By fitting multiple Expectile regressions to the price, we highlight zones of corrections or accumulations throughout the Bitcoin price evolution.
While we strongly recommend using this model with the Bitcoin All Time History Index INDEX:BTCUSD on the 3 days or weekly timeframe using a logarithmic scale, this model can be applied to any asset using the daily timeframe or superior.
Please note that here on TradingView, this model was solely designed to be used on the Bitcoin 1W chart, however, it can be experimented on other assets or timeframes if of interest.
🔶 USAGE
The Bitcoin Expectile Model can be applied similarly to models used for Bitcoin, highlighting lower areas of possible accumulation (support) and higher areas that allow for the anticipation of potential corrections (resistance).
By default, this model fits 7 individual Expectiles Log-Log Regressions to the price, each with their respective expectile ( tau ) values (here multiplied by 100 for the user's convenience). Higher tau values will return a fit closer to the higher highs made by the price of the asset, while lower ones will return fits closer to the lower prices observed over time.
Each zone is color-coded and has a specific interpretation. The green zone is a buy zone for long-term investing, purple is an anomaly zone for market bottoms that over-extend, while red is considered the distribution zone.
The fits can be extrapolated, helping to chart a course for the possible evolution of Bitcoin prices. Users can select the end of the forecast as a date using the "Forecast End" setting.
While the model is made for Bitcoin using a log scale, other assets showing a tendency to have a trend evolving in a single direction can be used. See the chart above on QQQ weekly using a linear scale as an example.
The Start Date can also allow fitting the model more locally, rather than over a large range of prices. This can be useful to identify potential shorter-term support/resistance areas.
🔶 DETAILS
🔹 On Quantile and Expectile Regressions
Quantile and Expectile regressions are similar; both return extremities that can be used to locate and predict prices where tops/bottoms could be more likely to occur.
The main difference lies in what we are trying to minimize, which, for Quantile regression, is commonly known as Quantile loss (or pinball loss), and for Expectile regression, simply Expectile loss.
You may refer to external material to go more in-depth about these loss functions; however, while they are similar and involve weighting specific prices more than others relative to our parameter tau, Quantile regression involves minimizing a weighted mean absolute error, while Expectile regression minimizes a weighted squared error.
The squared error here allows us to compute Expectile regression more easily compared to Quantile regression, using Iteratively reweighted least squares. For Quantile regression, a more elaborate method is needed.
In terms of comparison, Quantile regression is more robust, and easier to interpret, with quantiles being related to specific probabilities involving the underlying cumulative distribution function of the dataset; on the other expectiles are harder to interpret.
🔹 Trimming & Alterations
It is common to observe certain models ignoring very early Bitcoin price ranges. By default, we start our fit at the date 2010-07-16 to align with existing models.
By default, the model uses the number of time units (days, weeks...etc) elapsed since the beginning of history + 1 (to avoid NaN with log) as independent variable, however the Bitcoin All Time History Index INDEX:BTCUSD do not include the genesis block, as such users can correct for this by enabling the "Correct for Genesis block" setting, which will add the amount of missed bars from the Genesis block to the start oh the chart history.
🔶 SETTINGS
Start Date: Starting interval of the dataset used for the fit.
Correct for genesis block: When enabled, offset the X axis by the number of bars between the Bitcoin genesis block time and the chart starting time.
🔹 Expectiles
Toggle: Enable fit for the specified expectile. Disabling one fit will make the script faster to compute.
Expectile: Expectile (tau) value multiplied by 100 used for the fit. Higher values will produce fits that are located near price tops.
🔹 Forecast
Forecast End: Time at which the forecast stops.
🔹 Model Fit
Iterations Number: Number of iterations performed during the reweighted least squares process, with lower values leading to less accurate fits, while higher values will take more time to compute.
Indicadores e estratégias
Information-Geometric Market DynamicsInformation-Geometric Market Dynamics
The Information Field: A Geometric Approach to Market Dynamics
By: DskyzInvestments
Foreword: Beyond the Shadows on the Wall
If you have traded for any length of time, you know " the feeling ." It is the frustration of a perfect setup that fails, the whipsaw that stops you out just before the real move, the nagging sense that the chart is telling you only half the story. For decades, technical analysis has relied on interpreting the shadows—the patterns left behind by price. We draw lines on these shadows, apply indicators to them, and hope they reveal the future.
But what if we could stop looking at the shadows and, instead, analyze the object casting them?
This script introduces a new paradigm for market analysis: Information-Geometric Market Dynamics (IGMD) . The core premise of IGMD is that the price chart is merely a one-dimensional projection of a much richer, higher-dimensional reality—an " information field " generated by the collective actions and beliefs of all market participants.
This is not just another collection of indicators. It is a unified framework for measuring the geometry of the market's information field—its memory, its complexity, its uncertainty, its causal flows—and making high-probability decisions based on that deeper reality. By fusing advanced mathematical and informational concepts, IGMD provides a multi-faceted lens through which to view market behavior, moving beyond simple price action into the very structure of market information itself.
Prepare to move beyond the flatland of the price chart. Welcome to the information field.
The IGMD Framework: A Multi-Kernel Approach
What is a Kernel? The Heart of Transformation
In mathematics and data science, a kernel is a powerful and elegant concept. At its core, a kernel is a function that takes complex, often inscrutable data and transforms it into a more useful format. Think of it as a specialized lens or a mathematical "probe." You cannot directly measure abstract concepts like "market memory" or "trend quality" by looking at a price number. First, you must process the raw price data through a specific mathematical machine—a kernel—that is designed to output a measurement of that specific property. Kernels operate by performing a sort of "similarity test," projecting data into a higher-dimensional space where hidden patterns and relationships become visible and measurable.
Why do creators use them? We use kernels to extract features —meaningful pieces of information—that are not explicitly present in the raw data. They are the essential tools for moving beyond surface-level analysis into the very DNA of market behavior. A simple moving average can tell you the average price; a suite of well-chosen kernels can tell you about the character of the price action itself.
The Alchemist's Challenge: The Art of Fusion
Using a single kernel is a challenge. Using five distinct, computationally demanding mathematical engines in unison is an immense undertaking. The true difficulty—and artistry—lies not just in using one kernel, but in fusing the outputs of many . Each kernel provides a different perspective, and they can often give conflicting signals. One kernel might detect a strong trend, while another signals rising chaos and uncertainty. The IGMD script's greatest strength is its ability to act as this alchemist, synthesizing these disparate viewpoints through a weighted fusion process to produce a single, coherent picture of the market's state. It required countless hours of testing and calibration to balance the influence of these five distinct analytical engines so they work in harmony rather than cacophony.
The Five Kernels of Market Dynamics
The IGMD script is built upon a foundation of five distinct kernels, each chosen to probe a unique and critical dimension of the market's information field.
1. The Wavelet Kernel (The "Microscope")
What it is: The Wavelet Kernel is a signal processing function designed to decompose a signal into different frequency scales. Unlike a Fourier Transform that analyzes the entire signal at once, the wavelet slides across the data, providing information about both what frequencies are present and when they occurred.
The Kernels I Use:
Haar Kernel: The simplest wavelet, a square-wave shape defined by the coefficients . It excels at detecting sharp, sudden changes.
Daubechies 2 (db2) Kernel: A more complex and smoother wavelet shape that provides a better balance for analyzing the nuanced ebb and flow of typical market trends.
How it Works in the Script: This kernel is applied iteratively. It first separates the finest "noise" (detail d1) from the first level of trend (approximation a1). It then takes the trend a1 and repeats the process, extracting the next level of cycle (d2) and trend (a2), and so on. This hierarchical decomposition allows us to separate short-term noise from the long-term market "thesis."
2. The Hurst Exponent Kernel (The "Memory Gauge")
What it is: The Hurst Exponent is derived from a statistical analysis kernel that measures the "long-term memory" or persistence of a time series. It is the definitive measure of whether a series is trending (H > 0.5), mean-reverting (H < 0.5), or random (H = 0.5).
How it Works in the Script: The script employs a method based on Rescaled Range (R/S) analysis. It calculates the average range of price movements over increasingly larger time lags (m1, m2, m4, m8...). The slope of the line plotting log(range) vs. log(lag) is the Hurst Exponent. Applying this complex statistical analysis not to the raw price, but to the clean, wavelet-decomposed trend lines, is a key innovation of IGMD.
3. The Fractal Dimension Kernel (The "Complexity Compass")
What it is: This kernel measures the geometric complexity or "jaggedness" of a price path, based on the principles of fractal geometry. A straight line has a dimension of 1; a chaotic, space-filling line approaches a dimension of 2.
How it Works in the Script: We use a version based on Ehlers' Fractal Dimension Index (FDI). It calculates the rate of price change over a full lookback period (N3) and compares it to the sum of the rates of change over the two halves of that period (N1 + N2). The formula d = (log(N1 + N2) - log(N3)) / log(2) quantifies how much "longer" and more convoluted the price path was than a simple straight line. This kernel is our primary filter for tradeable (low complexity) vs. untradeable (high complexity) conditions.
4. The Shannon Entropy Kernel (The "Uncertainty Meter")
What it is: This kernel comes from Information Theory and provides the purest mathematical measure of information, surprise, or uncertainty within a system. It is not a measure of volatility; a market moving predictably up by 10 points every bar has high volatility but zero entropy .
How it Works in the Script: The script normalizes price returns by the ATR, categorizes them into a discrete number of "bins" over a lookback window, and forms a probability distribution. The Shannon Entropy H = -Σ(p_i * log(p_i)) is calculated from this distribution. A low H means returns are predictable. A high H means returns are chaotic. This kernel is our ultimate gauge of market conviction.
5. The Transfer Entropy Kernel (The "Causality Probe")
What it is: This is by far the most advanced and computationally intensive kernel in the script. Transfer Entropy is a non-parametric measure of directed information flow between two time series. It moves beyond correlation to ask: "Does knowing the past of Volume genuinely reduce our uncertainty about the future of Price?"
How it Works in the Script: To make this work, the script discretizes both price returns and the chosen "driver" (e.g., OBV) into three states: "up," "down," or "neutral." It then builds complex conditional probability tables to measure the flow of information in both directions. The Net Transfer Entropy (TE Driver→Price minus TE Price→Driver) gives us a direct measure of causality . A positive score means the driver is leading price, confirming the validity of the move. This is a profound leap beyond traditional indicator analysis.
Chapter 3: Fusion & Interpretation - The Field Score & Dashboard
Each kernel is a specialist providing a piece of the puzzle. The Field Score is where they are fused into a single, comprehensive reading. It's a weighted sum of the normalized scores from all five kernels, producing a single number from -1 (maximum bearish information field) to +1 (maximum bullish information field). This is the ultimate "at-a-glance" metric for the market's net state, and it is interpreted through the dashboard.
The Dashboard: Your Mission Control
Field Score & Regime: The master metric and its plain-English interpretation ("Uptrend Field", "Downtrend Field", "Transitional").
Kernel Readouts (Wave Align, H(w), FDI, etc.): The live scores of each individual kernel. This allows you to see why the Field Score is what it is. A high Field Score with all components in agreement (all green or red) is a state of High Coherence and represents a high-quality setup.
Market Context: Standard metrics like RSI and Volume for additional confluence.
Signals: The raw and adjusted confluence counts and the final, calculated probability scores for potential long and short entries.
Pattern: Shows the dominant candlestick pattern detected within the currently forming APEX range box and its calculated confidence percentage.
Chapter 4: Mastering the Controls - The Inputs Menu
Every parameter is a lever to fine-tune the IGMD engine.
📊 Wavelet Transform: Kernel ( Haar for sharp moves, db2 for smooth trends) and Scales (depth of analysis) let you tune the script's core microscope to your asset's personality.
📈 Hurst Exponent: The Window determines if you're assessing short-term or long-term market memory.
🔍 Fractal Dimension & ⚡ Entropy Volatility: Adjust the lookback windows to make these kernels more or less sensitive to recent price action. Always keep "Normalize by ATR" enabled for Entropy for consistent results.
🔄 Transfer Entropy: Driver lets you choose what causal force to measure (e.g., OBV, Volume, or even an external symbol like VIX). The throttle setting is a crucial performance tool, allowing you to balance precision with script speed.
⚡ Field Fusion • Weights: This is where you can customize the model's "brain." Increase the weights for the kernels that best align with your trading philosophy (e.g., w_hurst for trend followers, w_fdi for chop avoiders).
📊 Signal Engine: Mode offers presets from Conservative to Aggressive . Min Confluence sets your evidence threshold. Dynamic Confluence is a powerful feature that automatically adapts this threshold to the market regime.
🎨 Visuals & 📏 Support/Resistance: These inputs give you full control over the chart's appearance, allowing you to toggle every visual element for a setup that is as clean or as data-rich as you desire.
Chapter 5: Reading the Battlefield - On-Chart Visuals
Pattern Boxes (The Large Rectangles): These are not simple range boxes. They appear when the Field Score crosses a significance threshold, signaling a potential ignition point.
Color: The color reflects the dominant candlestick pattern that has occurred within that box's duration (e.g., green for Bull Engulf).
Label: Displays the dominant pattern, its duration in bars, and a calculated Confidence % based on field strength and pattern clarity.
Bar Pattern Boxes (The Small Boxes): If enabled, these highlight individual, significant candlestick patterns ( BE for Bull Engulf, H for Hammer) on a bar-by-bar basis.
Signal Markers (▲ and ▼): These appear only when the Signal Engine's criteria are all met. The number is the calculated Probability Score .
RR Rails (Dashed Lines): When a signal appears, these lines automatically plot the Entry, Stop Loss (based on ATR), and two Take Profit targets (based on Risk/Reward ratios). They dynamically break and disappear as price touches each level.
Support & Resistance Lines: Plots of the highest high ( Resistance ) and lowest low ( Support ) over a lookback, providing key structural levels.
Chapter 6: Development Philosophy & A Final Word
One single question: " What is the market really doing? " It represents a triumph of complexity, blending concepts from signal processing, chaos theory, and information theory into a cohesive framework. It is offered for educational and analytical purposes and does not constitute financial advice. Its goal is to elevate your analysis from interpreting flat shadows to measuring the rich, geometric reality of the market's information field.
As the great mathematician Benoit Mandelbrot , father of fractal geometry, noted:
"Clouds are not spheres, mountains are not cones, coastlines are not circles, and bark is not smooth, nor does lightning travel in a straight line."
Neither does the market. IGMD is a tool designed to navigate that beautiful, complex, and fractal reality.
— Dskyz, Trade with insight. Trade with anticipation.
Volume Rotor Clock [hapharmonic]🕰️ Volume Rotor Clock
The Volume Rotor Clock is an indicator that separates buy and sell volume, compiling these volumes over a recent number of bars or a specified past period, as defined by the user. This helps to reveal accumulation (buying) or distribution (selling) behavior, showing which side has superior volume. With its unique and beautiful display, the Volume Rotor Clock is more than just a timepiece; it's a dynamic dashboard that visualizes the buying and selling pressure of your favorite symbols, all wrapped in an elegant and fully customizable interface.
Instead of just tracking price, this indicator focuses on the engine behind the movement: volume. It helps you instantly identify which assets are under accumulation (buying) and which are under distribution (selling).
---
🎨 20 Pre-configured Templates
---
🧐 Interpreting the Clock Display
The interface is designed to give you multiple layers of information at a glance. Let's break down what each part represents.
1. The Main Clock Hands (Current Chart Symbol)
The clock hands—hour, minute, and second—are dedicated to the symbol on your current active chart .
Minute Hand: Displays the base currency of the current symbol (e.g., USDT, USD) at its tip.
Hour Hand: Displays the percentage of the winning volume side (buy vs. sell) at its tip.
Color Gauge: The color of the text characters at the tip of both the hour and minute hands acts as your primary volume gauge for the current symbol.
If buy volume is dominant , the text will be green .
If sell volume is dominant , the text will be red .
Tooltip: Hovering your mouse over the text at the tip of the hour or minute or other spherical elements hand will reveal a detailed tooltip with the precise Buy Volume, Sell Volume, Total Volume, Buy %, and Sell % for the current chart's symbol.
2. The Volume Scanner: Bulls & Bears (Symbols Inside the Clock) 🐂🐻
The circular symbols scattered inside the clock face are your multi-symbol volume scanner. They represent the assets you've selected in the indicator's settings.
Green Circles (Bulls - Upper Half): These represent symbols from your list where the total buy volume is greater than the total sell volume over the defined "Lookback" period. They are considered to be under bullish accumulation. The size of the circle and its text grows larger as the buy percentage becomes more dominant. The percentage shown within the circle represents the buy volume's share of the total volume, calculated over the 'Lookback (Bars)' you've set.
Red Circles (Bears - Lower Half): These represent symbols where the total sell volume is greater than the total buy volume. They are considered to be under bearish distribution or selling pressure. The size of the circle indicates the dominance of the sell-side volume. The percentage shown within the circle represents the sell volume's share of the total volume, calculated over the 'Lookback (Bars)' you've set.
3. The Bullish Watchlist (Symbols Above the Clock) ⭐
The symbols arranged neatly along the top edge of the clock are the "best of the bulls." They are symbols that are not only bullish but have also passed an additional, powerful strength filter.
What it Means: A symbol appears here when it shows signs of sustained, high-volume buying interest . It's a way to filter out noise and focus on assets with potentially significant accumulation phases.
The Filter Logic: For a bullish symbol (where total buy volume > total sell volume) to be promoted to the watchlist, its trading volume must meet specific criteria based on this formula:
ta.barssince(not(volume > ta.sma(volume, X))) >= Y
In plain English, this means: The indicator checks how many consecutive bars the `volume` has been greater than its `X`-bar Simple Moving Average (`ta.sma(volume, X)`). If this count is greater than or equal to `Y` bars, the condition is met.
(You can configure `X` (Volume MA Length) and `Y` (Consecutive Days Above MA) in the settings.)
Why it's Useful: This filter is powerful because it looks for consistency . A single spike in volume can be an anomaly. However, when an asset's volume remains consistently above its recent average for several consecutive days, it strongly suggests that larger players or a significant portion of the market are actively accumulating the asset. This sustained interest can often precede a significant upward price trend.
---
⚙️ Indicator Settings Explained
The Volume Rotor Clock is highly customizable. Here’s a detailed walkthrough of every setting available in the "Inputs" tab.
🎨 Color Scheme
This group allows you to control the entire aesthetic of the clock.
Template: Choose from a wide variety of professionally designed color themes.
Use Template: A simple checkbox to switch between using a pre-designed theme and creating your own.
`Checked`: You can select a theme from the dropdown menu, which offers 20 unique templates like "Cyberpunk Neon" or "Forest Green". All custom color settings below will be disabled (grayed out and unclickable).
`Unchecked`: The template dropdown is disabled, and you gain full control over every color element in the sections below.
🖌️ Custom Appearance & Colors
These settings are only active when "Use Template" is unchecked.
Flame Head / Tail: Sets the start and end colors for the dynamic flame effect that traces the clock's border, representing the second hand.
Numbers / Main Numbers: Customize the color of the regular hour numbers (1, 2, 4, 5...) and the main cardinal numbers (3, 6, 9, 12).
Sunburst Colors (1-6): Controls the six colors used in the gradient background for the "sunburst" effect inside the clock face.
Hands & Digital: Fine-tune the colors for the Hour/Minute Hand, Second Hand, central Pivot point, and the digital time display.
Chain Color / Width: Customize the appearance of the two chains holding the clock.
📡 Volume Scanner
Control the behavior of the multi-symbol scanner.
Show Scanner Labels: A master switch to show or hide all the bull/bear symbol circles inside the clock.
Lookback (Bars): A crucial setting that defines the calculation period for buy/sell volume for all scanned symbols. The calculation is a sum over the specified number of recent bars.
`0`: Calculates using the current bar only .
`7`: Calculates the sum of volume over the last 8 bars (the current bar + 7 historical bars).
Symbols List: Here you can enable/disable up to 20 slots and input the ticker for each symbol you want to scan (e.g., BINANCE:BTCUSDT , NASDAQ:AAPL ).
⭐ Bullish Watchlist Filter
Configure the criteria for the elite watchlist symbols displayed above the clock.
Enable Watchlist: A master switch to turn the entire watchlist feature on or off.
Volume MA Length: Sets the lookback period `(X)` for the Simple Moving Average of volume used in the filter.
Consecutive Days Above MA: Sets the minimum number of consecutive days `(Y)` that volume must close above its MA to qualify.
Symbols Per Row: Determines the maximum number of watchlist symbols that can fit in a single row before a new row is created above it.
Background / Text Color: When not using a template, you can set custom colors for the watchlist symbols' background and text.
📏 Position & Size
Adjust the clock's placement and dimensions on your chart.
Clock Timezone: Sets the timezone for the digital and analog time display. You can use standard formats like "America/New_York" or enter "Exchange" to sync with the chart's timezone.
Radius (Bars): Controls the overall size of the clock. The radius is measured in terms of the number of bars on the x-axis.
X Offset (Bars): Moves the entire clock horizontally. Positive values shift it to the right; negative values shift it to the left.
Y Offset (Price %): Moves the entire clock vertically as a percentage of your screen's price pane. Positive values move it up; negative values move it down.
Heiken Ashi + Ichimoku Baseline ScalperHi
This a trend identification strategy. You can hold your trade as long as the signals are in your favor.
Drone Arrows with Supply & Demand (v6)A guided decision-making tool.
Here’s a conservative way to use it:
For Long Trades (Buy)
Check the Dashboard
At least 4–5 timeframes green (uptrend) is ideal.
Overall condition = “Strong Buy” preferred.
Look for a Green BUY Signal Arrow
Appears below the candle.
Price should be above the MA if the trend filter is on.
Ideally, volume is above threshold if volume filter is enabled.
Check Supply/Demand Zones
Avoid buying directly into a nearby supply zone overhead.
Best if you’re entering near/within a demand zone.
Confirm Market Structure
Higher highs & higher lows in recent price action.
Set Stop Loss & Targets
Use the plotted SL (ATR-based) or place just below nearest demand zone.
TP levels are plotted — aim for 1:2 or better reward-to-risk.
For Short Trades (Sell)
Check the Dashboard
At least 4–5 timeframes red (downtrend) is ideal.
Overall condition = “Strong Sell” preferred.
Look for a Red SELL Signal Arrow
Appears above the candle.
Price should be below the MA if the trend filter is on.
Ideally, volume is above threshold if volume filter is enabled.
Check Supply/Demand Zones
Avoid shorting into a nearby demand zone.
Best if you’re entering near/within a supply zone.
Confirm Market Structure
Lower highs & lower lows in recent price action.
Set Stop Loss & Targets
Use plotted SL (ATR-based) or just above nearest supply zone.
TP levels are plotted — aim for 1:2 or better reward-to-risk.
Extra Tips
Patience: This tool works best in trending markets. In choppy sideways ranges, expect more false signals.
Higher Timeframe Confluence: Even if trading M5/M15, align with H1 or H4 direction for better probabilities.
Zones as Dynamic S/R: The supply/demand boxes are great for trade entries/exits — watch how price reacts to them.
Cool Down Helps: The cooldown prevents overtrading but you can adjust it if you want faster signals.
Market Prediction Indicator - Nifty 50/Stocksthis indicator gives buy and sell signals for nifty and indian stocks
EMA Distance %# EMA Distance % - Daily Timeframe Analysis
## Overview
This indicator provides real-time analysis of price distance from key Exponential Moving Averages (EMA 10 and EMA 21) on the daily timeframe, regardless of your current chart timeframe. It displays both percentage and volatility-adjusted (ATR) distances in a clean, customizable table format.
## Key Features
- **Daily Timeframe Focus**: Always references daily EMA 10 and EMA 21 values, providing consistent analysis across all chart timeframes
- **Dual Distance Metrics**: Shows both percentage distance and ATR-normalized distance for comprehensive analysis
- **Customizable Table Position**: Position the data table anywhere on your chart (9 different locations available)
- **Color-Coded Results**: Green indicates price above EMA, red indicates price below EMA
- **Volatility Adjustment**: ATR distance provides context relative to the asset's typical price movements
## What It Shows
The indicator displays a table with the following information:
- **EMA Value**: Current daily EMA 10 and EMA 21 values
- **Distance %**: Percentage distance from each EMA (positive = above, negative = below)
- **ATR Distance**: How many Average True Range units the price is from each EMA
## Use Cases
- **Mean Reversion Trading**: Identify when price has moved significantly away from key EMAs
- **Trend Strength Analysis**: Gauge the strength of current trends relative to moving averages
- **Entry/Exit Timing**: Use ATR distances to identify potential reversal zones (typically 2-3+ ATR)
- **Multi-Timeframe Analysis**: View daily EMA relationships while analyzing shorter timeframes
- **Risk Management**: Understand volatility-adjusted distance for better position sizing
## Settings
- **Table Position**: Choose from 9 different table positions on your chart
- **ATR Period**: Customize the ATR calculation period (default: 14)
## Interpretation
- **Small distances (< 1% or < 1 ATR)**: Price near EMA support/resistance
- **Medium distances (1-3% or 1-2 ATR)**: Normal trending movement
- **Large distances (> 3% or > 2-3 ATR)**: Potential overextension, watch for mean reversion
Perfect for swing traders, position traders, and anyone using EMA-based strategies who wants quick access to daily timeframe EMA relationships without switching chart timeframes.
WaveTrend Dynamic (Lazy Bear Style)█ OVERVIEW
The WaveTrend Dynamic indicator (in the style of Lazy Bear) is an advanced tool based on the Exponential Smoothing Average (ESA), which adapts to the volatility and price of a financial instrument. It is more flexible than the classic WaveTrend but shares a similar concept of bands around a main oscillator line.
The indicator uses dynamic bands calculated as distances from the ESA, with their width adjustable via the "level" parameter. This allows it to be tailored to various markets, timeframes, and volatility conditions, making it easier to identify trends, reversal points, and buy/sell signals.
█ CONCEPTS
The WaveTrend Dynamic combines oscillator functions with trend analysis. Below, we explain the key components in a simple way, understandable even for beginner users.
Core Calculations
The indicator relies on the adaptive ESA and a few straightforward steps:
1 — ESA (Adaptive Average): Calculated as a smoothed average of the price (from high, low, and close, or HLC3) using the ESA Length parameter (default: 10). This number determines how many past candles are considered in the calculation. The ESA quickly responds to price changes, helping to track trends.
2 — Deviation (D): Measures how much the price deviates from the ESA, factoring in market volatility. This allows the indicator to adapt to different instruments.
3 — Price Distance Indicator (CI): Shows how far the price is from the ESA relative to market volatility. This forms the basis for the main indicator line, reacting to price movements.
4 — WT1 (WaveTrend 1): The main line, smoothing the Price Distance Indicator (CI) with the Average Length parameter (default: 21). It reflects the direction of price movement and momentum.
5 — WT2 (WaveTrend 2): A signal line that further smooths WT1 (with a period of 4). It helps confirm signals through crossovers with WT1.
6 — Bands (UpperBand and LowerBand): These form a dynamic channel around the ESA. Their width depends on the level parameter (default: 100). Wider bands result in fewer but more reliable signals. In the original WaveTrend, the oscillator bands use lower values, such as 50 or 60. To achieve classic oscillator signals (more frequent WT1/WT2 crossovers outside the bands), set the level to 50–60.
Trend Identification
The indicator identifies two types of trends:
• Major Trend: Determined by the position of WT1 relative to the ESA. When WT1 is above the ESA, it indicates a bullish trend. When below, it signals a bearish trend. Line and fill colors reflect this trend.
• Mini-Trend: Based on WT1 and WT2 crossovers. When the lines cross, they change to the same color, signaling short-term changes or reversal points. This is ideal for quick trading decisions.
Visuals and Effects
• WT1 and WT2 Lines: Scaled to price and displayed on the price chart for easier analysis.
• Fills: Between the bands (UpperBand/LowerBand) and between WT1/WT2, with a "wave" effect that adjusts transparency based on the trend (green for bullish, red for bearish).
• Signals: Three types—return-to-band, WT1/WT2 crossovers outside the bands, and crossovers inside the bands. Signals are displayed as triangles with different colors for buy and sell.
█ FEATURES
Detailed features of the indicator, aligned with the order of settings in the script:
• Basic Parameters: ESA Length — controls ESA smoothing; Average Length — affects WT1 responsiveness; level (WT Level) — adjusts band width for signal filtering.
• Display Elements: Options to show/hide ESA, bands, WT1/WT2; customizable colors for lines, fills, and the wave effect.
• Signals: Three signal groups (return-to-band, crossovers outside bands, crossovers inside bands) with display and color customization options.
█ HOW TO USE
1 — Add the indicator to your TradingView chart and adjust parameters: — Increase ESA Length and Average Length for low-volatility markets (e.g., stocks), or decrease for cryptocurrencies or forex. — Set level to 50–60 for classic WaveTrend signals with WT1/WT2 crossovers outside bands. The default value of 100 creates wider bands and fewer signals.
2 — Analyze trends: — Major trend (WT1 vs. ESA) shows the overall market direction. — Mini-trends (WT1/WT2 crossovers) help time short-term entries.
3 — Use signals: — Return-to-band: Buy at the lower band, sell at the upper band (mean-reversion). — Crossovers outside bands: Indicate strong momentum (with a lower level, e.g., 50). — Crossovers inside bands: Signal weaker trend changes.
4 — Combine with other tools: Use with volume, RSI, or support/resistance for better decisions. Test on historical data to optimize settings.
RS BTC 11-minute scalp is a strategy designed for BTC. I would appreciate your comments on what can be done to improve it.
Simple Trend Line DetectorAutomatically detects and draws high-quality trend lines for quick market analysis and trading ideas. Perfect for rapid trend analysis and identifying key levels without manual drawing.
Prime NumbersPrime Numbers highlights prime numbers (no surprise there 😅), tokens and the recent "active" feature in "input".
🔸 CONCEPTS
🔹 What are Prime Numbers?
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers.
Wikipedia: Prime number
🔹 Prime Factorization
The fundamental theorem of arithmetic states that every integer larger than 1 can be written as a product of one or more primes. More strongly, this product is unique in the sense that any two prime factorizations of the same number will have the same number of copies of the same primes, although their ordering may differ. So, although there are many different ways of finding a factorization using an integer factorization algorithm, they all must produce the same result. Primes can thus be considered the "basic building blocks" of the natural numbers.
Wikipedia: Fundamental theorem of arithmetic
Math Is Fun: Prime Factorization
We divide a given number by Prime Numbers until only Primes remain.
Example:
24 / 2 = 12 | 24 / 3 = 8
12 / 3 = 4 | 8 / 2 = 4
4 / 2 = 2 | 4 / 2 = 2
|
24 = 2 x 3 x 2 | 24 = 3 x 2 x 2
or | or
24 = 2² x 3 | 24 = 2² x 3
In other words, every natural/integer number above 1 has a unique representation as a product of prime numbers, no matter how the number is divided. Only the order can change, but the factors (the basic elements) are always the same.
🔸 USAGE
The Prime Numbers publication contains two use cases:
Prime Factorization: performed on "close" prices, or a manual chosen number.
List Prime Numbers: shows a list of Prime Numbers.
The other two options are discussed in the DETAILS chapter:
Prime Factorization Without Arrays
Find Prime Numbers
🔹 Prime Factorization
Users can choose to perform Prime Factorization on close prices or a manually given number.
❗️ Note that this option only applies to close prices above 1, which are also rounded since Prime Factorization can only be performed on natural (integer) numbers above 1.
In the image below, the left example shows Prime Factorization performed on each close price for the latest 50 bars (which is set with "Run script only on 'Last x Bars'" -> 50).
The right example shows Prime Factorization performed on a manually given number, in this case "1,340,011". This is done only on the last bar.
When the "Source" option "close price" is chosen, one can toggle "Also current price", where both the historical and the latest current price are factored. If disabled, only historical prices are factored.
Note that, depending on the chosen options, only applicable settings are available, due to a recent feature, namely the parameter "active" in settings.
Setting the "Source" option to "Manual - Limited" will factorize any given number between 1 and 1,340,011, the latter being the highest value in the available arrays with primes.
Setting to "Manual - Not Limited" enables the user to enter a higher number. If all factors of the manual entered number are in the 1 - 1,340,011 range, these factors will be shown; however, if a factor is higher than 1,340,011, the calculation will stop, after which a warning is shown:
The calculated factors are displayed as a label where identical factors are simplified with an exponent notation in superscript.
For example 2 x 2 x 2 x 5 x 7 x 7 will be noted as 2³ x 5 x 7²
🔹 List Prime Numbers
The "List Prime Numbers" option enables users to enter a number, where the first found Prime Number is shown, together with the next x Prime Numbers ("Amount", max. 200)
The highest shown Prime Number is 1,340,011.
One can set the number of shown columns to customize the displayed numbers ("Max. columns", max. 20).
🔸 DETAILS
The Prime Numbers publication consists out of 4 parts:
Prime Factorization Without Arrays
Prime Factorization
List Prime Numbers
Find Prime Numbers
The usage of "Prime Factorization" and "List Prime Numbers" is explained above.
🔹 Prime Factorization Without Arrays
This option is only there to highlight a hurdle while performing Prime Factorization.
The basic method of Prime Factorization is to divide the base number by 2, 3, ... until the result is an integer number. Continue until the remaining number and its factors are all primes.
The division should be done by primes, but then you need to know which one is a prime.
In practice, one performs a loop from 2 to the base number.
Example:
Base_number = input.int(24)
arr = array.new()
n = Base_number
go = true
while go
for i = 2 to n
if n % i == 0
if n / i == 1
go := false
arr.push(i)
label.new(bar_index, high, str.tostring(arr))
else
arr.push(i)
n /= i
break
Small numbers won't cause issues, but when performing the calculations on, for example, 124,001 and a timeframe of, for example, 1 hour, the script will struggle and finally give a runtime error.
How to solve this?
If we use an array with only primes, we need fewer calculations since if we divide by a non-prime number, we have to divide further until all factors are primes.
I've filled arrays with prime numbers and made libraries of them. (see chapter "Find Prime Numbers" to know how these primes were found).
🔹 Tokens
A hurdle was to fill the libraries with as many prime numbers as possible.
Initially, the maximum token limit of a library was 80K.
Very recently, that limit was lifted to 100K. Kudos to the TradingView developers!
What are tokens?
Tokens are the smallest elements of a program that are meaningful to the compiler. They are also known as the fundamental building blocks of the program.
I have included a code block below the publication code (// - - - Educational (2) - - - ) which, if copied and made to a library, will contain exactly 100K tokens.
Adding more exported functions will throw a "too many tokens" error when saving the library. Subtracting 100K from the shown amount of tokens gives you the amount of used tokens for that particular function.
In that way, one can experiment with the impact of each code addition in terms of tokens.
For example adding the following code in the library:
export a() => a = array.from(1) will result in a 100,041 tokens error, in other words (100,041 - 100,000) that functions contains 41 tokens.
Some more examples, some are straightforward, others are not )
// adding these lines in one of the arrays results in x tokens
, 1 // 2 tokens
, 111, 111, 111 // 12 tokens
, 1111 // 5 tokens
, 111111111 // 10 tokens
, 1111111111111111111 // 20 tokens
, 1234567890123456789 // 20 tokens
, 1111111111111111111 + 1 // 20 tokens
, 1111111111111111111 + 8 // 20 tokens
, 1111111111111111111 + 9 // 20 tokens
, 1111111111111111111 * 1 // 20 tokens
, 1111111111111111111 * 9 // 21 tokens
, 9999999999999999999 // 21 tokens
, 1111111111111111111 * 10 // 21 tokens
, 11111111111111111110 // 21 tokens
//adding these functions to the library results in x tokens
export f() => 1 // 4 tokens
export f() => v = 1 // 4 tokens
export f() => var v = 1 // 4 tokens
export f() => var v = 1, v // 4 tokens
//adding these functions to the library results in x tokens
export a() => const arraya = array.from(1) // 42 tokens
export a() => arraya = array.from(1) // 42 tokens
export a() => a = array.from(1) // 41 tokens
export a() => array.from(1) // 32 tokens
export a() => a = array.new() // 44 tokens
export a() => a = array.new(), a.push(1) // 56 tokens
What if we could lower the amount of tokens, so we can export more Prime Numbers?
Look at this example:
829111, 829121, 829123, 829151, 829159, 829177, 829187, 829193
Eight numbers contain the same number 8291.
If we make a function that removes recurrent values, we get fewer tokens!
829111, 829121, 829123, 829151, 829159, 829177, 829187, 829193
//is transformed to:
829111, 21, 23, 51, 59, 77, 87, 93
The code block below the publication code (// - - - Educational (1) - - - ) shows how these values were reduced. With each step of 100, only the first Prime Number is shown fully.
This function could be enhanced even more to reduce recurrent thousands, tens of thousands, etc.
Using this technique enables us to export more Prime Numbers. The number of necessary libraries was reduced to half or less.
The reduced Prime Numbers are restored using the restoreValues() function, found in the library fikira/Primes_4.
🔹 Find Prime Numbers
This function is merely added to show how I filled arrays with Prime Numbers, which were, in turn, added to libraries (after reduction of recurrent values).
To know whether a number is a Prime Number, we divide the given number by values of the Primes array (Primes 2 -> max. 1,340,011). Once the division results in an integer, where the divisor is smaller than the dividend, the calculation stops since the given number is not a Prime.
When we perform these calculations in a loop, we can check whether a series of numbers is a Prime or not. Each time a number is proven not to be a Prime, the loop starts again with a higher number. Once all Primes of the array are used without the result being an integer, we have found a new Prime Number, which is added to the array.
Doing such calculations on one bar will result in a runtime error.
To solve this, the findPrimeNumbers() function remembers the index of the array. Once a limit has been reached on 1 bar (for example, the number of iterations), calculations will stop on that bar and restart on the next bar.
This spreads the workload over several bars, making it possible to continue these calculations without a runtime error.
The result is placed in log.info() , which can be copied and pasted into a hardcoded array of Prime Number values.
These settings adjust the amount of workload per bar:
Max Size: maximum size of Primes array.
Max Bars Runtime: maximum amount of bars where the function is called.
Max Numbers To Process Per Bar: maximum numbers to check on each bar, whether they are Prime Numbers.
Max Iterations Per Bar: maximum loop calculations per bar.
🔹 The End
❗️ The code and description is written without the help of an LLM, I've only used Grammarly to improve my description (without AI :) )
Kootch EMA MapKootch EMA overlays the 200 EMA from M1, M5, M15, M30, H1, H4, and D1 on any chart so you always see where higher and lower-timeframe trend gravity actually is. It also builds an optional Fib channel between the most extreme MTF 200 EMAs (min/max), giving you clean intrachannel targets and confluence zones.
What it does
• Plots seven 200 EMAs (M1 → D1) simultaneously via MTF pulls
• Color/weight hierarchy: thicker lines = higher timeframe (clear priority)
• Right-edge TF tags (M1, M5, … D1) so you know exactly what you’re looking at
• Optional Fib levels between min/max MTF 200 EMAs (0 → 1 band) for entries, adds, and take-profit scaling
Why traders use it
• Immediate read on trend alignment vs. chop across timeframes
• Mean-reversion & continuation cues when price stretches from/returns to key EMAs
• Level stacking: use M30/H1/H4/D1 as bias, trade entries around lower-TF reactions
Inputs
• EMA Length (default 200)
• Label offset (push tags off the last bar)
• Show Fib channel toggle + color control
How I use it
• Bias from D1/H4/H1; execution from M5/M15.
• Fade or follow at Fib 0.382 / 0.618 inside the EMA envelope; scale out near Fib 1.0 into HTF EMAs.
• Skip trades when EMAs are braided and distances are compressed.
Notes
• Works on any symbol/timeframe; all TF EMAs are requested explicitly.
• This is a map, not a crystal ball: combine with your playbook (structure breaks, FVGs, liquidity, volume).
Trident Doji Detector - ZTFNon-Lagging Doji Detector
This indicator automatically identifies and plots four types of doji candlestick patterns in real-time, specifically designed as a component of @TylerG_Capital's Trident pattern trading model.
Common Doji - Small body with balanced upper and lower shadows (blue diamond)
Long-Legged Doji - Small body with very long shadows on both sides (purple square)
Dragonfly Doji - Small body with long lower shadow, minimal upper shadow (green triangle)
Four-Price Doji - All prices (OHLC) nearly equal, forming a flat line (orange cross)
Key Features:
Detects patterns as they form (non-lagging) or waits for candle close confirmation
Adjustable body size threshold (default 10% of candle range)
Tiny, unobtrusive labels positioned below bars
Works on all timeframes and instruments
Simple pattern recognition without directional bias
How it works: The indicator analyzes each candle's body size relative to its total range and shadow proportions. It uses a hierarchy system to classify each doji into its most specific type, ensuring only one label per candle.
Fork: BigBeluga TargetTrend with Bounded Box & Potential LabelFork of BigBeluga's TargetTrend indicator with bounding boxes of trend legs with max favorable excursion label added.
Only Buy & Sell – The Ultimate Nasdaq TradingWelcome to Only Buy & Sell, a precision-crafted trading strategy built for traders who demand simplicity, clarity, and performance. Designed to thrive in Nasdaq 1H charts, this strategy filters out the noise and focuses on what matters most – buy when the market turns up, sell when it turns down.
💡 Key Highlights
Crystal-Clear Entries: Only takes trades at exact buy and sell signals – no hesitation, no clutter.
Perfect for Nasdaq Hourly: Extensively tested to perform exceptionally well in Nasdaq 1-hour timeframes.
Endless Opportunities: Suitable for trending and swing-style index trading.
Built for Performance: Focuses on catching the core of the move, not chasing every candle.
Proven Simplicity: No overcomplication – just clean EMA crossovers with smart RSI filters.
How It Works
Buy: When short-term momentum overtakes long-term trend with strength.
Sell: When weakness confirms the reversal.
No Over-Trading: Ignores false noise and waits patiently for high-probability setups.
Why Traders Love It
Optimized for indices like Nasdaq, but can be applied to other volatile instruments.
Fast signal recognition with immediate position switching.
Works seamlessly in both live trading and backtesting.
⚠ Disclaimer: This is not financial advice. Past performance is not indicative of future results. Always backtest and adjust according to your risk profile.
If you’ve been looking for a minimalist yet powerful approach to index trading, this is your new edge. Load it, test it, and let the market come to you. ❤️
FlowScape PredictorFlowScape Predictor is a non-repainting, regime-aware entry qualifier that turns complex market context into two readiness scores (Long & Short, each 0/25/50/75/100) and clean, confirmed-bar signals. It blends three orthogonal pillars so you act only when trend energy, momentum, and location agree:
Regime (energy): ATR-normalized linear-regression slope of a smooth HMA → EMA baseline, gated by ADX to confirm when pressure is meaningful.
Momentum (push): RSI slope alignment so price has directional follow-through, not just drift.
Structure (location): proximity to pivot-confirmed swings, scaled by ATR, so “ready” appears near constructive pullbacks—not mid-trend chases.
A soft ATR cloud wraps the baseline for context. A yellow Predictive Baseline extends beyond the last bar to visualize near-term trajectory. It is visual-only: scores/alerts never use it.
What you see
Baseline line that turns green/red when regime is strong in that direction; gray when weak.
ATR cloud around the baseline (context for stretch and pullbacks).
Scores (Long & Short, 0–100 in steps of 25) and optional “L/S” icons on bar close.
Yellow Predictive Baseline that extends to the right for a few bars (visual trajectory of the smoothed baseline).
The scoring system (simple and transparent)
Each side (Long/Short) sums four binary checks, 25 points each:
Regime aligned: trendStrong is true and LR slope sign favors that side.
Momentum aligned: RSI side (>50 for Long, <50 for Short) and RSI slope confirms direction.
Baseline side: price is above (Long) / below (Short) the baseline.
Location constructive: distance from the last confirmed pivot is healthy (ATR-scaled; not overstretched).
Valid totals are 0, 25, 50, 75, 100.
Best-quality signal: 100/0 (your side/opposite) on bar close.
Good, still valid: 75/0, especially when the missing block is only “location” right as price re-engages the cloud/baseline.
Avoid: 75/25 or any opposition > 0 in a weak (gray) regime.
The Predictive (Kalman) line — what it is and isn’t
The yellow line is a visual forward extension of the smoothed baseline to help you see the current trajectory and time pullback resumptions. It does not predict price and is excluded from scores and alerts.
How it’s built (plain English):
We maintain a one-dimensional Kalman state x as a smoothed estimate of the baseline. Each bar we observe the current baseline z.
The filter adjusts its trust using the Kalman gain K = P / (P + R) and updates:
x := x + K*(z − x), then P := (1 − K)*P + Q.
Q (process noise): Higher Q → expects faster change → tracks turns quicker (less smoothing).
R (measurement noise): Higher R → trusts raw baseline less → smoother, steadier projection.
What you control:
Lead (how many bars forward to draw).
Kalman Q/R (visual smoothness vs. responsiveness).
Toggle the line on/off if you prefer a minimal chart.
Important: The predictive line extends the baseline, not price. It’s a visual timing aid—don’t automate off it.
How to use (step-by-step)
Keep the chart clean and use a standard OHLC/candlestick chart.
Read the regime: Prefer trades with green/red baseline (trendStrong = true).
Check scores on bar close:
Take Long 100 / Short 0 or Long 75 / Short 0 when the chart shows a tidy pullback re-engaging the cloud/baseline.
Mirror the logic for shorts.
Confirm location: If price is > ~1.5 ATR from its reference pivot, let it come back—avoid chasing.
Set alerts: Add an alert on Long Ready or Short Ready; these fire on closed bars only.
Risk management: Use ATR-buffered stops beyond the recent pivot; target fixed-R multiples (e.g., 1.5–3.0R). Manage the trade with the baseline/cloud if you trail.
Best-practice playbook (quick rules)
Green light: 100/0 (best) or 75/0 (good) on bar close in a colored (non-gray) regime.
Location first: Prefer entries near the baseline/cloud right after a pullback, not far above/below it.
Avoid mixed signals: Skip 75/25 and anything with opposition while the baseline is gray.
Use the yellow line with discretion: It helps you see rhythm; it’s not a signal source.
Timeframes & tuning (practical defaults)
Intraday indices/FX (5m–15m): Demand 100/0 in chop; allow 75/0 when ADX is awake and pullback is clean.
Crypto intraday (15m–1h): Prefer 100/0; 75/0 on the first pullback after a regime turn.
Swing (1h–4h/D1): 75/0 is often sufficient; 100/0 is excellent (fewer but cleaner signals).
If choppy: raise ADX threshold, raise the readiness bar (insist on 100/0), or lengthen the RSI slope window.
What makes FlowScape different
Energy-first regime filter: ATR-normalized LR slope + ADX gate yields a consistent read of trend quality across symbols and timeframes.
Location-aware entries: ATR-scaled pivot proximity discourages mid-air chases, encouraging pullback timing.
Separation of concerns: The predictive line is visual-only, while scores/alerts are confirmed on close for non-repainting behavior.
One simple score per side: A single 0–100 readiness figure is easier to tune than juggling multiple indicators.
Transparency & limitations
Scores are coarse by design (25-point blocks). They’re a gatekeeper, not a promise of outcomes.
Pivots confirm after right-side bars, so structure signals appear after swings form (non-repainting by design).
Avoid using non-standard chart types (Heikin Ashi, Renko, Range, etc.) for signals; use a clean, standard chart.
No lookahead, no higher-timeframe requests; alerts fire on closed bars only.
Stop-Loss Sentinel
Cutloss Swing Marker with Adjustable Trend Lines
This indicator identifies swing highs and lows using pivot points.
Swing Highs are marked with a green downward triangle and a "Cutloss" label above the bar.
Swing Lows are marked with a red upward triangle and a "Cutloss" label below the bar.
From each Cutloss point, a horizontal trend line is drawn forward for a set number of bars.
All colors (text, trend lines) and line length are fully adjustable in the settings.
Intended Use:
Helps traders visually mark potential stop-loss or reversal zones and track them over the next few bars. Works on any timeframe, but is designed for fast decision-making on lower timeframes like M1.
Marks key swing highs/lows with ‘Cutloss’ labels and triangles, then extends customizable trend lines for the next bars. Ideal for spotting stop-loss or reversal zones on any timeframe.
Egg vs Tennis Ball — Drop/Rebound StrengthEgg vs Tennis Ball — Drop/Rebound Meter
What it does
Classifies selloffs as either:
Eggs — dead‑cat, no bounce
Tennis Balls — fast, decisive rebound
Core features
Detects swing drops from a Pivot High (PH) to a Pivot Low (PL)
Requires drops to be meaningful (volatility‑aware, ATR‑scaled)
Draws a bounce threshold line and a deadline
Decides outcome based on speed and extent of rebound
Tracks scores and win rates across multiple lookback windows
Includes a color‑coded meter and current streak display
Visuals at a glance
Gray diagonal — drop from PH to PL
Teal dotted horizontal — bounce threshold, from PH to the deadline
Solid green — Tennis Ball (bounce line broken before the deadline)
Solid red — Egg (deadline expired before the bounce)
Optional PH / PL labels for clarity
How the decision is made
1) Find pivots — symmetric pivots using Pivot Left / Right; PL confirms after Right bars.
2) Qualify the drop — Drop Size = PH − PL; must be ≥ (Drop Threshold × ATR at PL).
3) Define the bounce line — PL + (Bounce Multiple × Drop Size). 1.00× = full retrace to PH; up to 2.00× for overshoot.
4) Set the deadline — Drop Bars = PL index − PH index; Deadline = Drop Bars × Recovery Factor; timer starts from PH or PL.
5) Resolve — Tennis Ball if price hits the bounce line before the deadline; Egg if the deadline passes first.
Scoring system (−100 to +100)
+100 = perfect Tennis Ball (fastest possible + full overshoot)
−100 = perfect Egg (no recovery)
In between: scored by rebound speed and extent, shaped by your weight settings
Meter Table
Columns (toggle on/off)
All (off by default)
Last N1 (default 5)
Last N2 (default 10)
Last N3 (default 20)
Rows
Tennis / Eggs — counts
% Tennis — win rate
Avg Score — normalized quality from −100 to +100
Streak — overall (not windowed), e.g., +3 = 3 Tennis Balls in a row, −4 = 4 Eggs in a row
Alerts
Tennis Ball – Fast Rebound — triggers when the bounce line is broken in time
Egg – Window Expired — triggers when the deadline passes without a bounce
Inputs
① Drop Detection
Pivot Left / Right
ATR Length
Drop Threshold × ATR
② Bounce Requirement
Bounce Multiple × Drop Size (0.10–2.00×)
③ Timing
Timer Start — PH or PL
Recovery Factor × Drop Bars
Break Trigger — Close or High
④ Display
Show Pivot/Outcome Labels
Line Width
Table Position (corner)
⑤ Meter Columns
Show All (off by default)
Show N1 / N2 / N3 (5, 10, 20 by default)
⑥ Scoring Weights
Tennis — Base, Speed, Extent
Egg — Base, Strength
How to use it
Pick strictness — start with Drop Threshold = 2.0 ATR, Bounce Multiple = 1.0×, Recovery Factor = 3.0×; adjust to timeframe and volatility.
Watch the dotted line — it ends at the deadline; turns solid green (Tennis) if broken in time, solid red (Egg) if it expires.
Read the meter — short windows (5–10) show current behavior; Avg Score captures quality; Streak shows momentum.
Blend with your system — combine with trend filters, volume, or regime detection.
Tips
Close vs High trigger: Close is stricter; High is more responsive.
PH vs PL timer start: PH measures round‑trip; PL measures recovery only.
Increase pivot strength for fewer, more reliable signals.
Higher timeframes generally produce cleaner patterns.
Defaults
Pivot L/R: 5 / 5
ATR Length: 14
Drop Threshold: 2.0× ATR
Bounce Multiple: 1.00×
Recovery Factor: 3.0×
Break Trigger: Close
Windows: Last 5, 10, 20 (All off)
Interpreting results
Tennis‑y: Avg Score +30 to +70, %Tennis > 55%
Mixed: Avg Score near 0
Egg‑y: Avg Score −30 to −80, %Tennis < 45%
Engulfing Pattern[SpeculationLab]Overview
This script detects two types of engulfing / outer bar patterns and marks them directly on the chart:
Body Engulfing – The current candle’s body range (open–close) completely covers the entire range (high–low) of the previous candle.
Range Engulfing – The current candle’s full range (high–low, including wicks) completely covers the entire range (high–low) of the previous candle.
Direction logic:
Bull – The previous candle is bearish and the selected engulfing rule is met.
Bear – The previous candle is bullish and the selected engulfing rule is met.
Optional: Require the current candle to have the opposite color of the previous one.
This is an open-source pattern recognition tool for learning, backtesting, and chart review. It is not financial advice.
Key Features
Two detection modes:
body – Body engulfs previous entire range
range – Wicks engulf previous entire range
Direction detection based on the previous candle’s color, with optional opposite-color confirmation
Chart markers: “BULL” /“BEAR” above bars
Alert-ready: built-in conditions for bullish and bearish engulfing patterns
Parameters
Engulfing Type: body / range
body: Current body must fully cover the previous candle’s high–low range
range: Current full range (high–low) must fully cover the previous candle’s high–low range
Require Opposite Previous Candle (default: off):
When enabled, the engulfing pattern must also have the opposite color from the previous candle to trigger
Usage Tips
Engulfing patterns are price action structures; combine with trend, key levels, and volume for context
Signals confirm on bar close (barstate.isconfirmed) to reduce repainting
Can be used with personal risk management rules (stop-loss, take-profit, filters)
Disclaimer
For educational and research purposes only – not financial advice
Past performance of patterns does not guarantee future results
Trading involves risk; always manage it responsibly
This script is open-source – feel free to learn from or modify it, but credit the original source and author (SpeculationLab)
脚本简介
本脚本用于识别两类包裹/外包形态,并在图表上以标记提示:
Body(实体包裹):当前K线的实体区间(开—收)完全覆盖上一根K线的整个区间(上一根的高—低)。
Range(影线外包):当前K线的影线区间(高—低)完全覆盖上一根K线的整个区间(上一根的高—低)。
方向判定:
Bull(多):上一根为阴线且满足所选包裹规则;
Bear(空):上一根为阳线且满足所选包裹规则;
可选项:要求“当前K线颜色与上一根相反”后再确认(见参数)。
本脚本为开源形态识别工具,适合技术分析学习、回测与复盘,不构成任何投资建议。
主要功能
两种识别模式:body(实体包裹上一根整段) / range(影线包裹上一根整段)。
方向识别:按上一根K线颜色判断多空;可选“当前颜色与上一根相反”的二次确认。
图表提示:plotshape 在K线上方标注 “BULL / BEAR”。
提醒支持:内置 Bullish Engulf / Bearish Engulf 提醒条件。
参数说明
Engulfing Type:body / range
body:当前实体须完全覆盖上一根的高—低整段;
range:当前高—低须完全覆盖上一根的高—低整段。
Require Opposite Previous Candle(默认关闭):
开启后,除满足包裹规则外,还需当前K线颜色与上一根相反才触发标记。
使用建议
包裹/外包是价格行为结构,建议结合趋势、关键价位、成交量等因素综合判断。
信号在收盘时确认(barstate.isconfirmed),以减少重绘干扰。
可与个人风格的风险控制规则(止损、止盈、过滤条件)配合使用。
合规与免责声明
本脚本仅用于技术研究与学习,不构成任何形式的投资建议或收益承诺。
历史形态并不代表未来结果,交易有风险,请自行评估并承担责任。
本脚本开源,欢迎学习与二次开发;转载或改用请注明来源与作者(SpeculationLab / 投机实验室)。
Apaar Riddhi Trend v1Apaar Riddhi Trend . An Indicator for Trend indication
There are two options
1. Sustained Buying Pressure . Logic on defining sustained buying pressure emerged from web site Simpler Trading TTM Squeeze by John Carter In a stock Sustained buying pressure is indicated when average closing price of prior 6 bars is in the upper 50% of the trading range.
2. Averages of Highs and Lows . Logic : A bar is classified based on where it stands relative to moving averages of highs and lows:
• avghh → bullish bias: High above avg high (clean breakout up) OR both high above avg high & low below avg low but with stronger upward move than downward.
• avgll → bearish bias: Low below avg low (clean breakout down) OR both breaks above/below averages but with stronger downward move."
// © ApaarOne // © Apaar.1 // © AMRx
MistaB SMC Navigation ToolkitMistaB SMC Navigation Toolkit
A complete Smart Money Concepts (SMC) toolkit designed for precision navigation of market structure, order flow, and premium/discount trading zones. Perfect for traders following ICT-style concepts and multi-timeframe confluence.
Features
✅ Order Blocks (OBs)
• Automatic bullish & bearish OB detection
• Optional displacement & high-volume filters
• Midline display for quick equilibrium view
• Auto-expiry and broken OB cleanup
✅ Fair Value Gaps (FVGs)
• Bullish & bearish gap detection
• HTF bias filtering for higher accuracy
• Compact boxes with labels
• Automatic removal when filled
✅ Market Structure (BoS / CHoCH)
• Fractal-based swing detection
• Break of Structure & Change of Character labeling
• Dynamic HTF bias dimming
✅ Premium / Discount Zones
• Auto-calculated mid-level
• Highlighted zones for optimal trade placement
✅ Higher Timeframe (HTF) Confirmation
• Configurable confirmation timeframe
• On-chart HTF status label (Bullish / Bearish / Not Required)
✅ Automatic Cleanup System
• Fast or delayed cleanup for expired/broken zones
• Dimmed colors for invalidated levels
How to Use
Set your preferred HTF in the settings.
Look for OB/FVGs aligned with HTF bias.
Enter in discount zones for longs or premium zones for shorts.
Confirm with BoS / CHoCH signals before entry.
Manage trades towards opposing liquidity zones or HTF levels.
Disclaimer
This indicator is for educational purposes only. It does not provide financial advice or guarantee future results. Always practice proper risk management and test thoroughly before live trading.
Open Range Breakout Strategy With Multi TakeProfitHello everyone,
For a while, I’ve been wanting to develop new scripts, but I couldn’t decide what to create. Eventually, I came up with the idea of coding traditional and well-known trading strategies—while adding modern features such as multi–take profit options. For the first strategy in this series, I chose the Open Range Strategy .
For those unfamiliar with it, the Open Range Strategy is a trading approach where you define a specific time period at the beginning of a trading session—such as the first 15 minutes, 30 minutes, or 1 hour—and mark the highest and lowest prices within that range. These levels then act as reference points for potential breakouts: if the price breaks above the range, it may signal a long entry; if it breaks below, it may indicate a short entry. This method is popular among day traders for capturing early momentum in the market.
Since this strategy is generally used as an intraday strategy , I added a Trade Session feature. This allows you to define the exact time window during which trades can be opened. Once the session ends, all positions are automatically closed, ensuring trades remain within your chosen intraday period.
Even though it’s a relatively simple concept, I’ve come across many different variations of it. That’s why I created a highly customizable project. Under the Session Settings, you can select the time window you want to define as your range. Whether it’s the first 15-minute candle or the entire first hour, the choice is entirely yours.
For stop-loss placement, there are two different options:
Middle of the Range – The stop loss is placed at the midpoint between the high and low of the defined range, offering a balanced buffer for both bullish and bearish setups.
Top/Bottom of the Range – The stop loss is placed just beyond the range’s high for short trades or just below the range’s low for long trades, providing a more conservative risk approach.
I’ve always been a big fan of the multi take-profit feature, so I added two different take-profit targets to this project. Take profits are calculated based on a Risk-to-Reward Ratio, which you can adjust in the settings. You can also set different position sizes for each target, allowing you to scale out of trades in a way that suits your strategy.
The result is a flexible, user-friendly strategy script that brings together a classic approach with modern risk management tools—ready to be tailored to your trading style
FIBO SWING mfi by julzALGOOVERVIEW
FIBO SWING mfi by julzALGO blends MFI → RSI → Least‑Squares smoothing to flag overbought/oversold swings and continuously plot Fibonacci retracements from the rolling high/low of the last 200 bars. It’s built to spot momentum shifts while giving you a clean, always‑current fib map of the recent market range.
CORE PRINCIPLES
Hybrid Momentum Signal
Uses MFI to integrate price and volume.
Applies RSI to MFI for momentum clarity.
Smooths the result with Least Squares regression to reduce noise.
Swing Identification
Marks potential swing highs when momentum is overbought.
Marks potential swing lows when momentum is oversold.
Fixed-Window Fibonacci Mapping
Always calculates fib levels from the highest high and lowest low of the last 200 bars.
This keeps fib zones consistent, independent of swing point detection.
Visual Clarity & Non-Repainting Logic
Clean labels for OB/OS zones.
Lines and levels update only as new bars confirm changes.
Adaptability
Works on any market and timeframe.
Adjustable momentum length, OB/OS thresholds, and smoothing.
HOW IT WORKS
Computes Money Flow Index (MFI) from price & volume.
Applies RSI to the MFI for clearer OB/OS momentum.
Smooths the hybrid with a Least Squares (linear regression) filter.
Swing labels appear when OB/OS conditions are met (green = swing low, red = swing high).
Fibonacci retracements are always drawn from the highest high and lowest low of the last 200 bars (rolling window), independent of swing labels.
HOW TO USE
Watch for OB/OS flips to mark potential swing highs/lows.
Use the 200‑bar fib grid as your active map of pullback levels and reaction zones.
Combine fib reactions with your price action/volume cues for confirmation.
Works across markets and timeframes.
SETTINGS
Length – Period for both MFI and RSI.
OB/OS Levels – Overbought/oversold thresholds (default 70/30).
Smooth – Least‑Squares smoothing length.
Fibonacci Window – Fixed at 200 bars in this version (changeable in code via fibLen).
NOTES
Logic is non‑repainting aside from standard bar/label confirmation.
Increase Length on very low timeframes to reduce noise.
Swing labels help context; fibs are always based on the most recent 200‑bar high/low range.
SUMMARY
FIBO SWING mfi by julzALGO is a momentum-plus-price action tool that merges MFI → RSI → smoothing to identify overbought/oversold swings and automatically plot Fibonacci retracements based on the rolling high/low of the last 200 bars.
It’s designed to help traders quickly see potential reversal points and pullback zones, offering visual confluence between momentum shifts and fixed-window price structure.
DISCLAIMER
For educational purposes only. Not financial advice. Trade responsibly with proper risk management.
EDIP AKTAN-OPPORTUNITYOPPORTUNITY-EDIP AKTAN
Purpose
The script highlights potential buy and sell “opportunity zones” on a chart with tall, full-height green or red columns in the background.
Green columns = possible buying opportunities during market dips in an uptrend.
Red columns = possible selling/shorting opportunities during rallies in a downtrend.
It’s designed to visually resemble the long bars you saw in your first screenshot.
Main Logic
The script checks three main factors:
Trend direction (EMA filter)
Uses the 200-period Exponential Moving Average (EMA200).
Price above EMA200 → market considered in uptrend.
Price below EMA200 → market considered in downtrend.
RSI levels (momentum filter)
RSI ≤ Buy threshold (default 35) → possible oversold condition in uptrend.
RSI ≥ Sell threshold (default 65) → possible overbought condition in downtrend.
MACD filter (optional)
Confirms trend strength before painting a bar.
Green bar only if MACD > Signal line (bullish momentum).
Red bar only if MACD < Signal line (bearish momentum).
Can be turned off if you want more frequent signals.
Visual Output
The chart background is colored green when a bullish condition is true and red when a bearish condition is true.
Bars extend the full height of the chart, making them clearly visible as “zones”.
You can choose between Solid Columns (more like your screenshot) or Soft Background shading.
Transparency level can be adjusted.
Customizable Inputs
Input Description
Trend EMA Length Determines long-term trend filter (default 200).
RSI Length Length for RSI calculation (default 14).
RSI ≤ (buy-dip trigger) Threshold for green bars (default 35).
RSI ≥ (sell-rally trigger) Threshold for red bars (default 65).
Use MACD filter Optional trend confirmation.
Paint Style Solid or soft background.
Base Transparency Controls how visible the colors are.
How to Use It
When green bars appear:
Market is trending up, and price is in a possible oversold dip → watch for buy setups.
When red bars appear:
Market is trending down, and price is in a possible overbought rally → watch for sell/short setups.
Not a standalone trading system — should be combined with price action, support/resistance, or other confirmation signals.