Smart Volume [Volume Hub]Smart Volume is a custom indicator designed to highlight meaningful changes in market activity by measuring how current volume compares to historical averages. Instead of looking at raw volume alone, it calculates how many standard deviations above or below the mean a bar’s volume is. This makes it possible to identify unusual activity (accumulation, distribution, breakouts, or fakeouts) that might not be visible just by looking at candle size or price action.
The script classifies each bar’s volume into zones:
🔴 Extra High: 4× or more standard deviations above average
🟠 High: 2.5× above average
🟡 Medium: 1× above average
🔵 Normal: around average
🟢 Low: below average
Each classification has its own color, which is applied directly to the volume histogram. This provides a quick “heatmap” effect so traders can instantly see when markets are entering phases of unusually high or unusually low participation.
🔑 How It Works
The script computes a moving average of volume over the last 610 bars.
It calculates the standard deviation of volume over the same lookback.
For each bar, it measures how far that bar’s volume is from the average, expressed in multiples of standard deviation.
Depending on the zone it falls into (low, normal, medium, high, or extra high), the bar is colored accordingly.
Background heatmap zones and threshold lines can optionally be displayed to help visualize where each threshold lies.
This approach goes beyond raw volume numbers by showing relative extremes. For example, a 50K-volume bar on one market might mean nothing, but if it’s 4 standard deviations higher than usual, it’s an “extra high” signal of market participation.
📌 How to Use It
Look for clusters of extra-high volume bars to spot institutional activity or breakout confirmation.
Use low-volume areas to identify possible consolidations, false breakouts, or lack of conviction.
Combine with your trend or price-action tools: e.g., if price breaks resistance on extra high volume, the move is more likely valid.
Works across all markets (stocks, forex, crypto, futures) and timeframes.
⚠️ Disclaimer
This script does not generate buy/sell signals. It is a volume analysis tool to help identify areas of high or low activity. Always combine with proper risk management and other forms of analysis.
指標和策略
RichRoad Turnover DisplayRich Road Turnover Display
The Rich Road Turnover Display helps you quickly gauge the average turnover of a stock in monetary terms over a chosen lookback period. You can set the number of days as input, and the indicator will display the average turnover during that period. This can be a useful way to get a sense of liquidity and volatility.
How to interpret the data (with a lookback period of 20 days):
If the average turnover is less than 10 crores, the script is fairly illiquid.
If the average turnover is between 15 to 25 crores, the script is decently liquid.
If the average turnover is above 25 crores, it is considered fairly liquid for most account sizes.
Important Notes:
Please do not use a lookback period of less than 20 days. The data for shorter periods may contain discrepancies and will not provide meaningful results.
Currently, this version supports only INR. Please do not use it for non-Indian markets. Future updates will include support for other currencies such as EUR and USD.
Master Arb Recipes – 3 Commas signal Bot integration Master Arb Recipes – 3 Commas signal Bot integration
Purpose
A systematic arbitrage/accumulation framework with pre-tuned “recipes” for BTC/ETH/XRP/SUI/SOL plus a fully manual mode. It automates signal generation for external execution bots (via alert() JSON), while showing on-chart panels for goals, active parameters, DCA position, and P&L/ROI/CAGR. Backtests simulate market orders with optional slippage and TradingView commissions.
Key ideas
Entries: Intrabar trigger when price drops by the recipe’s Entry drop % from the previous close.
Exits: Profit-taking when price rises by the recipe’s Exit rise % (optionally requiring price above average cost).
DCA accounting: Tracks running quantity, average cost, realized (cash) P&L, and unrealized (coin) P&L.
Capital planning: “ReqCap” column estimates capital = Entry $ × Allowed entries (UI only; does not affect orders).
Alerts (live only): Sends minimal Custom Signal JSON for enter_long / exit_long to your execution bot.
What’s included on chart
Top-Right: Strategy Goals Table
Describes the objective for each preset. Auto-filters by the chart’s base (optional).
Bottom-Left: Active Recipe Panel (with 3C UI column)
Shows the active preset (or custom) with: timeframe, Sell-Above-Cost state, Entry/Exit %, Exit-as-%-of-Entry, min bars between entries, once-per-bar gate, and 3Commas UI guidance for optional filters and per-order dollars.
Top-Left: DCA Panel
Current base quantity, average cost, and realized P&L.
Bottom-Right: P&L + ROI/CAGR Panel
Cash P&L (realized), Coin P&L (unrealized), Total P&L, ROI since first fill, and annualized CAGR. Displays denominators for both StartCap (strategy.initial_capital) and ReqCap (planning).
Presets
BTC: STH1_D, LTH1_6H, LTH2_D, LTH3_W, LTH4_6H
ETH: STH1_D, STH2_D, LTH1_D
XRP: STH1_D, STH2_6H, LTH1_6H, LTH2_1H
SUI: STH1_D, STH2_D, STH3_D
SOL: STH1_D, LTH1_D
Each preset sets Entry drop %, Exit rise %, default Entry $, Exit-as-%-of-Entry, Sell-Above-Cost flag, and a reference timeframe (display only). Custom mode lets you define these manually.
Inputs you’ll use
3Commas Custom Signal: secret, bot_uuid, max_lag_sec.
Start Window: Exact date/time + timezone to begin trading/signals.
Entry/Exit Parameters: Entry drop %, Exit rise %, Sell Above Avg Cost toggle, Exit as % of Entry.
Capital Planning: Allowed entries (for ReqCap), Entry $ override (panel only).
Execution/Sim: Simulated slippage %, once-per-bar gate, minimum bars between entries, TradingView commission.
Panels: Toggles + positions for each table.
Alert / Bot integration
Alerts fire only in realtime (barstate.isrealtime) on order submission.
Create one alert on this script using “Any alert() function call”.
Payload (Custom Signal style) includes:
secret, bot_uuid, max_lag, timestamp, trigger_price, tv_exchange, tv_instrument, action where action ∈ {enter_long, exit_long}.
Sizing: This script does not include per-order sizing in the JSON; size in your bot UI. The on-chart Entry $ / Exit $ values are for planning/backtest display.
3Commas optional filter mapping (shown in the panel’s “3C UI” column):
Entry filters:
Same order: set to –EntryDrop% (ON)
From average entry: set to –EntryDrop% (ON)
Exit filters:
If Sell Above Cost = ON → From average entry +ExitRise% (ON); Same order OFF
If Sell Above Cost = OFF → Same order +ExitRise% (ON); From average entry OFF
Per-order volume: Use your bot’s UI. Panel shows the dollars you planned (Entry $ and Exit $).
Backtest notes & limitations
Uses calc_on_every_tick=true and intrabar checks against the previous close for entry drops; historical behavior won’t perfectly match exchange microstructure.
process_orders_on_close=false; fills are simulated at bar prices with your slippage setting and TV commission.
Alerts and webhook timing depend on TradingView + broker/exchange latencies; use max_lag_sec accordingly.
Required Capital (ReqCap) is for planning only and does not reserve funds or constrain orders.
Recommended markets/timeframes
Crypto spot or futures charts that trade 24/7. Preset labels (D/6H/1H/W) are reference rhythms for volatility; the script runs on any timeframe but results will vary.
Change log (04092025)
Added 3C UI guidance column in Active Recipe panel (dynamic % per recipe).
Restored Goals (top-right) and P&L/ROI/CAGR (bottom-right with StartCap & ReqCap).
Minor UI clarifications; trading logic unchanged.
Disclaimer
This script is for research and education. It is not financial advice and makes no performance promises. Backtests are hypothetical and subject to substantial limitations. Markets involve risk; you can lose capital. Test on paper first and deploy at your own discretion. Licensed under the Mozilla Public License 2.0.
Moons Pullback Detector# Moons Pullback Detector
## Overview
**Moons Pullback Detector** is a sophisticated technical analysis indicator designed to identify high-probability pullback opportunities within established bullish trends. By combining moving averages, Bollinger Bands, and multiple timeframe analysis, this indicator helps traders spot optimal entry points when price retraces in strong uptrends.
## How It Works
### Bullish Trend Detection
The indicator identifies a bullish trend when:
- Price closes above the upper Bollinger Band (1 standard deviation)
- Price is trading above the 50 EMA
- This establishes the foundation for monitoring pullback opportunities
### Pullback Identification
Once in a bullish trend, the indicator tracks:
- **Swing Highs**: Continuously monitors and updates the highest point in the trend
- **Pullback Start**: Detects the first red candle after establishing new highs
- **Pullback Duration**: Monitors pullback length (configurable number of bars)
- **Pullback Depth**: Ensures pullbacks don't violate a key moving average (optional)
### Multi-Layer Filtering System
The indicator employs several optional filters to ensure signal quality:
**Volume Filter**: Requires minimum daily volume (default 500,000) to ensure sufficient liquidity
**Pullback MA Filter**: Monitors that pullbacks don't close below the desired EMA (default 10), maintaining trend strength
**Validation Filter**: Checks higher timeframe (30-minute default) moving average for trend confirmation
**Context Filter**: Analyzes even higher timeframe (4-hour default) for broader market context
### Alert System
The indicator generates alerts when:
- All filtering conditions are met
- Price crosses back above the alert line (swing high minus ATR offset)
- This signals potential continuation of the bullish trend
## Key Features
### Visual Elements
- **Bollinger Bands**: Optional display of 1 and 2 standard deviation bands
- **Moving Averages**: 20 EMA (basis), 50 EMA, and 10 EMA (pullback filter)
- **Trend High Line**: Yellow line showing current swing high during pullbacks
- **Alert Line**: Entry signal line positioned below swing high
- **Background Highlighting**: Gray for normal pullbacks, red tint when depth violated
- **Labels**: Price labels at swing highs and depth violation warnings
### Information Table
Comprehensive status table showing:
- Current trend state
- Pullback status
- Position relative to key EMAs and Bollinger Bands
- Volume, validation, and context filter status
- Pullback depth compliance
## Configuration Options
### Bollinger Bands Settings
- MA type selection (EMA or SMA)
- Configurable period (5-100, default 20)
### Display Options
- Toggle Bollinger Bands visibility
- Toggle moving averages display
- Toggle information table
### Alert Configuration
- Adjustable ATR offset for alert line positioning
### Filter Settings
- Volume threshold control
- Pullback duration limits (min/max bars)
- Pullback MA filter with configurable EMA length
- Multiple timeframe validation and context filters
## Best Use Cases
- **Swing Trading**: Identify high-probability entries during trend pullbacks
- **Trend Following**: Stay aligned with strong bullish momentum
- **Risk Management**: Multiple filters help avoid false signals
- **Multi-Timeframe Analysis**: Ensures broader market context alignment
## Trading Applications
This indicator works best when:
- Markets are in clear uptrends
- Sufficient volume is present
- Multiple timeframes align bullishly
- Used in conjunction with proper risk management
The Moons Pullback Detector provides traders with a systematic approach to identifying and capitalizing on pullback opportunities in strong bullish trends, combining technical rigor with practical usability.
---
*Note: This indicator is for educational purposes. Past performance does not guarantee future results. Always use proper risk management and consider multiple factors when making trading decisions.*
Artharjan NSE Sectors Relative Strength DashboardArtharjan NSE Sectors Relative Strength Dashboard
This script provides a comprehensive dashboard for analyzing the relative strength of NSE sectors compared to a benchmark index (default: NIFTY). It is designed to give traders and investors a consolidated snapshot of sector performance, momentum, and short-term trend strength — all in one visual table.
Core Purpose
The goal is to simplify sector rotation analysis by combining relative strength, rate of change, momentum, and trend classification into a sortable, color-coded dashboard. Instead of scanning multiple charts, users can rely on this single panel for quick decision-making.
Key Features
Benchmark Comparison
Every sector is measured against the benchmark index (default: NIFTY). This allows users to spot outperforming or underperforming sectors relative to the market.
Multiple Performance Metrics
LTP % Change: Last traded price percentage change from the prior close.
RS Score: Relative strength score over a user-defined lookback.
Momentum (ROC Difference): Convergence/divergence between two ROC values for added confirmation.
ROC1 / ROC2: Short- and medium-term rate-of-change measures.
Trend Classification Engine
Each sector is tagged as Ultra Bullish, Bullish Breakout, Strong/Moderate Bullish, Neutral, Moderate/Strong Bearish, Bearish Breakdown, or Ultra Bearish. This classification is based on sectoral price behavior and candlestick relationships.
Sorting & Customization
Users can sort the dashboard by any metric (e.g., RS Score, % Change, Momentum), in ascending or descending order, to highlight what matters most for their strategy.
Table Presentation
Adjustable text size, thickness, and positioning on the chart.
Optional color-coded cells for visual cues — green shades for strength, red shades for weakness, neutral shades for sideways trends.
“Last Updated” timestamp for clarity on when the snapshot was generated.
How It Helps
This tool reduces the noise of flipping through individual sector charts. Traders can identify sector leadership, monitor momentum shifts, and catch early signs of rotation without leaving a single chart window. It acts as both a macro lens (sector overview) and a micro tool (spotting exact strength/weakness transitions).
Closing Note
This dashboard was built with a simple goal: to bring clarity to complex sectoral movements. Use it as a guiding compass while respecting your broader trading or investing framework.
With Thanks,
Rrahul Desai
@Artharjan
Artharjan Heiken Ashi Super TrendArtharjan Heiken Ashi SuperTrend (AHAST)
The Artharjan Heiken Ashi SuperTrend (AHAST) indicator is a refined version of the classic SuperTrend tool, designed for traders who wish to blend trend-following logic with the smoothing effects of Heiken Ashi candles. This script not only highlights market trends but also introduces multi-timeframe filtering, visual cues, and alerts for sharper decision-making.
🔑 Key Features
Heiken Ashi Integration
Option to calculate trends using standard candles or Heiken Ashi candles.
Provides smoother visualization, reducing noise.
Flexible ATR Calculation
Choose between RMA (default) and SMA for ATR computation.
Option to switch between traditional ATR and Heiken Ashi-based ATR.
Customizable Inputs
ATR length, multiplier factor, trend colors, and higher-timeframe filters are all user-configurable.
Debug mode available for internal verification.
Visual Enhancements
Dynamic background highlighting to clearly distinguish bullish vs bearish phases.
Fill plots that emphasize ongoing trends.
Buy and Sell signal markers with optional on/off toggle.
Multi-Timeframe (MTF) Filter
Fetches higher timeframe (e.g., Weekly) Heiken Ashi values.
Detects bullish and bearish flips on higher timeframe trends.
Overlay highlights to align lower timeframe trades with broader market direction.
Alerts & Automation
Alerts available for:
Buy / Sell triggers
Direction changes
Higher timeframe bullish or bearish flips
Compatible with TradingView alerts for automated workflows.
⚙️ How It Works
Core Trend Logic
The script calculates the median price of Heiken Ashi highs and lows.
SuperTrend bands (up and dn) are adjusted using ATR.
A bullish or bearish state is determined based on price closing above or below these bands.
Signal Generation
Buy Signal: Trend flips from bearish (-1) to bullish (+1).
Sell Signal: Trend flips from bullish (+1) to bearish (-1).
Signals can be plotted as circles, labels, or both depending on configuration.
MTF SuperTrend
Parallel SuperTrend calculation on a higher timeframe (user-selected).
Detects bullish flip (HTF ↑) or bearish flip (HTF ↓).
Highlights the chart background with higher timeframe color filters when enabled.
Debug Mode
Turns on background shading to indicate whether Heiken Ashi or regular candles are in use.
Helps verify internal logic for advanced users.
🎨 Visualization Example
Green Highlight / Fill → Active bullish trend
Red Highlight / Fill → Active bearish trend
Light Blue / Gray Highlights → Higher timeframe bullish / bearish alignment
Buy / Sell Labels → Clear entry or exit cues, aligned with the trend
🚨 Practical Usage
Swing Traders: Use higher timeframe filters (e.g., Weekly) to align intraday signals with broader market direction.
Intraday Traders: Focus on Heiken Ashi smoothing to avoid whipsaws in volatile sessions.
Options Traders: Combine bullish/bearish flips with option strategies (e.g., Calls/Puts) to gain directional exposure.
✅ Final Thoughts
The Artharjan Heiken Ashi SuperTrend (AHAST) is not just another SuperTrend indicator—it’s a versatile trading companion. By merging classic ATR-based logic with Heiken Ashi smoothing and multi-timeframe confirmation, this tool equips traders with early signals, trend clarity, and strong alignment across timeframes.
Use it with discipline, combine it with your trading framework, and let it sharpen your edge in the markets.
With Thanks,
Rrahul Desai
@Artharjan
Artharjan Intraday Trading ZonesArtharjan Intraday Trading Zones (AITZ)
Overview
The AITZ indicator is designed to visually mark intraday trading zones on a chart by using the current day’s High (DH) and Low (DL) as reference points. It creates three distinct market zones:
Bullish Zone: Near the daily high, suggesting strength.
Bearish Zone: Near the daily low, suggesting weakness.
Neutral / No-Trade Zone: Between the bullish and bearish thresholds, where price movement is less directional.
These zones are highlighted with color-fills for quick visual identification, and the indicator automatically resets at the start of each new trading day.
Key Features
Daily Reference Levels: Automatically fetches Day High, Day Low, and uses them to calculate intraday zones.
Configurable Zone Depth: Traders can set the percentage distance from High/Low to define bullish and bearish zones.
Conditional Zone Coloring: Option to highlight zones only when price is actively trading inside them.
Dynamic Updates: Zone coloring adjusts in real time as the day progresses.
Customizable Appearance: Line thickness and zone colors can be adjusted to match chart preferences.
Inputs
Parameter Type Default Description
Level Thickness Integer 1 Thickness of all plotted levels (1–10).
(DH-DL)% below Day High Float 25 Distance from daily high (as % of DH–DL range) to define bullish threshold.
(DH-DL)% above Day Low Float 25 Distance from daily low (as % of DH–DL range) to define bearish threshold.
Plot Zone Colors (Conditional)? Boolean true If enabled, zones are colored only when price trades inside them. Otherwise, they remain visible regardless of price position.
Bullish Zone Color Color Teal (90% transparent) Fill color for bullish zone.
Neutral Zone Color Color Blue (90% transparent) Fill color for neutral/no-trade zone.
Bearish Zone Color Color Maroon (90% transparent) Fill color for bearish zone.
Core Calculations
Zones:
Bullish Zone = between DH and LTL
Bearish Zone = between DL and STL
Neutral Zone = between LTL and STL
Reset Behavior: At the start of each new daily session, old lines are deleted and fresh ones are drawn.
Usage Example
A trader sets:
(DH–DL)% below High = 20%
(DH–DL)% above Low = 20%
If today’s DH = 1000 and DL = 900 (Range = 100):
Bullish threshold = 1000 – (100 × 20%) = 980
Bearish threshold = 900 + (100 × 20%) = 920
Zones:
Bullish Zone: 980 → 1000
Neutral Zone: 920 → 980
Bearish Zone: 900 → 920
This creates clear trade zones for scalpers or intraday directional traders.
Practical Application
Trend Confirmation: If price sustains in the bullish zone, bias stays long.
Weakness Detection: Price falling into the bearish zone signals short opportunities.
Neutral Play: Avoid trades or expect sideways action inside the neutral zone.
Limitations
Works on instruments with clear daily highs/lows (equities, futures, FX).
May repaint levels intraday until the daily high/low is confirmed.
Zones depend on daily volatility—very narrow ranges may cause zones to overlap.
Cloud Craft SR [Volume Enhanced Edition]Cloud Craft SR - Advanced Support & Resistance System
Short Description:
Advanced cloud-based support & resistance indicator with volume analysis. Features dynamic zones, multi-timeframe analysis, and adaptive visual themes for different chart backgrounds.
Full Description:
Cloud Craft SR is an advanced support and resistance detection system that combines price action analysis with volume dynamics to identify high-probability trading zones.
🎯 Key Features:
Smart Zone Detection: Automatically identifies and ranks support/resistance zones based on historical price action
Volume Integration: Enhanced zone strength calculation using volume-weighted analysis
Multi-Timeframe Analysis: Configurable timeframe selection for deeper market structure analysis
Adaptive Visual Themes: Three color schemes optimized for white, black, and gray chart backgrounds
Dynamic Cloud Visualization: Visual representation of zone strength through opacity and border width
Real-Time Information Panel: Live zone data with volume rankings and strength metrics
Breakout Detection: Volume-confirmed breakout signals for enhanced reliability
📊 How Power & Volume Are Calculated:
Power Calculation:
Power represents the strength of each support/resistance zone based on:
Pivot Points: Number of price reversals at the zone (each pivot = 20 base points)
Touch Count: How many times price has tested the zone
Volume Weight: If volume analysis is enabled, zones with higher volume get multiplied strength
Example:
Zone has 3 pivot points = 60 base points
Price touched the zone 5 times = +5 points
Total base strength = 65
If volume at this zone is 1.5x average = 65 × 1.5 = 97.5 Power
Display Power = 97.5 ÷ 10 = 9.8 (shown as 10 in panel)
Volume Integration:
Collects volume data at each pivot point
Compares zone volume to average volume
Applies multiplier (default 1.5x) to strengthen high-volume zones
Volume Rank shows relative volume importance (⭐ to ⭐⭐⭐⭐⭐)
Visual Representation:
Higher Power = Thicker borders
Higher Volume = Less transparency (more solid appearance)
Top zones are displayed with strongest at top of panel
⚙️ Customization Options:
Cloud Timeframe (3min to Monthly)
Analysis Depth (100-500 bars)
Zone Sensitivity Control (2-12%)
Strength Filter Settings (min touches required)
Visual Style Selection
Volume Analysis Toggle
Panel Position & Theme
📈 How It Works:
The indicator analyzes historical price pivots to identify areas where price has repeatedly found support or resistance. These zones are then weighted by volume activity to determine their relative strength. Stronger zones appear more prominent visually, helping traders quickly identify key levels.
💡 Best Use Cases:
Identifying key support/resistance levels for entry/exit points
Confirming breakouts with volume analysis
Setting stop-loss and take-profit levels
Multi-timeframe confluence analysis
Risk management and position sizing
Default Settings Optimized For: 4H timeframe analysis with 250-bar lookback period
Why Protected Source?
This indicator uses proprietary algorithms for:
- Advanced pivot detection with volume weighting
- Dynamic zone strength calculation combining multiple factors
- Adaptive visual rendering based on volume and strength metrics
NY Anchored VWAP and Auto SMANY Anchored VWAP and Auto SMA
This script is a versatile trading indicator for the TradingView platform that combines two powerful components: a New York-anchored Volume-Weighted Average Price (VWAP) and a dynamic Simple Moving Average (SMA). Designed for traders who utilize VWAP for intraday trend analysis, this tool provides a clear visual representation of average price and volatility-adjusted moving averages, generating automated alerts for key crossover signals.
Indicator Components
1. NY Anchored VWAP
The VWAP is a crucial tool that represents the average price of a security adjusted for volume. This version is "anchored" to the start of the New York trading session, resetting at the beginning of each new session. This provides a clean, session-specific anchor point to gauge market sentiment and trend. The VWAP line changes color to reflect its slope:
Green: When the VWAP is trending upwards, indicating a bullish bias.
Red: When the VWAP is trending downwards, indicating a bearish bias.
2. Auto SMA
The Auto SMA is a moving average with a unique twist: its lookback period is not fixed. Instead, it dynamically adjusts based on market volatility. The script measures volatility using the Average True Range (ATR) and a Z-Score calculation.
When volatility is expanding, the SMA's length shortens, making it more sensitive to recent price changes.
When volatility is contracting, the SMA's length lengthens, smoothing out the price action to filter out noise.
This adaptive approach allows the SMA to react appropriately to different market conditions.
Suggested Trading Strategy
This indicator is particularly effective when used on a one-minute chart for identifying high-probability trade entries. The core of the strategy is to trade the crossover between the VWAP and the Auto SMA, with confirmation from a candle close.
The strategy works best when the entry signal aligns with the overall bias of the higher timeframe market structure. For example, if the daily or 4-hour chart is in an uptrend, you would look for bullish signals on the one-minute chart.
Bullish Entry Signal: A potential entry is signaled when the VWAP crosses above the Auto SMA, and is confirmed when the one-minute candle closes above both the VWAP and the SMA. This indicates a potential continuation of the bullish momentum.
Bearish Entry Signal: A potential entry is signaled when the VWAP crosses below the Auto SMA, and is confirmed when the one-minute candle closes below both the VWAP and the SMA. This indicates a potential continuation of the bearish momentum.
The built-in alerts for these crossovers allow you to receive notifications without having to constantly monitor the charts, ensuring you don't miss a potential setup.
Price Grid (Base/Step/Levels)Price Grid (Base/Step/Levels) is a simple yet powerful tool for visual traders. It automatically draws a customizable grid of horizontal price levels on your chart.
You choose a base price, a grid step size, and the number of levels to display above and below. The indicator then plots evenly spaced lines around the base, helping you:
Spot round-number zones and psychological levels
Plan entries, exits, and stop-loss placements
Visualize support/resistance clusters
Build grid or ladder trading strategies
The base line is highlighted so you always know your anchor level, while the other levels are styled separately for clarity.
⚙️ Inputs
Base price → anchor level (set 0 to use current close price)
Grid step → distance between levels
Number of levels → lines drawn above & below base
Line style / width / colors → full customization
✅ Notes
Works on any market and timeframe
Automatically respects the symbol’s minimum tick size
Lightweight & non-repainting
Zigzag Market Type OscillatorZigzag Market Type Oscillator
This indicator is a powerful tool for analyzing market conditions by categorizing price action into one of four states: Up-Trending, Down-Trending, Consolidating, or Ranging. It uses a Zigzag pattern to identify swings and then calculates the average size of upward and downward price movements to determine the prevailing market type.
How It Works:
Swing Detection: The script first uses a Zigzag algorithm (based on the Zigzag Depth input) to find significant highs and lows in the market. These swings are considered the "legs" of price movement.
Average Leg Size: It keeps track of the percentage change of the most recent upward and downward legs. The Number of Legs for Average setting controls how many past legs are used to calculate the average size of up-moves and down-moves.
Disparity Calculation: The core of the indicator is the Disparity value, which measures the difference between the average size of up-legs and down-legs.
- A positive disparity means up-legs are, on average, larger than down-legs.
- A negative disparity means down-legs are, on average, larger than up-legs.
- A disparity near zero means up-legs and down-legs are roughly the same size.
Market Type Classification: The indicator then uses the Disparity and Average Size values to color-code the oscillator, providing a clear visual signal of the market type:
Green (Up-Trending): The disparity is positive and above your Disparity Threshold. This suggests a strong upward trend where buyers are consistently making larger moves than sellers.
Red (Down-Trending): The disparity is negative and below your -Disparity Threshold. This suggests a strong downward trend where sellers are consistently making larger moves than buyers.
Blue (Ranging): The disparity is close to zero (within your Disparity Threshold), and the overall Average Size of the swings is small (below your Size Threshold). This indicates a tight, choppy, and indecisive market with no clear direction.
Silver (Consolidating or drifting in direction of most recent trend) : The disparity is close to zero, but the overall Average Size of the swings is large. This suggests a sideways market with wide swings, also known as a trading range.
How to Use It:
Trend Confirmation: Use the Green and Red signals to confirm the direction and strength of a trend. A sustained green plot suggests a good environment for long positions, while a sustained red plot favors short positions.
Identify Non-Trending Conditions: Use the Blue and Silver plots to identify when the market is not trending. During these periods, trend-following strategies may not be effective. You might look for breakout opportunities (from a blue plot) or use a range-bound trading strategy (within a silver plot).
Risk Management: The oscillator can serve as a warning sign. For example, if you are in an uptrending market (green plot) but the oscillator suddenly turns silver or blue, it may signal that the trend is losing momentum and that you should consider reducing your position or tightening your stop-loss.
Settings:
Zigzag Depth: This controls the sensitivity of the Zigzag, which in turn defines the "legs." A higher value will ignore smaller price fluctuations, focusing on larger swings. A lower value will capture more detail.
Number of Legs for Average: This determines the lookback period for the average size calculation. A higher number will create a smoother, more stable oscillator but will react more slowly to changes in market behavior.
Disparity Threshold: This is the key setting that determines the line between a trending market and a non-trending one. Adjust this to a level that you believe represents a significant difference between up and down moves.
Size Threshold (%): This separates Ranging (small swings) from Consolidating (large swings). Adjust this to define what you consider a "small" vs. a "large" price swing for the asset you are trading.
AlphaADX Trend Meter - Enhanced ADX VisualizationTechnical Overview
This indicator enhances the traditional Average Directional Index (ADX) with advanced visualization techniques and adaptive threshold management. It demonstrates several Pine Script programming concepts including dynamic color gradients, conditional plotting, and real-time information display systems.
Mathematical Methodology
Core ADX Calculation
Uses standard DMI (Directional Movement Index) calculation: ta.dmi(diLength, adxSmoothing)
Applies configurable smoothing to reduce noise while preserving trend signals
Maintains mathematical integrity of Welles Wilder's original ADX formula
Dynamic Color System
Gradient Implementation:
pinecolor.from_gradient(adxValue, minThreshold, maxThreshold, startColor, endColor)
Color Logic:
Strong trends (ADX > 25): Bright colors (green for bullish, red for bearish)
Weak trends (15 < ADX ≤ 25): Muted colors with transparency
Choppy markets (ADX ≤ 15): Gray coloring to indicate low directional movement
Gradient mode creates smooth color transitions based on ADX intensity
Adaptive Threshold Framework
While maintaining standard ADX interpretation levels, the indicator allows customization of:
Strong trend threshold (default: 25)
Weak trend threshold (default: 20)
Chop zone threshold (default: 15)
This flexibility accommodates different market conditions and trading styles.
Technical Features
1. Multi-Layer Visualization
Primary ADX Line: Color-coded based on strength and direction
Histogram Display: Shows ADX momentum with transparency effects
Trend Meter Bar: Simplified visual reference at bottom of chart
Background Zones: Subtle shading for strong trends and chop zones
2. Signal Generation
Automatic Detection:
Strong trend emergence (ADX crosses above strong threshold)
Chop zone entry warnings (ADX falls below chop threshold)
Trend direction changes in strong trending markets
Visual Markers:
Triangle arrows for strong trend signals
Cross markers for chop zone warnings
Color-coded based on bullish/bearish bias
3. Information Dashboard
Real-time table displaying:
Current ADX value with dynamic background coloring
Trend status classification (Strong/Weak/Neutral/Choppy)
Directional bias (Bullish ↑/Bearish ↓)
DI+ and DI- values for detailed analysis
4. Alert System
Programmatic alerts for:
Strong trend emergence
Entry into consolidation zones
Trend reversals during strong directional moves
Breakouts from choppy conditions
Programming Techniques Demonstrated
Advanced Pine Script Concepts:
Dynamic Color Functions: Custom color selection based on multiple conditions
Conditional Plotting: Different visual elements based on user preferences
Table Implementation: Real-time information display with formatting
Alert Integration: Multiple condition monitoring system
Input Validation: Parameter bounds and logical constraints
Visual Enhancement Methods:
Gradient color transitions for smooth visual feedback
Transparency effects to reduce visual clutter
Multi-component display system for comprehensive analysis
Customizable visual elements for user preference accommodation
Educational Value
This indicator serves as a learning tool for:
Enhanced ADX Implementation: Shows how to extend built-in indicators with additional functionality
Visual Design Principles: Demonstrates effective use of colors, transparency, and layout
User Interface Development: Table creation and information display techniques
Alert System Design: Comprehensive condition monitoring and notification
Configuration Options
ADX Parameters:
ADX Length: Period for directional movement calculation
DI Length: Directional indicator smoothing period
ADX Smoothing: Additional smoothing for noise reduction
Threshold Levels:
Strong Trend Level: Threshold for identifying strong directional movement
Weak Trend Level: Moderate trend identification threshold
Chop Zone Level: Low directional movement threshold
Visual Controls:
Trend Meter: Toggle bottom reference bar
Histogram: Show/hide ADX momentum bars
Signal Arrows: Enable/disable trend change markers
Info Table: Display/hide real-time information panel
Gradient Mode: Switch between smooth gradients and solid colors
Use Cases and Applications
Market Analysis:
Trend Identification: Determine current market directional strength
Regime Classification: Distinguish between trending and ranging markets
Timing Analysis: Identify optimal periods for trend-following strategies
Risk Management:
Environment Assessment: Avoid trading during low-ADX choppy periods
Position Sizing: Adjust trade size based on trend strength
Strategy Selection: Choose appropriate techniques based on market regime
Educational Purposes:
ADX Understanding: Visual representation of directional movement concepts
Pine Script Learning: Example of advanced indicator development techniques
Market Behavior: Observation of trend strength patterns across different timeframes
Limitations and Considerations
Technical Limitations:
ADX is a lagging indicator that confirms existing trends rather than predicting them
Requires sufficient price movement data for meaningful calculations
May generate false signals in very low volatility environments
Threshold levels may need adjustment for different asset classes
Usage Guidelines:
Most effective when combined with other forms of technical analysis
Consider market context and fundamental factors
Use appropriate timeframes for intended trading approach
Regular parameter review for optimal performance
Performance Notes:
Calculations optimized for real-time analysis
Visual elements designed to minimize chart clutter
Alert system prevents excessive notifications through condition filtering
Disclaimer
This indicator is designed for educational and analytical purposes. It demonstrates enhanced visualization of the ADX indicator and various Pine Script programming techniques. Users should understand that past performance does not guarantee future results and should always employ proper risk management practices. The indicator should be used as part of a comprehensive trading approach rather than as a standalone decision-making tool.
AlphaRSI Pro - Adaptive RSI with Trend AnalysisOverview
AlphaRSI Pro is a technical analysis indicator that enhances the traditional RSI by incorporating adaptive overbought/oversold levels, trend bias analysis, and divergence detection. This indicator addresses common limitations of standard RSI implementations through mathematical adaptations to market volatility.
Technical Methodology
1. Smoothed RSI Calculation
Applies weighted moving average smoothing to standard RSI(14)
Reduces noise while preserving momentum signals
Configurable smoothing period (default: 3)
2. Adaptive Level System
Mathematical Approach:
Calculates ATR-based volatility ratio: volatility_ratio = current_ATR / average_ATR
Applies dynamic adjustment: adaptive_level = base_level ± (volatility_ratio - 1) × 20
Bounds levels between practical ranges (15-35 for oversold, 65-85 for overbought)
Purpose: Adjusts RSI sensitivity based on current market volatility conditions rather than using fixed 70/30 levels.
3. Trend Bias Integration
Uses Simple Moving Average slope analysis over configurable period
Calculates trend strength: |slope / price| × 100
Provides visual background shading for trend context
Filters RSI signals based on underlying price trend direction
4. Signal Generation Logic
Entry Conditions:
Bullish: RSI crosses above adaptive oversold level
Bearish: RSI crosses below adaptive overbought level
Strong signals: Include trend bias confirmation
Enhancement over standard RSI: Reduces false signals in choppy markets by requiring trend alignment for "strong" signals.
5. Divergence Detection
Automated identification of regular bullish/bearish divergences
Uses 5-bar lookback for pivot detection
Compares price highs/lows with corresponding RSI highs/lows
Plots divergence markers when conditions are met
Key Features
Real-time adaptive levels based on volatility
Trend-filtered signals to improve reliability
Built-in divergence scanner
Information dashboard showing current values
Comprehensive alert system
Clean visual presentation with customizable colors
Usage Guidelines
This indicator works best when:
Combined with proper risk management
Used in conjunction with other technical analysis
Applied to liquid markets with sufficient volatility data
Configured appropriately for the selected timeframe
Input Parameters
RSI Period: Standard RSI calculation length (default: 14)
Smoothing Period: WMA smoothing for noise reduction (default: 3)
Volatility Lookback: Period for ATR volatility calculation (default: 50)
Base OB/OS Levels: Starting points for adaptive adjustment (70/30)
Trend Period: Moving average length for trend bias (default: 21)
Alert Conditions
Bullish Signal: RSI crosses above adaptive oversold
Bearish Signal: RSI crosses below adaptive overbought
Strong Bullish/Bearish: Signals with trend confirmation
Divergence Alerts: Automated divergence detection
Educational Value
This indicator demonstrates several advanced Pine Script concepts:
Dynamic level calculation using mathematical formulas
Multi-timeframe analysis integration
Conditional signal filtering based on market state
Table display for real-time information
Comprehensive alert system implementation
Limitations
Requires sufficient historical data for volatility calculations
May generate fewer signals in very low volatility environments
Trend bias effectiveness depends on selected MA period
Divergences may not always lead to immediate reversals
Disclaimer
This indicator is for educational and analysis purposes. Past performance does not guarantee future results. Always use proper risk management and consider multiple forms of analysis before making trading decisions.
Opening Range Legstart FinderThis multi-faceted indicator uses 4 key time-based price levels to help traders identify when price is likely to revert or reverse. These key times are:
18:00 (Globex open)
00:00 (Midnight open)
9:30 (RTH open)
9:45 (End of first 15 minutes of RTH)
The key concept here is that price is likely to revert back into the current daily range if it is below all 4 of the time-based prices or above all of the time-based prices. When price is between those levels it will often chop around and be harder to navigate.
The first component of this indicator provides traders with a snapshot of price relative to those 4 levels across up to 6 different tradable instruments, indicating which direction price is expected to move for each of those instruments. This way, the trader can see which instruments are expected to potentially reverse and which ones are more likely to chop.
The second component are configurable price windows where the indicator will anticipate reversals in price. By default, the indicator is focused on price reversals that happen at the end or beginning of an hourly candle. As such, the default time windows are the last 15 minutes of one hour and the first 15 minutes of the next (ie. 9:45 to 10:15). The number of hours used is configurable by the user. We are looking to trade OHLC and OLHC of an hourly candle within these windows during which price is expected to reverse or have impulsive moves.
The third component is a structure shift detection mechanism. This mechanism is based on relative pivot strength of recent price action. New legs in price action form by breaking above or below the pivots based on recent price action. By default, the pivots are based on the current timeframe but can be adjusted to watch for price breaks above any timeframe larger than the current chart.
The fourth component of the indicator will is a mechanism to provide targets based on these new price legs. By default, in bullish scenarios, these targets will only be displayed if price is 'below all' of the price levels described above and we form a new price leg up during the specified time windows where we anticipate a reversal. Alternatively, in bearish scenarios, these targets will only be displayed if price is 'above all' of the price levels described above and we form a new price leg down during the specified time windows where we anticipate a reversal.
This default configuration can be changed to show targets regardless of relationship to the price levels above and/or to disregard the time windows configured above.
In all scenarios, targets are based on widely used fibonacci extensions on price leg patterns (ie. 2-2.5 and 4 standard deviations up from a move down).
Finally there is a volatility filter built-in to the indicator to prevent traders from trying to 'catch the falling knife' when price action is strongly moving in one direction and is likely to continue to do so. This filter is a custom implementation of the Ehlers Super PassBand Filter to accommodate for timeframes less than 1 minute.
This indicator is intended to be used on lower timeframes (15 seconds to 2 minutes) as the goal is to catch large reversals with minimal stops. When aligned with higher timeframe trends, the results can be impressive.
Planetary Speed - CEPlanetary Speed - Community Edition
Welcome to the Planetary Speed - Community Edition , a specialized tool designed to enhance W.D. Gann-inspired trading by plotting the speed of selected planets. This indicator measures changes in planetary ecliptic longitudes, which may correlate with market timing and volatility, making it ideal for traders analyzing equities, forex, commodities, and cryptocurrencies.
Overview
The Planetary Speed - Community Edition calculates the speed of a chosen planet (Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto) by comparing its ecliptic longitude across time. Supporting heliocentric and geocentric modes, the script plots speed data with high precision across various chart timeframes, particularly for markets open 24/7 like cryptocurrencies. Traders can customize line colors and add multiple instances for multi-planet analysis, aligning with Gann’s belief that planetary cycles influence market trends.
Key Features
Plots the speed of eight planets (Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto) based on ecliptic longitude changes
Supports heliocentric and geocentric modes for flexible analysis
Customizes line colors for clear visualization of planetary speed data
Projects future speed data up to 250 days with daily resolution
Works across default TradingView timeframes (except monthly) for continuous markets
Enables multiple script instances for tracking different planets on the same chart
How to Use
Access the script’s settings to configure preferences
Choose a planet from Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto
Select heliocentric or geocentric mode for calculations
Customize the line color for speed data visualization
Review plotted speed data to identify potential market timing or volatility shifts
Add multiple instances to track different planets simultaneously
Get Started
The Planetary Speed - Community Edition provides full functionality for astrological market analysis. Designed to highlight Gann’s planetary cycles, this tool empowers traders to explore celestial influences. Trade wisely and harness the power of planetary speed!
Planetary Signs - CEPlanetary Signs - Community Edition
Welcome to the Planetary Signs - Community Edition , a specialized tool designed to enhance W.D. Gann-inspired trading by highlighting zodiac sign transitions for selected planets. This indicator marks when planets enter specific zodiac signs, which may correlate with market turning points, making it ideal for traders analyzing equities, forex, commodities, and cryptocurrencies.
Overview
The Planetary Signs - Community Edition calculates the ecliptic longitude of a chosen planet (Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto) and highlights periods when it enters user-selected zodiac signs (Aries, Taurus, Gemini, etc.). Supporting heliocentric and geocentric modes, the script plots sign transitions with minute-level accuracy, syncing perfectly with chart timeframes. Traders can customize colors for each sign and add multiple instances for multi-planet analysis, aligning with Gann’s belief that zodiac transitions influence market trends.
Key Features
Highlights zodiac sign transitions for ten celestial bodies (Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto)
Supports heliocentric and geocentric modes (Pluto heliocentric-only; Sun and Moon geocentric)
Allows selection of one or multiple zodiac signs with customizable highlight colors
Plots vertical lines and labels (e.g., “☿ 0 ♈ Aries”) at sign transitions with minute-level accuracy
Projects future sign transitions up to 120 days with daily resolution
Enables multiple script instances for tracking different planets or signs on the same chart
How to Use
Access the script’s settings to configure preferences
Choose a planet from the Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto
Select one or more zodiac signs (e.g., Aries, Taurus) to highlight
Customize the highlight color for each selected zodiac sign
Select heliocentric or geocentric mode for calculations
Review highlighted periods and labeled lines to identify zodiac sign transitions
Use transitions to anticipate potential market turning points, integrating Gann’s astrological principles
Get Started
The Planetary Signs - Community Edition provides full functionality for astrological market analysis. Designed to highlight Gann’s zodiac cycles, this tool empowers traders to explore celestial transitions. Trade wisely and harness the power of planetary alignments!
MTF MidpointsOverview :
The MTF Midpoints indicator provides comprehensive multi-timeframe analysis by displaying mid points that act as support / resistance. It also comes with the ability to view trend strength across multiple timeframes.
Key Features :
1) Multi-Timeframe Support -
- 1 Minute, 5 Minute, 15 Minute, 1 Hour, and 4 Hour timeframes.
- Each timeframe displays its calculated midpoint level.
- Toggle individual timeframes on/off as needed.
2) Dynamic Trend Calculation
- Calculates trend direction based on configurable lookback period (default: 30 bars).
- Identifies swing highs and lows to determine trend changes.
- Computes midpoint levels as the average between current swing high and low.
- Tracks price action relative to midpoint to gauge trend strength.
3) Visual Elements -
- Colored Lines : Each timeframe displays as a distinct colored line.
- Fill Areas : Main timeframe shows colored fills above and below midpoint.
- Info Table : Real-time summary of all timeframe data with trend percentages.
4) Customization Options -
- Colors : Individual color settings for each timeframe.
- Display : Adjustable line width, label sizes, and positioning.
- Labels : Toggle price display in labels, customize text color and size.
- Info Table: Configurable info table with trend strength indicators.
How It Works :-
The indicator uses a proprietary algorithm that:
1. Monitors price action over a specified lookback period.
2. Identifies trend direction changes based on new highs/lows.
3. Calculates dynamic support/resistance levels (midpoints).
4. Tracks closes above/below midpoint to determine trend bias.
5. Displays trend strength as a percentage in both table and candle colors.
Trading Applications :-
- Confluence Analysis : Identify where multiple timeframe midpoints align.
- Support/Resistance : Use midpoints as dynamic S/R levels.
- Trend Assessment : Gauge trend strength across different timeframes.
- Entry/Exit Points : Look for price reactions at key midpoint levels.
- Risk Management : Use midpoints to set stop losses and profit targets.
Disclaimer :
This indicator is for educational and analysis purposes. It does not constitute financial advice. Always conduct your own research and consider your risk tolerance before making trading decisions. Past performance does not guarantee future results.
Elliott Wave Rule EngineWhat this tool does
The indicator scans price for two concurrent swing structures—a Small (shorter-degree) and a Large (higher-degree) set—then applies an Elliott/NeoWave rule engine to the most recent 5-swing motive (1-2-3-4-5) or 3-swing corrective (A-B-C). It produces:
Blue lines for Small swings and Orange lines for Large swings.
A rule dashboard (optional) showing PASS/FAIL/WARN for core rules & guidelines.
Buy/Sell labels when (a) a valid motive completes and (b) loop “consensus,” alignment, and scoring gates are satisfied.
Reading the chart
Small swings: thin blue segments, built from your Small settings.
Large swings: thicker orange segments, from your Large settings.
Background tint: faint green when a motive (impulse/diagonal) is valid right now on Small.
Labels (if enabled):
“1…5” or “A-B-C” markers on the latest detected structure.
Buy/Sell label at the last pivot when all gates pass; text may include a score %.
How it works
For both Small and Large degrees the script:
- Loops over all (left, right) combinations you specify (e.g., Small Left = 3..6, Right = 0..0) and calls ta.pivothigh/low.
- Aggregates the results:
- Keeps the most extreme pivot found in the loop (highest high or lowest low) that’s newer than the last accepted swing.
- Gates acceptance by minimum % change versus the last opposite swing (inside the loop) and a post-aggregation filter (Small Minimum swing %, Large Minimum swing %).
- Merges back-to-back same-type swings (HH or LL) by keeping only the more extreme one.
- Keeps only the last N=lookbackWaves swings (default 100).
- Consensus (used for signals) comes from the loop counts:
- sBuyConsensus = small L-count / total-combos (bullish bias)
- sSellConsensus = small H-count / total-combos (bearish bias)
(and the same for Large). This is a data-driven “how many combos agreed” measure.
2) Rule engine (Impulse/Diagonal vs. Corrective)
When there are at least 6 Small swings, the engine tests 1-2-3-4-5:
Hard rules (must pass for an Impulse):
- Wave-2 not > 100% of Wave-1 (no retrace beyond start of W1).
- Wave-3 not the shortest among 1,3,5.
- Wave-4 doesn’t overlap Wave-1 (if it does, structure may be a Diagonal).
- Diagonal eligibility: Rules 1 & 2 pass but Rule 3 fails ⇒ eligible as a Diagonal (
Guidelines (7 checks, count toward a threshold you set):
- W2 retraces a Fib level (within ±fibTol).
- W4 retraces a Fib level (within ±fibTol).
- W3 strongest momentum (speed = |Δprice| / bars).
- Alternation: W2 vs W4 have meaningfully different “sharpness” (price per bar), threshold altSlopeThr.
- Proportion (Price): |W1| and |W3| within propTolP× each other.
- Proportion (Time): W1W3 and W2W4 durations within propTolT×.
- W5 weaker than W3 (momentum divergence proxy).
A Motive is valid if:
- Impulse: all 3 hard rules pass and guideline passes ≥ Min guideline passes.
- Diagonal: diagonal-eligible and guideline passes ≥ Min guideline passes.
- if motive fails, the engine still evaluates ABC as Zigzag and Flat to populate the table:
- Zigzag: B shallower than ~0.618A; C ≈ A or 1.618A (±fibTol).
- Flat: B ≥ ~0.9A; expanded flat if B > 1.0A and C in *A; “running” note if C < A.
3) Signal logic (consensus-gated & scored)
Signals fire only on new Small pivots and only if a Small motive just validated:Direction comes from the motive’s W1 (up = bull, down = bear).
Consensus checks (from the loop):
Use Sell consensus if the last pivot is a High, or Buy consensus if it’s a Low.Require it ≥ Min SMALL loop consensus and ahead of the opposite side by at least Min consensus margin.If you also require Large quality: check the corresponding Large consensus ≥ Min LARGE loop consensus.
Alignment: If Require small/large directional alignment is ON, Small and Large directions must match (or the Large motive must be complete).
Score:
- If Large not required: finalScore = smallConsensus × smallQuality.
- If Large required: finalScore = smallConsensus × smallQuality × largeQuality.
- Need finalScore ≥ Min final score.
When all gates pass, you’ll see “Buy xx%” or “Sell xx%” at the pivot.
Inputs (explained):
- Smaller Wave Swing Detection (Looped)
- Small Left Min / Max (default 3..6): ta.pivot* left widths to scan.
- Small Right Min / Max (default 0..0): right widths to scan (0 = earliest confirmation).
- Small Minimum swing % (post-aggregation) (0.3%): filters out tiny swings after the loop.
- Larger Wave Swing Detection (Looped)
- Large Left Min / Max (100..200) and Right Min/Max (0..0): higher-degree scan (defaults are big; adjust for intraday).
- Large Minimum swing % (post-aggregation) (1.5%).
- Loop Filters (inside the loop)
- Small loop min % change (0.20%): a candidate pivot counts only if move vs. last opposite Small swing ≥ this.
- Large loop min % change (1.50%): same idea for Large.
Rule Engine Tolerances
- Fibonacci tolerance (±%) (0.05 = 5%): closeness to Fib levels.
-Same-degree TIME proportion max (x) (2.00×) and PRICE proportion max (x) (3.00×).
- Alternation slope ratio threshold (0.10): higher = stricter alternation.
- Min guideline passes (0–7) (5): threshold for motive validity.
- Signal Probability (Loop Consensus)
- Min SMALL loop consensus (0.60).
- Min LARGE loop consensus (0.50) (used only if Large validation matters).
- Min consensus margin vs opposite (0.10): e.g., 0.60 vs 0.45 fails (margin 0.15 passes).
Require LARGE 1–5 valid (or diagonal) for signal (off by default).
Min final score (0.20): gate on the composite score.
Annotate label with score % (on).
WARN (orange): guideline not met—pattern can still be valid if total passes ≥ Min guideline passes.
FAQ
Q: Why did I get a diagonal instead of an impulse?
A: Wave-4 overlapped Wave-1 (Rule 3). If Rules 1 & 2 pass and guidelines meet your minimum, it’s eligible as a Diagonal.
Q: Where do Buy/Sell labels come from?
A: Only after a valid Small motive at a new pivot, and only if consensus, alignment, and final score gates pass (per your settings).
Q: It “missed” a wave in hindsight.
A: Pivots require right bars to confirm; extremely tight settings can filter that swing; adjust Small min % or ranges.
Q: Are there repaints?
A: No, It uses standard pivot confirmation; until a pivot is confirmed, recent swings can evolve. After confirmation, lines/labels are stable.
Limitations & disclaimers
Elliott/NeoWave rules are heuristics; markets are messy. Treat outputs as structured context, not certainty.
Consensus is pattern-scan agreement, not probability of profit Not investment advice; always couple with risk management.
lostWorld: P1This indicator is designed to help traders identify opportunities with greater clarity. It combines to provide actionable insights.
Martingale Strategy Simulator [BackQuant]Martingale Strategy Simulator
Purpose
This indicator lets you study how a martingale-style position sizing rule interacts with a simple long or short trading signal. It computes an equity curve from bar-to-bar returns, adapts position size after losing streaks, caps exposure at a user limit, and summarizes risk with portfolio metrics. An optional Monte Carlo module projects possible future equity paths from your realized daily returns.
What a martingale is
A martingale sizing rule increases stake after losses and resets after a win. In its classical form from gambling, you double the bet after each loss so that a single win recovers all prior losses plus one unit of profit. In markets there is no fixed “even-money” payout and returns are multiplicative, so an exact recovery guarantee does not exist. The core idea is unchanged:
Lose one leg → increase next position size
Lose again → increase again
Win → reset to the base size
The expectation of your strategy still depends on the signal’s edge. Sizing does not create positive expectancy on its own. A martingale raises variance and tail risk by concentrating more capital as a losing streak develops.
What it plots
Equity – simulated portfolio equity including compounding
Buy & Hold – equity from holding the chart symbol for context
Optional helpers – last trade outcome, current streak length, current allocation fraction
Optional diagnostics – daily portfolio return, rolling drawdown, metrics table
Optional Monte Carlo probability cone – p5, p16, p50, p84, p95 aggregate bands
Model assumptions
Bar-close execution with no slippage or commissions
Shorting allowed and frictionless
No margin interest, borrow fees, or position limits
No intrabar moves or gaps within a bar (returns are close-to-close)
Sizing applies to equity fraction only and is capped by your setting
All results are hypothetical and for education only.
How the simulator applies it
1) Directional signal
You pick a simple directional rule that produces +1 for long or −1 for short each bar. Options include 100 HMA slope, RSI above or below 50, EMA or SMA crosses, CCI and other oscillators, ATR move, BB basis, and more. The stance is evaluated bar by bar. When the stance flips, the current trade ends and the next one starts.
2) Sizing after losses and wins
Position size is a fraction of equity:
Initial allocation – the starting fraction, for example 0.15 means 15 percent of equity
Increase after loss – multiply the next allocation by your factor after a losing leg, for example 2.00 to double
Reset after win – return to the initial allocation
Max allocation cap – hard ceiling to prevent runaway growth
At a high level the size after k consecutive losses is
alloc(k) = min( cap , base × factor^k ) .
In practice the simulator changes size only when a leg ends and its PnL is known.
3) Equity update
Let r_t = close_t / close_{t-1} − 1 be the symbol’s bar return, d_{t−1} ∈ {+1, −1} the prior bar stance, and a_{t−1} the prior bar allocation fraction. The simulator compounds:
eq_t = eq_{t−1} × (1 + a_{t−1} × d_{t−1} × r_t) .
This is bar-based and avoids intrabar lookahead. Costs, slippage, and borrowing costs are not modeled.
Why traders experiment with martingale sizing
Mean-reversion contexts – if the signal often snaps back after a string of losses, adding size near the tail of a move can pull the average entry closer to the turn
Behavioral or microstructure edges – some rules have modest edge but frequent small whipsaws; size escalation may shorten time-to-recovery when the edge manifests
Exploration and stress testing – studying the relationship between streaks, caps, and drawdowns is instructive even if you do not deploy martingale sizing live
Why martingale is dangerous
Martingale concentrates capital when the strategy is performing worst. The main risks are structural, not cosmetic:
Loss streaks are inevitable – even with a 55 percent win rate you should expect multi-loss runs. The probability of at least one k-loss streak in N trades rises quickly with N.
Size explodes geometrically – with factor 2.0 and base 10 percent, the sequence is 10, 20, 40, 80, 100 (capped) after five losses. Without a strict cap, required size becomes infeasible.
No fixed payout – in gambling, one win at even odds resets PnL. In markets, there is no guaranteed bounce nor fixed profit multiple. Trends can extend and gaps can skip levels.
Correlation of losses – losses cluster in trends and in volatility bursts. A martingale tends to be largest just when volatility is highest.
Margin and liquidity constraints – leverage limits, margin calls, position limits, and widening spreads can force liquidation before a mean reversion occurs.
Fat tails and regime shifts – assumptions of independent, Gaussian returns can understate tail risk. Structural breaks can keep the signal wrong for much longer than expected.
The simulator exposes these dynamics in the equity curve, Max Drawdown, VaR and CVaR, and via Monte Carlo sketches of forward uncertainty.
Interpreting losing streaks with numbers
A rough intuition: if your per-trade win probability is p and loss probability is q=1−p , the chance of a specific run of k consecutive losses is q^k . Over many trades, the chance that at least one k-loss run occurs grows with the number of opportunities. As a sanity check:
If p=0.55 , then q=0.45 . A 6-loss run has probability q^6 ≈ 0.008 on any six-trade window. Across hundreds of trades, a 6 to 8-loss run is not rare.
If your size factor is 1.5 and your base is 10 percent, after 8 losses the requested size is 10% × 1.5^8 ≈ 25.6% . With factor 2.0 it would try to be 10% × 2^8 = 256% but your cap will stop it. The equity curve will still wear the compounded drawdown from the sequence that led to the cap.
This is why the cap setting is central. It does not remove tail risk, but it prevents the sizing rule from demanding impossible positions
Note: The p and q math is illustrative. In live data the win rate and distribution can drift over time, so real streaks can be longer or shorter than the simple q^k intuition suggests..
Using the simulator productively
Parameter studies
Start with conservative settings. Increase one element at a time and watch how the equity, Max Drawdown, and CVaR respond.
Initial allocation – lower base reduces volatility and drawdowns across the board
Increase factor – set modestly above 1.0 if you want the effect at all; doubling is aggressive
Max cap – the most important brake; many users keep it between 20 and 50 percent
Signal selection
Keep sizing fixed and rotate signals to see how streak patterns differ. Trend-following signals tend to produce long wrong-way streaks in choppy ranges. Mean-reversion signals do the opposite. Martingale sizing interacts very differently with each.
Diagnostics to watch
Use the built-in metrics to quantify risk:
Max Drawdown – worst peak-to-trough equity loss
Sharpe and Sortino – volatility and downside-adjusted return
VaR 95 percent and CVaR – tail risk measures from the realized distribution
Alpha and Beta – relationship to your chosen benchmark
If you would like to check out the original performance metrics script with multiple assets with a better explanation on all metrics please see
Monte Carlo exploration
When enabled, the forecast draws many synthetic paths from your realized daily returns:
Choose a horizon and a number of runs
Review the bands: p5 to p95 for a wide risk envelope; p16 to p84 for a narrower range; p50 as the median path
Use the table to read the expected return over the horizon and the tail outcomes
Remember it is a sketch based on your recent distribution, not a predictor
Concrete examples
Example A: Modest martingale
Base 10 percent, factor 1.25, cap 40 percent, RSI>50 signal. You will see small escalations on 2 to 4 loss runs and frequent resets. The equity curve usually remains smooth unless the signal enters a prolonged wrong-way regime. Max DD may rise moderately versus fixed sizing.
Example B: Aggressive martingale
Base 15 percent, factor 2.0, cap 60 percent, EMA cross signal. The curve can look stellar during favorable regimes, then a single extended streak pushes allocation to the cap, and a few more losses drive deep drawdown. CVaR and Max DD jump sharply. This is a textbook case of high tail risk.
Strengths
Bar-by-bar, transparent computation of equity from stance and size
Explicit handling of wins, losses, streaks, and caps
Portable signal inputs so you can A–B test ideas quickly
Risk diagnostics and forward uncertainty visualization in one place
Example, Rolling Max Drawdown
Limitations and important notes
Martingale sizing can escalate drawdowns rapidly. The cap limits position size but not the possibility of extended adverse runs.
No commissions, slippage, margin interest, borrow costs, or liquidity limits are modeled.
Signals are evaluated on closes. Real execution and fills will differ.
Monte Carlo assumes independent draws from your recent return distribution. Markets often have serial correlation, fat tails, and regime changes.
All results are hypothetical. Use this as an educational tool, not a production risk engine.
Practical tips
Prefer gentle factors such as 1.1 to 1.3. Doubling is usually excessive outside of toy examples.
Keep a strict cap. Many users cap between 20 and 40 percent of equity per leg.
Stress test with different start dates and subperiods. Long flat or trending regimes are where martingale weaknesses appear.
Compare to an anti-martingale (increase after wins, cut after losses) to understand the other side of the trade-off.
If you deploy sizing live, add external guardrails such as a daily loss cut, volatility filters, and a global max drawdown stop.
Settings recap
Backtest start date and initial capital
Initial allocation, increase-after-loss factor, max allocation cap
Signal source selector
Trading days per year and risk-free rate
Benchmark symbol for Alpha and Beta
UI toggles for equity, buy and hold, labels, metrics, PnL, and drawdown
Monte Carlo controls for enable, runs, horizon, and result table
Final thoughts
A martingale is not a free lunch. It is a way to tilt capital allocation toward losing streaks. If the signal has a real edge and mean reversion is common, careful and capped escalation can reduce time-to-recovery. If the signal lacks edge or regimes shift, the same rule can magnify losses at the worst possible moment. This simulator makes those trade-offs visible so you can calibrate parameters, understand tail risk, and decide whether the approach belongs anywhere in your research workflow.
XAU 0/5 GridThis indicator draws horizontal price grids for XAUUSD. It anchors the grid to a base price that ends with 0 or 5, then plots equally spaced levels every 5 price units above and below that base. It’s a clean way to eyeball fixed-interval structure for rough support/resistance zones and simple TP/SL planning.
How it works
Base (0/5):
base = floor(close / 5) × 5 → forces the base to always end with 0/5.
Grid levels:
level_i = base + i × 5, where i is any integer (positive/negative).
The script updates positions only when the base changes to avoid flicker and reduce chart load.
It uses a persistent line array to manage the line objects efficiently.
Usage
Add the indicator to an XAUUSD chart on any timeframe.
Configure in the panel:
Show Lines – toggle visibility
Lines each side – number of lines above/below the base
Line Color / Line Width – appearance
Use the grid as fixed reference levels (e.g., 3490, 3495, 3500, 3505, …) for planning TP/SL or observing grid breaks.
Highlights
Strict 0/5 anchoring keeps levels evenly spaced and easy to read on gold.
Auto-reanchors when price moves to a new 0/5 zone, maintaining a steady view.
Lightweight design: lines are created once and then updated, minimizing overhead.
Limitations
Visualization only — not a buy/sell signal.
Spacing is fixed at 5 price units, optimized for XAUUSD. If used on other symbols/brokers with different tick scales, adjust the logic accordingly.
Grid lines do not guarantee support/resistance; always combine with broader market context.
Trend Bars with Okuninushi Line Filter# Trend Bars with Okuninushi Line Filter: A Powerful Trading Indicator
##TrendSpider Hackathon 2025 Trend Bars with Okuninushi Filter
trendspider.com
##X
x.com
## Introduction
The **Trend Bars with Okuninushi Line Filter** is an innovative technical indicator that combines two powerful concepts: trend bar analysis and the Okuninushi Line filter. This indicator helps traders identify high-quality trending moves by analyzing candle body strength relative to the overall price range while ensuring the price action aligns with the dominant market structure.
## What Are Trend Bars?
Trend bars are candles where the body (distance between open and close) represents a significant portion of the total price range (high to low). These bars indicate strong directional momentum with minimal indecision, making them valuable signals for trend continuation.
### Key Characteristics:
- **Strong directional movement**: Large body relative to total range
- **Minimal upper/lower shadows**: Shows sustained pressure in one direction
- **High conviction**: Represents decisive market action
## The Okuninushi Line Filter
The Okuninushi Line, also known as the Kijun Line in Ichimoku analysis, is calculated as the midpoint of the highest high and lowest low over a specified period (default: 52 periods).
**Formula**: `(Highest High + Lowest Low) / 2`
This line acts as a dynamic support/resistance level and trend filter, helping to:
- Identify the overall market bias
- Filter out counter-trend signals
- Provide confluence for trade entries
## How the Indicator Works
The indicator combines these two concepts with the following logic:
### Bull Trend Bars (Green)
A candle is colored **green** when ALL conditions are met:
1. **Bullish candle**: Close > Open
2. **Strong body**: |Close - Open| ≥ Threshold × (High - Low)
3. **Above trend filter**: Close > Okuninushi Line
### Bear Trend Bars (Red)
A candle is colored **red** when ALL conditions are met:
1. **Bearish candle**: Close < Open
2. **Strong body**: |Close - Open| ≥ Threshold × (High - Low)
3. **Below trend filter**: Close < Okuninushi Line
### Neutral Bars (Gray)
All other candles that don't meet the complete criteria are colored **gray**.
## Customizable Parameters
### Trend Bar Threshold
- **Range**: 10% to 100%
- **Default**: 75%
- **Purpose**: Controls how "strong" a candle must be to qualify as a trend bar
**Threshold Effects:**
- **Low (10-30%)**: More sensitive, catches smaller trending moves
- **Medium (50-75%)**: Balanced approach, filters out most noise
- **High (80-100%)**: Very selective, only captures the strongest moves
### Okuninushi Line Length
- **Default**: 52 periods
- **Purpose**: Determines the lookback period for calculating the midpoint
- **Common Settings**:
- for 15m is 92, per 1 day as 23h*4(15m in 1h)
- for 1h is 115, per 1 week as 5d*23(23h in 1d)
- for 4h is 120, per 1 month as 20d*6
- for 1d is 65, per 3 months
- for 1w is 52, per 1 year
## Trading Applications
### 1. Trend Continuation Signals
- **Green bars**: Look for bullish continuation opportunities
- **Red bars**: Consider bearish continuation setups
- **Gray bars**: Exercise caution, mixed signals
### 2. Market Structure Analysis
- Clusters of same-colored bars indicate strong trends
- Alternating colors suggest choppy, indecisive markets
- Transition from red to green (or vice versa) may signal trend changes
### 3. Entry Timing
- Use colored bars as confirmation for existing trade setups
- Wait for color alignment with your market bias
- Avoid trading during predominantly gray periods
### 4. Risk Management
- Gray bars can serve as early warning signs of weakening trends
- Color changes might indicate appropriate exit points
- Use in conjunction with other risk management tools
## Advantages
1. **Dual Filtering**: Combines momentum (trend bars) with trend direction (Okuninushi Line)
2. **Visual Clarity**: Immediate visual feedback through candle coloring
3. **Customizable**: Adjustable parameters for different trading styles
4. **Versatile**: Works across multiple timeframes and instruments
5. **Objective**: Rule-based system reduces subjective interpretation
## Limitations
1. **Lagging Nature**: Based on historical price data
2. **False Signals**: Can produce whipsaws in choppy markets
3. **Parameter Sensitivity**: Requires optimization for different instruments
4. **Market Conditions**: May be less effective in ranging markets
## Best Practices
### Optimization Tips:
- **Volatile Markets**: Use higher thresholds (80-90%)
- **Steady Trends**: Use moderate thresholds (60-75%)
- **Short-term Trading**: Shorter Okuninushi Line periods (26)
- **Long-term Analysis**: Longer Okuninushi Line periods (104+)
### Combination Strategies:
- Pair with volume indicators for confirmation
- Use alongside support/resistance levels
- Combine with other trend-following indicators
- Consider market context and overall trend direction
## Conclusion
The Trend Bars with Okuninushi Line Filter offers traders a sophisticated yet intuitive way to identify high-quality trending moves. By combining the momentum characteristics of trend bars with the directional filter of the Okuninushi Line, this indicator helps traders focus on the most promising opportunities while avoiding low-probability setups.
Remember that no single indicator should be used in isolation. Always consider market context, risk management, and other technical factors when making trading decisions. The true power of this indicator lies in its ability to quickly highlight periods of strong, aligned price action – exactly what trend traders are looking for.
RSI Multi Time FrameWhat it is
A clean, two-layer RSI that shows your chart-timeframe RSI together with a higher-timeframe (HTF) RSI on the same pane. The HTF line is drawn as a live segment plus frozen “steps” for each completed HTF bar, so you can see where the higher timeframe momentum held during your lower-timeframe bars.
How it works
Auto HTF mapping (when “Auto” is selected):
Intraday < 30m → uses 60m (1-hour) RSI
30m ≤ tf < 240m (4h) → uses 240m (4-hour) RSI
240m ≤ tf < 1D → uses 1D RSI
1D → uses 1W RSI
1W or 2W → uses 1M RSI
≥ 1M → keeps the same timeframe
The HTF series is requested with request.security(..., gaps_off, lookahead_off), so values are confirmed bar-by-bar. When a new HTF bar begins, the previous value is “frozen” as a horizontal segment; the current HTF value is shown by a short moving segment and a small dot (so you can read the last value easily).
Visuals
Current RSI (chart TF): solid line (color/width configurable).
HTF RSI: same-pane line + tiny circle for the latest value; historical step segments show completed HTF bars.
Guides: dashed 70 / 30 bands, dotted 60/40 helpers, dashed 50 midline.
Inputs
Higher Time Frame: Auto or a fixed TF (1, 3, 5, 10, 15, 30, 45, 60, 120, 180, 240, 360, 480, 720, D, W, 2W, M, 3M, 6M, 12M).
Length: RSI period (default 14).
Source: price source for RSI.
RSI / HTF RSI colors & widths.
Number of HTF RSI Bars: how many frozen HTF segments to keep.
Reading it
Alignment: When RSI (current TF) and HTF RSI both push in the same direction, momentum is aligned across frames.
Divergence across frames: Current RSI failing to confirm HTF direction can warn about chops or early slowdowns.
Zones: 70/30 boundaries for classic overbought/oversold; 60/40 can be used as trend bias rails; 50 is the balance line.
This is a context indicator, not a signal generator. Combine with your entry/exit rules.
Notes & limitations
HTF values do not repaint after their bar closes (lookahead is off). The short “live” segment will evolve until the HTF bar closes — this is expected.
Very small panels or extremely long histories may impact performance if you keep a large number of HTF segments.
Credits
Original concept by LonesomeTheBlue; Pine v6 refactor and auto-mapping rules by trading_mura.
Suggested use
Day traders: run the indicator on 5–15m and keep HTF on Auto to see 1h/4h momentum.
Swing traders: run it on 1h–4h and watch the daily HTF.
Position traders: run on daily and watch the weekly HTF.
If you find it useful, a ⭐ helps others discover it.