Sabbz Golden indicatorIndicator Name: Sabbz Golden Indicator
Short Title: Sabbz
Purpose: A comprehensive trading indicator designed for multiple trading styles (scalping, day trading, and trend following) by combining technical analysis tools such as EMAs, VWAP, support/resistance levels, order blocks, supply/demand zones, RSI, MACD, and volume analysis. It provides visual signals, trend analysis, and a dashboard for real-time decision-making.
Key Features
Exponential Moving Averages (EMAs):
Calculates four EMAs (Fast: 9, Medium: 21, Slow: 50, Trend: 200) to assess short, medium, and long-term trends.
Dynamic coloring based on trend direction:
Fast EMA: Lime (bullish), Red (bearish), Yellow (neutral).
Medium EMA: Blue (bullish), Orange (bearish), Gray (neutral).
Slow EMA: Green (bullish), Red (bearish), Purple (neutral).
Trend EMA: Green (bullish), Red (bearish).
Volume-Weighted Average Price (VWAP):
Plots VWAP with ±1σ deviation bands to identify dynamic support/resistance.
VWAP trend direction (bullish if close > VWAP and VWAP rising, bearish if close < VWAP and VWAP falling) informs trading signals.
Multi-Timeframe Analysis:
Incorporates 5-minute and 15-minute EMA (9 and 21) data to confirm trends across timeframes, enhancing signal reliability.
Support and Resistance Levels:
Detects key support/resistance levels using fractal-based pivot points (5-bar left/right lookback).
Tracks touches of levels (minimum 3 touches required) within a 50-bar lookback.
Levels are filtered to stay within ±0.5% of the current price to avoid clutter.
Break of structure (BoS) signals are generated when price breaks key levels by a user-defined threshold (default: 0.1%).
Order Blocks:
Identifies bullish and bearish order blocks based on strong price reversals with high volume.
Visualized as green (bullish) or red (bearish) boxes on the chart.
Supply and Demand Zones:
Detects fresh demand zones (price drops to a 10-bar low, bounces with high volume) and supply zones (price reaches a 10-bar high, reverses with high volume).
Plotted as blue (demand) or orange (supply) boxes, adjusted by ±0.5 ATR for width.
Scalping Signals:
Generates scalp long/short signals for 1-5 minute timeframes based on:
Short-term EMA trend (9 > 21 for long, 9 < 21 for short).
RSI oversold (<30, rising) for longs or overbought (>70, falling) for shorts.
MACD momentum (histogram positive and rising for longs, negative and falling for shorts).
Volume spike (volume > 1.5x 20-period SMA).
Price above/below VWAP.
Day Trading Signals:
Generates day trading long/short signals for 5-15 minute timeframes based on:
Medium-term trend (EMA 9 > 21 and 21 > 50 for long, opposite for short).
Break of key resistance (long) or support (short).
Multi-timeframe EMA confirmation (5m and 15m).
Volume spike.
Trend Following Signals:
Generates swing/position trading signals based on:
Strong trend (short, medium, long-term EMAs aligned, VWAP trend, and multi-timeframe confirmation).
Presence of fresh demand/supply zones or order blocks.
RSI not overextended (<60 for longs, >40 for shorts).
Volume Analysis:
Uses a 20-period SMA of volume to detect spikes (>1.5x SMA) and high volume (>2x SMA) for signal confirmation.
Dashboard:
Displays real-time data in a top-right table with:
Timeframe: Scalping, Day Trading, Trend Following.
Trend: Bullish, Bearish, Neutral, or Strong Bull/Bear based on EMA and VWAP conditions.
Signal: Long, Short, or Wait based on entry conditions.
Levels: Key support, resistance, VWAP, and RSI values with status (Overbought, Oversold, Neutral).
Color-coded for quick interpretation.
Visual Elements:
Plots EMAs, VWAP, support/resistance levels, order blocks, and supply/demand zones.
Entry signals are marked with triangles (up for long, down for short) of varying sizes (small for scalping, normal for day trading, large for trend following) and colors (e.g., aqua for scalp long, purple for scalp short).
Background coloring indicates trend strength (green for bullish, red for bearish, gray for neutral).
Alerts:
Configurable alerts for:
Scalping Long/Short entries.
Day Trading Long/Short entries.
Trend Following Long/Short entries.
Resistance/Support breaks.
Input Parameters
EMAs:
Fast EMA (default: 9), Medium EMA (21), Slow EMA (50), Trend EMA (200).
Support/Resistance:
Lookback (50 bars), Minimum Touches (3), Break Threshold (0.1%).
Scalping:
RSI Length (14), Overbought (70), Oversold (30), Volume MA (20).
Display Options:
Toggle signals, support/resistance levels, supply/demand zones, and order blocks (all default to true).
Usage
Scalping: Use on 1-5 minute charts for quick entries/exits based on scalp signals.
Day Trading: Use on 5-15 minute charts for break-of-structure trades with multi-timeframe confirmation.
Trend Following: Use on higher timeframes (e.g., 1H, 4H) for swing/position trades aligned with strong trends.
Dashboard: Monitor trend and signal status for all timeframes in real-time.
Alerts: Set up alerts to automate trade notifications.
Notes
Performance: The indicator is computationally intensive due to multi-timeframe calculations and array-based support/resistance logic. Test on your platform to ensure smooth performance.
Customization: Adjust input parameters (e.g., EMA lengths, RSI thresholds) to suit specific markets or trading styles.
Limitations: Signals are based on historical data and technical conditions; always combine with risk management and market context.
ابحث في النصوص البرمجية عن "scalping"
ProScalper📊 ProScalper - Professional 1-Minute Scalping System
🎯 Overview
ProScalper is a sophisticated, multi-confluence scalping indicator designed specifically for 1-minute chart trading. Combining advanced technical analysis with intelligent signal filtering, it provides high-probability trade setups with clear entry, stop loss, and take profit levels.
✨ Key Features
🔺 Smart Signal Detection
Range Filter Technology: Fast-responding trend detection (25-period) optimized for 1-minute timeframe
Medium-sized triangles appear above/below candles for clear buy/sell signals
Only most recent signal shown - no chart clutter
Automatically deletes old signals when new ones appear
📋 Real-Time Signal Table
Top-center display shows complete trade breakdown
Grade system: A+, A, B+, B, C+ ratings for every setup
All confluence reasons listed with checkmarks
Score and R:R displayed for instant trade quality assessment
Color-coded: Green for LONG, Red for SHORT
📐 Multi-Confluence Analysis
ProScalper combines 10+ technical factors:
✅ EMA Trend: 4 EMAs (200, 48, 13, 8) for multi-timeframe alignment
✅ VWAP: Dynamic support/resistance
✅ Fibonacci Retracement: Golden ratio (61.8%), 50%, 38.2%, 78.6%
✅ Range Filter: Adaptive trend confirmation
✅ Pivot Points: Smart reversal detection
✅ Volume Analysis: Spike detection and volume profile
✅ Higher Timeframe: 5-minute trend confirmation
✅ HTF Support/Resistance: Key levels from higher timeframes
✅ Liquidity Sweeps: Smart money detection
✅ Opening Range Breakout: First 15-minute range
💰 Complete Trade Management
Entry Lines: Dashed green (LONG) or red (SHORT) showing exact entry
Stop Loss: Red dashed line with price label
Take Profit: Blue dashed line with price label and R:R
Partial Exits: 1R level marked with orange dashed line
All lines extend 10 bars for clean alignment with Fibonacci levels
📊 Dynamic Risk/Reward
Adaptive R:R calculation based on market volatility
Targets adjusted for pivot distances
Minimum 1.2:1 to maximum 3.5:1 for scalping
Position sizing based on account risk percentage
🎨 Professional Visualization
Clean chart layout - no clutter, only essential information
Custom EMA colors: Red (200), Aqua (48), Green (13), White (8)
Gold VWAP line for key support/resistance
Color-coded Fibonacci: Bright yellow (61.8%), white (50%), orange (38.2%), fuchsia (78.6%)
No shaded zones - pure price action focus
📈 Performance Tracking
Real-time statistics table (optional)
Win rate, total trades, P&L tracking
Average R:R and win/loss ratios
Setup-specific performance metrics
⚙️ Settings & Customization
Risk Management
Adjustable account risk per trade (default: 0.5%)
ATR-based stop loss multiplier (default: 0.8 for tight scalping)
Dynamic position sizing
Signal Sensitivity
Confluence Score Threshold: 40-100 (default: 55 for balanced signals)
Range Filter Period: 25 bars (fast signals for 1-min)
Range Filter Multiplier: 2.2 (tighter bands for more signals)
Visual Controls
Toggle signal table on/off
Show/hide Fibonacci levels
Control EMA visibility
Adjust table text size
Partial Exits
1R: 50% (default)
2R: 30% (default)
3R: 20% (default)
Fully customizable percentages
Trailing Stops
ATR-Based (best for scalping)
Pivot-Based
EMA-Based
Breakeven trigger at 0.8R
🎯 Best Use Cases
Ideal For:
✅ 1-minute scalping on liquid instruments
✅ Day traders looking for quick 2-8 minute trades
✅ High-frequency trading with 8-15 signals per session
✅ Trending markets where Range Filter excels
✅ Crypto, Forex, Futures - works on all liquid assets
Trading Style:
Timeframe: 1-minute (can work on 3-5 min with adjusted settings)
Hold Time: 3-8 minutes average
Target: 1.2-3R per trade
Frequency: 8-15 signals per day
Win Rate: 45-55% (with proper risk management)
📋 How to Use
Step 1: Wait for Signal
Watch for green triangle (BUY) or red triangle (SELL)
Signal table appears at top center automatically
Step 2: Review Confluence
Check grade (prefer A+, A, B+ for best quality)
Review all reasons listed in table
Confirm score is above your threshold (55+ recommended)
Note the R:R ratio
Step 3: Enter Trade
Enter at current market price
Set stop loss at red dashed line
Set take profit at blue dashed line
Mark 1R level (orange line) for partial exit
Step 4: Manage Trade
Exit 50% at 1R (orange line)
Move to breakeven after 0.8R
Trail remaining position using your chosen method
Exit fully at TP or opposite signal
🎨 Chart Setup Recommendations
Optimal Display:
Timeframe: 1-minute
Chart Type: Candles or Heikin Ashi
Background: Dark theme for best color visibility
Volume: Enable volume bars below chart
Complementary Indicators (optional):
Order flow/Delta for institutional confirmation
Market profile for key levels
Economic calendar for news avoidance
⚠️ Important Notes
Risk Disclaimer:
Not financial advice - for educational purposes only
Always use proper risk management (0.5-1% per trade max)
Past performance doesn't guarantee future results
Test on demo account before live trading
Best Practices:
✅ Trade during high liquidity hours (9:30-11 AM, 2-4 PM EST)
✅ Avoid news events and market open/close (first/last 2 minutes)
✅ Use tight stops (0.8-1.0 ATR) for 1-minute scalping
✅ Take partial profits quickly (1R = 50% off)
✅ Respect max daily loss limits (3% recommended)
✅ Focus on A and B grade setups for consistency
What Makes This Different:
🎯 Complete system - not just signals, but full trade management
📊 Multi-confluence - 10+ factors analyzed per trade
🎨 Professional visualization - clean, focused chart design
⚡ Optimized for 1-min - settings specifically tuned for fast scalping
📋 Transparent reasoning - see exactly why each trade was taken
🏆 Grade system - instantly know trade quality
🔧 Technical Details
Pine Script Version: 5
Overlay: Yes (plots on price chart)
Max Lines: 500
Max Labels: 100
Non-repainting: All signals confirmed on bar close
Alerts: Compatible with TradingView alerts
📞 Support & Updates
This indicator is actively maintained and optimized for 1-minute scalping. Settings can be adjusted for different timeframes and trading styles, but default configuration is specifically tuned for high-frequency 1-minute scalping.
🚀 Get Started
Add ProScalper to your 1-minute chart
Adjust settings to your risk tolerance
Wait for signals (green/red triangles)
Follow the signal table guidance
Manage trades using provided levels
Track performance with stats table
Happy Scalping! 📊⚡💰
ADVANCED EMA RIBBON SUITE PRO [Multi-Timeframe + Alerts + Dash]🎯 ADVANCED EMA RIBBON SUITE PRO
📊 DESCRIPTION:
The most comprehensive EMA Ribbon indicator on TradingView, featuring 14 customizable
EMAs (5-200), multi-timeframe analysis, gradient ribbon visualization, smart alerts,
and a real-time dashboard. Perfect for trend following, scalping, and swing trading.
🔥 KEY FEATURES:
• 14 EMAs with Fibonacci sequence option (5, 8, 13, 21, 34, 55, 89, 144, 200)
• Multi-Timeframe (MTF) analysis - see higher timeframe trends
• Dynamic gradient ribbon with trend-based coloring
• Golden Cross & Death Cross detection with alerts
• Professional themes (Dark/Light) with 6 visual styles
• Real-time information dashboard
• Customizable transparency and colors
• Trend strength visualization
• Price position analysis
• Smart alert system for all major crossovers
📈 USE CASES:
• Trend Identification: Ribbon expansion/contraction shows trend strength
• Entry/Exit Signals: EMA crossovers provide clear trade signals
• Support/Resistance: EMAs act as dynamic S/R levels
• Multi-Timeframe Confluence: Combine timeframes for higher probability trades
• Scalping: Use faster EMAs (5-20) for quick trades
• Swing Trading: Focus on 50/200 EMAs for position trades
🎯 TRADING STRATEGIES:
1. Ribbon Squeeze: Trade breakouts when ribbon contracts
2. Golden/Death Cross: Major trend reversals at 50/200 crosses
3. Price Above/Below: Long when price above most EMAs, short when below
4. MTF Confluence: Trade when multiple timeframes align
5. Dynamic S/R: Use EMAs as trailing stop levels
⚡ OPTIMAL SETTINGS:
• Scalping: 5, 8, 13, 21 EMAs on 1-5 min charts
• Day Trading: Full ribbon on 15-60 min charts
• Swing Trading: Focus on 50, 100, 200 EMAs on daily charts
• Position Trading: Use weekly timeframe with monthly MTF
📌 KEYWORDS:
EMA, Exponential Moving Average, Ribbon, Multi-Timeframe, MTF, Golden Cross,
Death Cross, Trend Following, Scalping, Swing Trading, Dashboard, Alerts,
Support Resistance, Fibonacci, Professional, Advanced, Suite, Indicator
*Created using PineCraft AI (Link in Bio)
Timeframe Resistance Evaluation And Detection - CoffeeKillerTREAD - Timeframe Resistance Evaluation And Detection Guide
🔔 Important Technical Limitation 🔔
**This indicator does NOT fetch true higher timeframe data.** Instead, it simulates higher timeframe levels by aggregating data from your current chart timeframe. This means:
- Results will vary depending on what chart timeframe you're viewing
- Levels may not match actual higher timeframe candle highs/lows
- You might miss important wicks or gaps that occurred between chart timeframe bars
- **Always verify levels against actual higher timeframe charts before trading**
Welcome traders! This guide will walk you through the TREAD (Timeframe Resistance Evaluation And Detection) indicator, a multi-timeframe analysis tool developed by CoffeeKiller that identifies support and resistance confluence across different time periods.(I am 50+ year old trader and always thought I was bad a teaching and explaining so you get a AI guide. I personally use this on the 5 minute chart with the default settings, but to each there own and if you can improve the trend detection methods please DM me. I would like to see the code. Thanks)
Core Components
1. Dual Timeframe Level Tracking
- Short Timeframe Levels: Tracks opening price extremes within shorter periods
- Long Timeframe Levels: Tracks actual high/low extremes within longer periods
- Dynamic Reset Mechanism: Levels reset at the start of each new timeframe period
- Momentum Detection: Identifies when levels change mid-period, indicating active price movement
2. Visual Zone System
- High Zones: Areas between long timeframe highs and short timeframe highs
- Low Zones: Areas between long timeframe lows and short timeframe lows
- Fill Coloring: Dynamic colors based on whether levels are static or actively changing
- Momentum Highlighting: Special colors when levels break during active periods
3. Customizable Display Options
- Multiple Plot Styles: Line, circles, or cross markers
- Flexible Timeframe Selection: Wide range of short and long timeframe combinations
- Color Customization: Separate colors for each level type and momentum state
- Toggle Controls: Show/hide different elements based on trading preference
Main Features
Timeframe Settings
- Short Timeframe Options: 15m, 30m, 1h, 2h, 4h
- Long Timeframe Options: 1h, 2h, 4h, 8h, 12h, 1D, 1W
- Recommended Combinations:
- Scalping: 15m/1h or 30m/2h
- Day Trading: 30m/4h or 1h/4h
- Swing Trading: 4h/1D or 1D/1W
Display Configuration
- Level Visibility: Toggle short/long timeframe levels independently
- Fill Zone Control: Enable/disable colored zones between levels
- Momentum Fills: Special highlighting for actively changing levels
- Line Customization: Width, style, and color options for all elements
Color System
- Short TF High: Default red for resistance levels
- Short TF Low: Default green for support levels
- Long TF High: Transparent red for broader resistance context
- Long TF Low: Transparent green for broader support context
- Momentum Colors: Brighter colors when levels are actively changing
Technical Implementation Details
How Level Tracking Works
The indicator uses a custom tracking function that:
1. Detects Timeframe Periods: Uses `time()` function to identify when new periods begin
2. Tracks Extremes: Monitors highest/lowest values within each period
3. Resets on New Periods: Clears tracking when timeframe periods change
4. Updates Mid-Period: Continues tracking if new extremes are reached
The Timeframe Limitation Explained
`pinescript
// What the indicator does:
short_tf_start = ta.change(time(short_timeframe)) != 0 // Detects 30m period start
= track_highest(open, short_tf_start) // BUT uses chart TF opens!
// What true multi-timeframe would be:
// short_tf_high = request.security(syminfo.tickerid, short_timeframe, high)
`
This means:
- On a 5m chart with 30m/4h settings: Tracks 5m bar opens during 30m and 4h windows
- On a 1m chart with same settings: Tracks 1m bar opens during 30m and 4h windows
- Results will be different between chart timeframes
- May miss important price action that occurred between your chart's bars
Visual Elements
1. Level Lines
- Short TF High: Upper resistance line from shorter timeframe analysis
- Short TF Low: Lower support line from shorter timeframe analysis
- Long TF High: Broader resistance context from longer timeframe
- Long TF Low: Broader support context from longer timeframe
2. Zone Fills
- High Zone: Area between long TF high and short TF high (potential resistance cluster)
- Low Zone: Area between long TF low and short TF low (potential support cluster)
- Regular Fill: Standard transparency when levels are static
- Momentum Fill: Enhanced visibility when levels are actively changing
3. Dynamic Coloring
- Static Periods: Normal colors when levels haven't changed recently
- Active Periods: Momentum colors when levels are being tested/broken
- Confluence Zones: Different intensities based on timeframe alignment
Trading Applications
1. Support/Resistance Trading
- Entry Points: Trade bounces from zone boundaries
- Confluence Areas: Focus on areas where short and long TF levels cluster
- Zone Breaks: Enter on confirmed breaks through entire zones
- Multiple Timeframe Confirmation: Stronger signals when both timeframes align
2. Range Trading
- Zone Boundaries: Use fill zones as range extremes
- Mean Reversion: Trade back toward opposite zone when price reaches extremes
- Breakout Preparation: Watch for momentum color changes indicating potential breakouts
- Risk Management: Place stops outside the opposite zone
3. Trend Following
- Direction Bias: Trade in direction of zone breaks
- Pullback Entries: Enter on pullbacks to broken zones (now support/resistance)
- Momentum Confirmation: Use momentum coloring to confirm trend strength
- Multiple Timeframe Alignment: Strongest trends when both timeframes agree
4. Scalping Applications
- Quick Bounces: Trade rapid moves between zone boundaries
- Momentum Signals: Enter when momentum colors appear
- Short-Term Targets: Use opposite zone as profit target
- Tight Stops: Place stops just outside current zone
Optimization Guide
1. Timeframe Selection
For Different Trading Styles:
- Scalping: 15m/1h - Quick levels, frequent updates
- Day Trading: 30m/4h - Balanced view, good for intraday moves
- Swing Trading: 4h/1D - Longer-term perspective, fewer false signals
- Position Trading: 1D/1W - Major structural levels
2. Chart Timeframe Considerations
**Important**: Your chart timeframe affects results
- Lower Chart TF: More granular level tracking, but may be noisy
- Higher Chart TF: Smoother levels, but may miss important price action
- Recommended: Use chart timeframe 2-4x smaller than short indicator timeframe
3. Display Settings
- Busy Charts: Disable fills, show only key levels
- Clean Analysis: Enable all fills and momentum coloring
- Multi-Monitor Setup: Use different color schemes for easy identification
- Mobile Trading: Increase line width for visibility
Best Practices
1. Level Verification
- Always Cross-Check: Verify levels against actual higher timeframe charts
- Multiple Timeframes: Check 2-3 different chart timeframes for consistency
- Price Action Confirmation: Wait for candlestick confirmation at levels
- Volume Analysis: Combine with volume for stronger confirmation
2. Risk Management
- Stop Placement: Use zones rather than exact prices for stops
- Position Sizing: Reduce size when zones are narrow (higher risk)
- Multiple Targets: Scale out at different zone boundaries
- False Break Protection: Allow for minor zone penetrations
3. Signal Quality Assessment
- Momentum Colors: Higher probability when momentum coloring appears
- Zone Width: Wider zones often provide stronger support/resistance
- Historical Testing: Backtest on your preferred timeframe combinations
- Market Conditions: Adjust sensitivity based on volatility
Advanced Features
1. Momentum Detection System
The indicator tracks when levels change mid-period:
`pinescript
short_high_changed = short_high != short_high and not short_tf_start
`
This identifies:
- Active level testing
- Potential breakout situations
- Increased market volatility
- Trend acceleration points
2. Dynamic Color System
Complex conditional logic determines fill colors:
- Static Zones: Regular transparency for stable levels
- Active Zones: Enhanced colors for changing levels
- Mixed States: Different combinations based on user preferences
- Custom Overrides: User can prioritize certain color schemes
3. Zone Interaction Analysis
- Convergence: When short and long TF levels approach each other
- Divergence: When timeframes show conflicting levels
- Alignment: When both timeframes agree on direction
- Transition: When one timeframe changes while other remains static
Common Issues and Solutions
1. Inconsistent Levels
Problem: Levels look different on various chart timeframes
Solution: Always verify against actual higher timeframe charts
2. Missing Price Action
Problem: Important wicks or gaps not reflected in levels
Solution: Use chart timeframe closer to indicator's short timeframe setting
3. Too Many Signals
Problem: Excessive level changes and momentum alerts
Solution: Increase timeframe settings or reduce chart timeframe granularity
4. Lagging Signals
Problem: Levels seem to update too slowly
Solution: Decrease chart timeframe or use more sensitive timeframe combinations
Recommended Setups
Conservative Approach
- Timeframes: 4h/1D
- Chart: 1h
- Display: Show fills only, no momentum coloring
- Use: Swing trading, position management
Aggressive Approach
- Timeframes: 15m/1h
- Chart: 5m
- Display: All features enabled, momentum highlighting
- Use: Scalping, quick reversal trades
Balanced Approach
- Timeframes: 30m/4h
- Chart: 15m
- Display: Selective fills, momentum on key levels
- Use: Day trading, multi-session analysis
Final Notes
**Remember**: This indicator provides a synthetic view of multi-timeframe levels, not true higher timeframe data. While useful for identifying potential confluence areas, always verify important levels by checking actual higher timeframe charts.
**Best Results When**:
- Combined with actual multi-timeframe analysis
- Used for confluence confirmation rather than primary signals
- Applied with proper risk management
- Verified against price action and volume
**DISCLAIMER**: This indicator and its signals are intended solely for educational and informational purposes. The timeframe limitation means results may not reflect true higher timeframe levels. Always conduct your own analysis and verify levels independently before making trading decisions. Trading involves significant risk of loss.
Advanced Smart Trading Suite with OTE═══════════════════════════════════════
ADVANCED SMART TRADING SUITE WITH OPTIMAL TRADE ENTRY
═══════════════════════════════════════
A comprehensive institutional trading system combining multiple advanced concepts including multi-timeframe liquidity analysis, order blocks, fair value gaps, and optimal trade entry zones. Features optional anti-repainting controls for confirmed signal generation.
───────────────────────────────────────
WHAT THIS INDICATOR DOES
───────────────────────────────────────
This all-in-one trading suite provides:
- Multi-Timeframe Liquidity Detection - HTF (Higher Timeframe), LTF (Lower Timeframe), and current timeframe liquidity sweep identification
- Order Blocks - Institutional accumulation/distribution zones with enhanced detection
- Fair Value Gaps (FVG) - Price imbalance detection
- Inverse Fair Value Gaps (iFVG) - Counter-trend imbalance zones
- Optimal Trade Entry (OTE) Zones - Fibonacci retracement-based entry zones (0.618-0.786)
- Trading Sessions - Asian, London, and New York session visualization
- Anti-Repainting Controls - Optional confirmed signals with adjustable confirmation bars
- Comprehensive Alert System - Notifications for all major events
───────────────────────────────────────
HOW IT WORKS
───────────────────────────────────────
ANTI-REPAINTING SYSTEM:
This indicator includes optional anti-repainting controls that fundamentally change how signals are generated:
Confirmed Mode (Recommended):
- Signals wait for confirmation bars before appearing
- No repainting - what you see is final
- Adjustable confirmation period (1-5 bars)
- Slight lag in signal generation
- Better for backtesting and systematic trading
Live Mode:
- Signals appear immediately as patterns develop
- May repaint as new bars form
- Faster signal generation
- Better for discretionary real-time trading
The confirmation system affects all features: liquidity sweeps, order blocks, FVGs, and OTE zones.
LIQUIDITY SWEEP DETECTION:
Three-Tier System:
1. Current Timeframe Liquidity:
- Detects swing highs/lows on chart timeframe
- Configurable lookback and confirmation periods
- Session-tagged for context (Asian/London/NY)
2. HTF (Higher Timeframe) Key Liquidity:
- Default: 4H timeframe (configurable to Daily/Weekly)
- Strength-based filtering using ATR multipliers
- Distance-based clustering prevention
- Only strongest levels displayed (top 1-10)
- Labels show timeframe and strength rating
3. LTF (Lower Timeframe) Key Liquidity:
- Default: 1H timeframe (configurable)
- Precision entry/exit levels
- Strength-based ranking
- Distance filtering to avoid clutter
Sweep Detection Methods:
- Wick Break: Any wick beyond the level
- Close Break: Close price beyond the level
- Full Retrace: Break and close back inside (stop hunt detection)
Buffer System:
- Configurable ATR-based buffer for sweep confirmation
- Prevents false positives from minor price fluctuations
ORDER BLOCKS (Enhanced):
Detection Methodology:
- Identifies the last opposing candle before significant structure break
- Bullish OB: Last red candle before bullish break
- Bearish OB: Last green candle before bearish break
Enhanced Filters:
1. Size Filter:
- Minimum order block size (ATR-based)
- Ensures significant zones only
2. Volume Filter:
- Requires above-average volume (configurable multiplier)
- Confirms institutional participation
3. Imbalance Filter:
- Requires strong directional move after OB formation
- Validates true institutional activity
Violation Detection:
- Wick-based: Any wick through the zone
- Close-based: Close price through the zone
- Automatic removal of broken order blocks
FAIR VALUE GAPS (FVG):
Bullish FVG: Gap between candle 3 low and candle 1 high (three-bar pattern)
Bearish FVG: Gap between candle 3 high and candle 1 low
Requirements:
- Minimum gap size (ATR-based)
- Clear price imbalance
- No overlap between the three candles
Fill Detection:
- Configurable fill threshold (default 50%)
- Tracks partial and complete fills
- Removes filled gaps to keep chart clean
INVERSE FAIR VALUE GAPS (iFVG):
What are iFVGs:
- Counter-trend FVGs that form after original FVG is filled
- Indicate potential reversal or continuation failure
- Form within specific timeframe after original FVG
Detection Rules:
- Must occur after a FVG is filled
- Must form within 20 bars of original FVG
- Minimum size requirement (ATR-based)
- Opposite direction to original FVG
Visual Distinction:
- Dashed border boxes
- Different color scheme from regular FVGs
- Combined labels when FVG and iFVG overlap
OPTIMAL TRADE ENTRY (OTE) ZONES:
Based on Fibonacci retracement principles used by institutional traders:
Concept:
After a structure break (swing high/low violation), price often retraces to specific Fibonacci levels before continuing. The OTE zone (0.618 to 0.786) represents the optimal entry area.
Bullish OTE Formation:
1. Swing low is formed
2. Structure breaks above previous swing high (bullish structure break)
3. Price retraces into 0.618-0.786 Fibonacci zone
4. Entry signal when price enters and holds in OTE zone
Bearish OTE Formation:
1. Swing high is formed
2. Structure breaks below previous swing low (bearish structure break)
3. Price retraces into 0.618-0.786 Fibonacci zone
4. Entry signal when price enters and holds in OTE zone
Key Fibonacci Levels:
- 0.618 (Golden ratio - primary target)
- 0.705 (Square root of 0.5 - institutional level)
- 0.786 (Square root of 0.618 - deep retracement)
Structure Break Requirement:
- Optional setting to require confirmed structure break
- Prevents premature OTE zone identification
- Ensures proper swing structure is established
Entry/Exit Tracking:
- Green checkmark: Price entered OTE zone validly
- Red X: Price exited OTE zone (stop or target)
- Real-time status monitoring
TRADING SESSIONS:
Displays three major trading sessions with full customization:
Asian Session (Tokyo + Sydney):
- Default: 01:00-13:00 UTC+4
- Typically lower volatility
- Sets up key levels for London open
London Session:
- Default: 11:00-20:00 UTC+4
- Highest liquidity period
- Major institutional moves
New York Session:
- Default: 16:00-01:00 UTC+4
- US market hours
- High impact news events
Features:
- Real-time status indicators (🟢 Open / 🔴 Closed)
- Session high/low tracking
- Overlap detection and highlighting
- Historical session display (0-30 days)
- Customizable colors and borders
───────────────────────────────────────
HOW TO USE
───────────────────────────────────────
MASTER CONTROLS:
Enable/disable major features independently:
- Trading Sessions
- Liquidity Sweeps (Current TF)
- HTF Liquidity Sweeps
- LTF Liquidity Sweeps
- Order Blocks
- Fair Value Gaps
- Inverse Fair Value Gaps
- Optimal Trade Entry Zones
ANTI-REPAINTING SETUP:
For Backtesting/Systematic Trading:
1. Enable "Use Confirmed Signals"
2. Set Confirmation Bars to 2-3
3. All signals will wait for confirmation
4. No repainting will occur
For Real-Time Discretionary Trading:
1. Disable "Use Confirmed Signals"
2. Signals appear immediately
3. Be aware signals may adjust with new bars
MULTI-TIMEFRAME LIQUIDITY STRATEGY:
Top-Down Analysis:
1. Identify HTF liquidity levels (4H/Daily) for major targets
2. Find LTF liquidity levels (1H) for entry refinement
3. Wait for HTF liquidity sweep (liquidity grab)
4. Enter on LTF order block in direction of HTF sweep
5. Target next HTF or LTF liquidity level
Liquidity Sweep Trading:
1. HTF liquidity sweep = major institutional move
2. Look for immediate reversal or continuation
3. Use order blocks for entry timing
4. Place stops beyond the swept liquidity
SESSION-BASED TRADING:
Asian Session Strategy:
1. Identify Asian session high/low
2. Wait for London or NY session to open
3. Trade breakouts of Asian range
4. Target previous day's highs/lows
London/NY Session Strategy:
1. Watch for liquidity sweeps at session open
2. Enter on order block confirmation
3. Use OTE zones for retracement entries
4. Target session high/low or HTF liquidity
OTE ZONE TRADING:
Setup Identification:
1. Wait for clear swing high/low formation
2. Confirm structure break in intended direction
3. Monitor for price retracement to 0.618-0.786 zone
4. Enter when price enters OTE zone with confirmation
Entry Rules:
- Bullish: Long when price enters OTE zone from above
- Bearish: Short when price enters OTE zone from below
- Stop loss: Beyond 0.786 level or swing extreme
- Target: Previous swing high/low or HTF liquidity
Exit Management:
- Indicator tracks when price exits OTE zone
- Red X indicates position should be managed/closed
- Use order blocks or FVGs for partial profit targets
FAIR VALUE GAP STRATEGY:
FVG Entry Method:
1. Wait for FVG formation
2. Monitor for price return to FVG
3. Enter on first touch of FVG zone
4. Stop beyond FVG boundary
5. Target: Fill of FVG or next liquidity level
iFVG Reversal Strategy:
1. Original FVG is filled
2. iFVG forms in opposite direction
3. Indicates failed move or reversal
4. Enter on iFVG confirmation
5. Target: Opposite end of range or next structure
Combined FVG + iFVG:
- When both overlap, indicator combines labels
- Represents high-probability reversal zone
- Use with order blocks for confirmation
ORDER BLOCK STRATEGY:
Entry Approach:
1. Wait for order block formation after structure break
2. Enter on first return to order block
3. Place stop beyond order block boundary
4. Target: Next order block or liquidity level
Confirmation Layers:
- Order block + FVG = strong confluence
- Order block + Liquidity sweep = institutional setup
- Order block + OTE zone = optimal entry
- Order block + Session open = high probability
Volume Analysis:
- Wider colored section = stronger institutional interest
- Use volume bars to confirm order block strength
- Higher volume order blocks = more reliable
───────────────────────────────────────
CONFIGURATION GUIDE
───────────────────────────────────────
LIQUIDITY SETTINGS:
Lookback: 5-30 bars
- Lower = more frequent, sensitive levels
- Higher = fewer, more significant levels
- Recommended: 15 for intraday, 20-25 for swing
Sweep Detection Type:
- Wick Break: Most sensitive
- Close Break: More conservative
- Full Retrace: Stop hunt detection
Sweep Buffer: 0-1.0 ATR
- Adds distance requirement for sweep confirmation
- Prevents false positives
- Recommended: 0.1 for most markets
HTF/LTF LIQUIDITY:
HTF Timeframe Selection:
- Swing trading: 1D or 1W
- Day trading: 4H or 1D
- Scalping: 1H or 4H
LTF Timeframe Selection:
- Swing trading: 4H or 1D
- Day trading: 1H or 4H
- Scalping: 15m or 1H
Strength Filters:
- Min Pivot Strength: Higher = fewer, stronger levels
- Min Distance: Higher = less clustering
- Recommended: 2.0 ATR for HTF, 1.5 ATR for LTF
ORDER BLOCK SETTINGS:
Swing Length: 5-20
- Controls sensitivity of structure break detection
- Lower = more order blocks, faster signals
- Higher = fewer order blocks, stronger signals
- Recommended: 8-10 for most timeframes
Enhancement Filters:
- Min Size: 0.5-1.5 ATR typical
- Volume Multiplier: 1.2-2.0 typical
- Imbalance: Enable for strongest signals only
OTE SETTINGS:
Swing Length: 5-50
- Controls OTE zone formation sensitivity
- Lower = more frequent, smaller moves
- Higher = fewer, larger trend moves
- Recommended: 10-15 for intraday
Require Structure Break:
- Enabled: Only shows OTE after confirmed break
- Disabled: Shows potential OTE zones earlier
- Recommended: Enable for higher probability setups
FVG SETTINGS:
Min FVG Size: 0.1-2.0 ATR
- Lower = more gaps detected
- Higher = only significant gaps
- Recommended: 0.5 ATR for most markets
Fill Threshold: 0.1-1.0
- Determines when gap is considered "filled"
- 0.5 = 50% fill required
- Higher = more conservative
iFVG Min Size: 0.1-2.0 ATR
- Typically smaller than regular FVG
- Recommended: 0.3 ATR
ALERT SYSTEM:
Available Alerts:
- Liquidity Sweeps (Current TF)
- HTF Liquidity Sweeps
- LTF Liquidity Sweeps
- Session Changes (Open/Close)
- OTE Entry Signals
Alert Setup:
1. Enable alerts in settings
2. Select specific alert types
3. Create TradingView alert using "Any alert() function call"
4. Configure delivery method (mobile, email, webhook)
Alert Messages Include:
- Event type and direction
- Confirmation status (if using confirmed mode)
- Price level
- Timeframe (for liquidity sweeps)
───────────────────────────────────────
RECOMMENDED CONFIGURATIONS
───────────────────────────────────────
For Day Trading (15m-1H charts):
- HTF Liquidity: 4H
- LTF Liquidity: 1H
- Liquidity Lookback: 15
- Order Block Swing Length: 8
- OTE Swing Length: 10
- Confirmed Signals: Enabled, 2 bars
For Swing Trading (4H-1D charts):
- HTF Liquidity: 1D or 1W
- LTF Liquidity: 4H
- Liquidity Lookback: 20
- Order Block Swing Length: 10
- OTE Swing Length: 15
- Confirmed Signals: Enabled, 2-3 bars
For Scalping (5m-15m charts):
- HTF Liquidity: 1H or 4H
- LTF Liquidity: 15m or 1H
- Liquidity Lookback: 10-12
- Order Block Swing Length: 6-8
- OTE Swing Length: 8
- Confirmed Signals: Optional
───────────────────────────────────────
PERFORMANCE OPTIMIZATION
───────────────────────────────────────
This indicator is optimized with:
- max_bars_back declarations for efficient lookback
- Automatic memory cleanup every 10 bars
- Conditional execution based on enabled features
- Drawing object limits to prevent performance degradation
Memory Management:
- Old liquidity zones automatically removed
- Filled FVGs/iFVGs cleaned up
- Exited OTE zones removed
- Mitigated order blocks deleted
Best Practices:
- Enable only needed features
- Use appropriate timeframe combinations
- Don't display excessive historical sessions
- Monitor drawing object counts on lower timeframes
───────────────────────────────────────
EDUCATIONAL DISCLAIMER
───────────────────────────────────────
This indicator combines multiple institutional trading concepts:
- Liquidity theory (where orders accumulate)
- Order flow analysis (institutional footprints)
- Price imbalance detection (FVGs)
- Fibonacci retracement theory (OTE zones)
- Session-based trading (time-of-day patterns)
All calculations use standard technical analysis methods:
- Pivot high/low detection
- ATR-based normalization
- Volume analysis
- Fibonacci ratios
- Time-based filtering
The indicator identifies potential setups but does not predict future price movements. Success depends on proper application within a complete trading plan including risk management, position sizing, and market context analysis.
───────────────────────────────────────
USAGE DISCLAIMER
───────────────────────────────────────
This tool is for educational and analytical purposes. Trading involves substantial risk of loss. The anti-repainting features provide confirmed signals but do not guarantee profitability. Always conduct independent analysis, use proper risk management, and never risk capital you cannot afford to lose. Past performance does not indicate future results.
TradingIQ - Nova IQIntroducing "Nova IQ" by TradingIQ
Nova IQ is an exclusive Trading IQ algorithm designed for extended price move scalping. It spots overextended micro price moves and bets against them. In this way, Nova IQ functions similarly to a reversion strategy.
Nova IQ analyzes historical and real-time price data to construct a dynamic trading system adaptable to various asset and timeframe combinations.
Philosophy of Nova IQ
Nova IQ integrates AI with the concept of central-value reversion scalping. On lower timeframes, prices may overextend for small periods of time - which Nova IQ looks to bet against. In this sense, Nova IQ scalps against small, extended price moves on lower timeframes.
Nova IQ is designed to work straight out of the box. In fact, its simplicity requires just one user setting, making it incredibly straightforward to manage.
Use HTF (used to apply a higher timeframe trade filter) is the only setting that controls how Nova IQ works.
Traders don’t have to spend hours adjusting settings and trying to find what works best - Nova IQ handles this on its own.
Key Features of Nova IQ
Self-Learning Market Scalping
Employs AI and IQ Technology to scalp micro price overextensions.
AI-Generated Trading Signals
Provides scalping signals derived from self-learning algorithms.
Comprehensive Trading System
Offers clear entry and exit labels.
Performance Tracking
Records and presents trading performance data, easily accessible for user analysis.
Higher Timeframe Filter
Allows users to implement a higher timeframe trading filter.
Long and Short Trading Capabilities
Supports both long and short positions to trade various market conditions.
Nova Oscillator (NOSC)
The Nova IQ Oscillator (NOSC) is an exclusive self-learning oscillator developed by Trading IQ. Using IQ Technology, the NOSC functions as an all-in-one oscillator for evaluating price overextensions.
Nova Bands (NBANDS)
The Nova Bands (NBANDS) are based on a proprietary calculation and serve as a custom two-layer smoothing filter that uses exponential decay. These bands adaptively smooth prices to identify potential trend retracement opportunities.
How It Works
Nova IQ operates on a simple heuristic: scalp long during micro downside overextensions and short during micro upside overextensions.
What constitutes an "overextension" is defined by IQ Technology, TradingIQ's proprietary AI algorithm. For Nova IQ, this algorithm evaluates the typical extent of micro overextensions before a reversal occurs. By learning from these patterns, Nova IQ adapts to identify and trade future overextensions in a consistent manner.
In essence, Nova IQ learns from price movements within scalping timeframes to pinpoint price areas for capitalizing on the reversal of an overextension.
As a trading system, Nova IQ enters all positions using market orders at the bar’s close. Each trade is exited with a profit-taking limit order and a stop-loss order. Thanks to its self-learning capability, Nova IQ determines the most suitable profit target and stop-loss levels, eliminating the need for the user to adjust any settings.
What classifies as a tradable overextension?
For Nova IQ, tradable overextensions are not manually set but are learned by the system. Nova IQ utilizes NOSC to identify and classify micro overextensions. By analyzing multiple variations of NOSC, along with its consistency in signaling overextensions and its tendency to remain in extreme zones, Nova IQ dynamically adjusts NOSC to determine what constitutes overextension territory for the indicator.
When NOSC reaches the downside overextension zone, long trades become eligible for entry. Conversely, when NOSC reaches the upside overextension zone, short trades become eligible for entry.
The image above illustrates NOSC and explains the corresponding overextension zones
The blue lower line represents the Downside Overextension Zone.
The red upper line represents the Upside Overextension Zone.
Any area between the two deviation points is not considered a tradable price overextension.
When either of the overextension zones are breached, Nova IQ will get to work at determining a trade opportunity.
The image above shows a long position being entered after the Downside Overextension Zone was reached.
The blue line on the price scale shows the AI-calculated profit target for the scalp position. The redline shows the AI-calculated stop loss for the scalp position.
Blue arrows indicate that the strategy entered a long position at the highlighted price level.
Yellow arrows indicate a position was closed.
You can also hover over the trade labels to get more information about the trade—such as the entry price and exit price.
The image above depicts a short position being entered after the Upside Overextension Zone was breached.
The blue line on the price scale shows the AI-calculated profit target for the scalp position. The redline shows the AI-calculated stop loss for the scalp position.
Red arrows indicate that the strategy entered a short position at the highlighted price level.
Yellow arrows indicate that NOVA IQ exited a position.
Long Entry: Blue Arrow
Short Entry: Red Arrow
Closed Trade: Yellow Arrow
Nova Bands
The Nova Bands (NBANDS) are based on a proprietary calculation and serve as a custom two-layer smoothing filter that uses exponential decay and cosine factors.
These bands adaptively smooth the price to identify potential trend retracement opportunities.
The image above illustrates how to interpret NBANDS. While NOSC focuses on identifying micro overextensions, NBANDS is designed to capture larger price overextensions. As a result, the two indicators complement each other well and can be effectively used together to identify a broader range of price overextensions in the market.
While the Nova Bands are not part of the core heuristic and do not use IQ technology, they provide valuable insights for discretionary traders looking to refine their strategies.
Use HTF (Use Higher Timeframe) Setting
Nova IQ has only one setting that controls its functionality.
“Use HTF” controls whether the AI uses a higher timeframe trading filter. This setting can be true or false. If true, the trader must select the higher timeframe to implement.
No Higher TF Filter
Nova IQ operates with standard aggression when the higher timeframe setting is turned off. In this mode, it exclusively learns from the price data of the current chart, allowing it to trade more aggressively without the influence of a higher timeframe filter.
Higher TF Filter
Nova IQ demonstrates reduced aggression when the "Use HTF" (Higher Timeframe) setting is enabled. In this mode, Nova IQ learns from both the current chart's data and the selected higher timeframe data, factoring in the higher timeframe trend when seeking scalping opportunities. As a result, trading opportunities only arise when both the higher timeframe and the chart's timeframe simultaneously display overextensions, making this mode more selective in its entries.
In this mode, Nova IQ calculates NOSC on the higher timeframe, learns from the corresponding price data, and applies the same rules to NOSC as it does for the current chart's timeframe. This ensures that Nova IQ consistently evaluates overextensions across both timeframes, maintaining its trading logic while incorporating higher timeframe insights.
AI Direction
The AI Direction setting controls the trade direction Nova IQ is allowed to take.
“Trade Longs” allows for long trades.
“Trade Shorts” allows for short trades.
Verifying Nova IQ’s Effectiveness
Nova IQ automatically tracks its performance and displays the profit factor for the long strategy and the short strategy it uses. This information can be found in a table located in the top-right corner of your chart showing the long strategy profit factor and the short strategy profit factor.
The image above shows the long strategy profit factor and the short strategy profit factor for Nova IQ.
A profit factor greater than 1 indicates a strategy profitably traded historical price data.
A profit factor less than 1 indicates a strategy unprofitably traded historical price data.
A profit factor equal to 1 indicates a strategy did not lose or gain money when trading historical price data.
Using Nova IQ
While Nova IQ is a full-fledged trading system with entries and exits - it was designed for the manual trader to take its trading signals and analysis indications to greater heights, offering numerous applications beyond its built-in trading system.
The hallmark feature of Nova IQ is its to ignore noise and only generate signals during tradable overextensions.
The best way to identify overextensions with Nova IQ is with NOSC.
NOSC is naturally adept at identifying micro overextensions. While it can be interpreted in a manner similar to traditional oscillators like RSI or Stochastic, NOSC’s underlying calculation and self-learning capabilities make it significantly more advanced and useful than conventional oscillators.
Additionally, manual traders can benefit from using NBANDS. Although NBANDS aren't a core component of Nova IQ's guiding heuristic, they can be valuable for manual trading. Prices rarely extend beyond these bands, and it's uncommon for prices to consistently trade outside of them.
NBANDS do not incorporate IQ Technology; however, when combined with NOSC, traders can identify strong double-confluence opportunities.
MTF EMA Trading SystemHere's a comprehensive description and usage guide for publishing your MTF EMA Trading System indicator on TradingView:
MTF EMA Trading System - Pro Edition
📊 Indicator Overview
The MTF EMA Trading System is an advanced multi-timeframe exponential moving average indicator designed for traders seeking high-probability setups with multiple confirmations. Unlike simple EMA crossover systems, this indicator combines trend alignment, momentum, volume analysis, and previous day confluence to generate reliable long and short signals with optimal risk-reward ratios.
✨ Key Features
1. Multi-Timeframe EMA Analysis
Configure 5 independent EMAs (default: 9, 21, 50, 100, 200)
Each EMA can pull data from ANY timeframe (5m, 15m, 1H, 4H, 1D, etc.)
Color-coded lines with customizable widths
End-of-line labels showing EMA period and timeframe (e.g., "EMA200 ")
Perfect for analyzing higher timeframe trends on lower timeframe charts
2. Advanced Signal Generation (Beyond Simple Crosses)
The system requires MULTIPLE confirmations before generating a signal:
LONG Signals Require:
✅ Price action trigger (EMA cross, bounce from key EMA, or pullback setup)
✅ Bullish EMA alignment (EMAs in proper ascending order)
✅ Volume spike confirmation (configurable threshold)
✅ RSI momentum confirmation (bullish but not overbought)
✅ Sufficient EMA separation (avoids choppy/whipsaw conditions)
✅ Price above previous day's low (confluence with support)
SHORT Signals Require:
✅ Price action trigger (EMA cross, rejection from key EMA, or pullback setup)
✅ Bearish EMA alignment (EMAs in proper descending order)
✅ Volume spike confirmation
✅ RSI momentum confirmation (bearish but not oversold)
✅ Sufficient EMA separation
✅ Price below previous day's high (confluence with resistance)
3. Real-Time Dashboard
Displays critical market conditions at a glance:
Overall trend direction (Bullish/Bearish/Neutral)
Price position relative to all EMAs
Volume status (spike or normal)
RSI momentum reading
EMA confluence strength
EMA separation quality
Current ATR value
Previous day high/low levels
Current signal status (LONG/SHORT/WAIT)
Risk-reward ratio
4. Clean Visual Design
Large, clear trade signal markers (green triangles for LONG, red triangles for SHORT)
No chart clutter - only essential information displayed
Customizable signal sizes
Professional color-coded dashboard
5. Built-In Risk Management
ATR-based calculations for stop loss placement
1:2 risk-reward ratio by default
All levels displayed in dashboard for easy reference
🎯 How to Use This Indicator
Step 1: Initial Setup
Add the indicator to your TradingView chart
Configure your preferred timeframes for each EMA:
EMA 9: Leave blank (uses chart timeframe) - Fast reaction to price
EMA 21: Leave blank or set to 15m - Key pivot level
EMA 50: Set to 1H - Intermediate trend
EMA 100: Set to 4H - Major trend filter
EMA 200: Set to 1D - Overall market bias
Adjust signal settings based on your trading style:
Conservative: Keep all confirmations enabled
Aggressive: Disable volume or momentum requirements
Scalping: Reduce min EMA separation to 0.2-0.3%
Step 2: Reading the Dashboard
Before taking any trade, check the dashboard:
Trend: Only take LONG signals in bullish trends, SHORT signals in bearish trends
Position: Confirm price is on the correct side of EMAs
Volume: Green spike = strong confirmation
RSI: Avoid extremes (>70 or <30)
Confluence: "Strong" = high probability setup
Separation: "Good" = trending market, avoid "Low" separation
Step 3: Trade Entry
For LONG Trades:
Wait for green triangle to appear below price
Verify dashboard shows:
Bullish or Neutral trend
Volume spike (preferred)
RSI between 50-70
Good separation
Enter at market or on next bar
Set stop loss at: Entry - (ATR × 2)
Set target at: Entry + (ATR × 4)
For SHORT Trades:
Wait for red triangle to appear above price
Verify dashboard shows:
Bearish or Neutral trend
Volume spike (preferred)
RSI between 30-50
Good separation
Enter at market or on next bar
Set stop loss at: Entry + (ATR × 2)
Set target at: Entry - (ATR × 4)
Step 4: Trade Management
Use the ATR values from dashboard for position sizing
Trail stops using the fastest EMA (EMA 9) as price moves in your favor
Exit partial position at 1:1 risk-reward, let remainder run to target
Exit immediately if dashboard trend changes against your position
💡 Best Practices
Timeframe Recommendations:
Scalping: 1m-5m chart with 5m, 15m, 1H, 4H, 1D EMAs
Day Trading: 5m-15m chart with 15m, 1H, 4H, 1D EMAs
Swing Trading: 1H-4H chart with 4H, 1D, 1W EMAs
Position Trading: 1D chart with 1D, 1W, 1M EMAs
Market Conditions:
Best in: Trending markets with clear direction
Avoid: Tight consolidation, low volume periods, major news events
Filter trades: Only take signals aligned with higher timeframe trend
Risk Management:
Never risk more than 1-2% per trade
Use ATR from dashboard to calculate position size
Respect the stop loss levels
Don't force trades when dashboard shows weak conditions
⚙️ Customization Options
EMA Settings (for each of 5 EMAs):
Length (period)
Timeframe (multi-timeframe capability)
Color
Line width
Show/hide toggle
Signal Settings:
Volume confirmation (on/off)
Volume spike threshold (1.0-3.0x)
Momentum confirmation (on/off)
RSI overbought/oversold levels
Minimum EMA separation percentage
ATR period and stop multiplier
Display Settings:
Show/hide EMA labels
Show/hide trade signals
Signal marker size (tiny/small/normal/large)
Show/hide dashboard
🔔 Alert Setup
The indicator includes 4 alert conditions:
LONG Signal - Fires when all long confirmations are met
SHORT Signal - Fires when all short confirmations are met
Bullish Setup - Early warning when trend aligns bullish with volume
Bearish Setup - Early warning when trend aligns bearish with volume
To set up alerts:
Right-click on chart → Add Alert
Select "MTF EMA Trading System"
Choose your desired alert condition
Configure notification method (popup, email, SMS, webhook)
📈 Performance Tips
Increase Win Rate:
Only trade in direction of higher timeframe trend
Wait for volume spike confirmation
Avoid trades during first 30 minutes and last 15 minutes of session
Skip trades when separation is "Low"
Reduce False Signals:
Increase minimum EMA separation to 0.7-1.0%
Enable all confirmation requirements
Only trade when confluence shows "Strong"
Combine with support/resistance levels
Optimize for Your Market:
Stocks: Use 9, 21, 50, 100, 200 EMAs
Forex: Consider 8, 13, 21, 55, 89 EMAs (Fibonacci)
Crypto: May need wider ATR multiplier (2.5-3.0x) for volatility
⚠️ Important Notes
This indicator is designed to reduce false signals by requiring multiple confirmations
No indicator is 100% accurate - always use proper risk management
Backtesting recommended before live trading
Market conditions change - adjust settings as needed
Works best in liquid markets with clear price action
🎓 Conclusion
The MTF EMA Trading System transforms simple moving average analysis into a sophisticated, multi-confirmation trading strategy. By combining trend alignment, momentum, volume, and confluence, it helps traders identify high-probability setups while filtering out noise and false signals. The clean interface and comprehensive dashboard make it suitable for both beginners and experienced traders across all markets and timeframes.
Clock&Flow – Market Pulse IndicatorClock&Flow – Market Pulse Indicator
1) General Purpose
The Market Pulse Indicator is designed to visualize the strength and direction of market flow in a clear, intuitive way.
Unlike common volume or momentum indicators, it blends three essential dimensions — price velocity, normalized volume, and volatility (ATR) — to highlight when market pressure is truly meaningful.
It helps identify genuine liquidity inflows/outflows, potential exhaustion zones, and moments of compression or expansion within the price structure.
2) Data Sources
All data is directly taken from the current chart’s feed on TradingView:
Price (close): to measure relative price change.
Volume: to detect the intensity of market participation (normalized to average).
ATR (Average True Range): to evaluate volatility relative to price levels.
No external data or off-platform sources are used.
3) Logic and Calculation Steps
Price Velocity: calculates the percentage change between the current close and the close N bars ago.
priceChange = (close - close ) / close
Normalized Volume: compares current volume to its moving average over the same period.
volNorm = volume / sma(volume, length)
Normalized Volatility: ATR divided by price to adjust for instrument scale.
atrNorm = atr(length) / close
Combination : multiplies the three components into one raw value that represents market pulse intensity.
rawPulse = priceChange * volNorm * (1 + atrNorm)
Smoothing: a moving average (smoothLen) is applied to create a cleaner and more readable oscillator line.
flowPulse = sma(rawPulse * multiplier, smoothLen)
4) Parameters (Default Settings)
length (20): analysis period for price change, volume, and ATR.
smoothLen (5): smoothing factor; higher values reduce noise.
multiplier (100): scales the output for readability; adjust to fit chart scale.
5) How to Read the Indicator
Market Pulse > 0 (green): net inflow of liquidity; buying pressure dominates.
Market Pulse < 0 (red): net outflow of liquidity; selling pressure dominates.
Near 0: neutral phase; market balance or consolidation.
Sudden peaks: strong bursts of flow — often coincide with news releases or session overlaps.
Confirmations: use as a second-level filter before entering trades or to confirm momentum behind a breakout.
6) Divergences
Divergences between price and Market Pulse are key signals of weakening flow strength:
Bullish divergence: price forms lower lows while Market Pulse forms higher lows → selling pressure is fading; potential reversal or bounce.
Bearish divergence: price forms higher highs while Market Pulse fails to confirm → buying momentum is losing strength; potential correction ahead.
For reliability, look for divergences on higher timeframes (H4, Daily).
On lower timeframes, treat them as early warnings.
7) Typical Use Cases
Breakout confirmation: price breaks resistance with a rising Market Pulse → confirms genuine participation.
False signal filter: price breaks a level but Market Pulse remains flat/negative → likely fake breakout.
Pullback entry: after a breakout, wait for a short retracement and a new positive pulse → safer entry point.
Exit signal: if you’re long and Market Pulse suddenly turns negative with strong volume → consider partial exit or tighter stops.
8) Recommended Timeframes
Intraday / Scalping: 5–30 min charts with length 10–14, smoothLen 3–5.
Swing trading: 1h–4h charts with length 20–50.
Position trading: Daily charts with larger length (50–100) for smoother data.
Always optimize parameters to the specific asset — there are no universal settings.
9) Limitations
This indicator is not a trading system — it’s a decision-support tool.
Results depend on the quality of the volume data available for the symbol.
Performance and sensitivity are influenced by length, smoothing, and multiplier values — always test before live trading.
Use alongside sound risk and money management.
10) Disclaimer
This script is provided for educational purposes only and does not constitute financial advice.
Trading and investing involve significant risk, including the potential loss of capital.
Always test indicators in simulation environments and make independent decisions based on your own analysis and risk tolerance.
Italiano
1) Scopo generale
Flow Pulse è un oscillatore pensato per visualizzare la forza e la direzione del flusso di mercato in modo immediato. Non è un semplice indicatore di volume né una copia di RSI/MACD: combina tre dimensioni fondamentali — variazione di prezzo, volume normalizzato e volatilità — per mettere in evidenza i momenti in cui la pressione dei partecipanti è realmente significativa.
È ideale per identificare: entrate guidate da flussi reali, potenziali esaurimenti, momenti di compressione/espansione del movimento e segnali di conferma per breakout o rimbalzi.
2) Dati utilizzati
L’indicatore usa esclusivamente dati disponibili sulla piattaforma TradingView del grafico corrente:
price (close) — per calcolare la variazione percentuale del prezzo;
volume per misurare l’intensità degli scambi (normalizzato su media);
ATR (Average True Range) — per normalizzare la volatilità rispetto al prezzo;
Tutti i feed (prezzo e volume) sono quelli forniti dall’exchange/fornitore dati collegato al simbolo sul grafico.
3) Logica e passaggi di calcolo
Velocità del prezzo: calcolo della variazione percentuale tra la chiusura corrente e la chiusura N barre fa:
priceChange = (close - close ) / close
— misura la direzione e magnitudine del movimento in termine relativo.
Volume normalizzato: rapporto tra il volume corrente e la media mobile semplice del volume su length barre:
volNorm = volume / sma(volume, length)
— evidenzia volumi anomali rispetto alla media.
Volatilità normalizzata (ATR): rapporto ATR/close per rendere la volatilità comparabile across price levels:
atrNorm = atr(length) / close
Combinazione: il prodotto di questi fattori (con un piccolo offset su ATR) genera un valore grezzo:
rawPulse = priceChange * volNorm * (1 + atrNorm)
— se priceChange e volNorm sono positivi e l’ATR è presente, il rawPulse sarà significativamente positivo.
Smoothing: media mobile semplice (SMA) applicata al rawPulse e moltiplicazione per un fattore scalare (multiplier) per portare il range su livelli leggibili:
flowPulse = sma(rawPulse * multiplier, smoothLen)
4) Parametri esposti (default consigliati)
length (periodo analisi) — default 20: influenza calcolo Δ% e media volumi; allunga la finestra storica.
smoothLen (smussamento) — default 5: smoothing del segnale per ridurre rumore.
multiplier — default 100: fattore di scala per rendere l’oscillatore più leggibile.
5) Interpretazione pratica dei valori
FlowPulse > 0 (verde): predominanza di flusso d’ingresso — pressione d’acquisto. Maggiore il valore, più forte la convinzione (volume + movimento + volatilità).
FlowPulse < 0 (rosso): predominanza di flusso in uscita — pressione di vendita.
Vicino a 0: assenza di flussi netti chiari; mercato piatto o bilanciato.
Picchi repentini: indicano accelerate di flusso — spesso coincidono con rotture, open/close session, news.
Sostegno al trade: usa FlowPulse come conferma prima di entrare su breakout o come avviso di attenzione su esaurimenti.
6) Divergenze (come leggerle)
Le divergenze tra prezzo e FlowPulse sono segnali importanti:
Divergenza rialzista (bullish divergence): prezzo fa nuovi minimi mentre FlowPulse non fa nuovi minimi (o forma minimo relativo più alto) → indica che la spinta di vendita non è supportata da volume/volatilità, possibile inversione/rimbalzo.
Divergenza ribassista (bearish divergence): prezzo fa nuovi massimi mentre FlowPulse non li conferma (o forma massimo relativo più basso) → la spinta d’acquisto è “debole”, possibile esaurimento e inversione.
Note pratiche: cercare divergenze su timeframe maggiori (H4, D) per maggiore attendibilità; sui timeframe minori prendere solo come early warning.
7) Esempi d’uso operativo
Conferma breakout: prezzo rompe resistenza + FlowPulse positivo e crescente → breakout più probabile e con volumi reali.
Filtro per falsi segnali: prezzo rompe ma FlowPulse è piatto/negativo → alto rischio di false breakout.
Entrata per pullback: dopo breakout, attendere un pullback con FlowPulse che torna positivo → ingresso più prudente.
Gestione delle uscite: se sei long e FlowPulse improvvisamente si inverte in negativo su volumi elevati → considerare riduzione posizione o stop.
8) Timeframe consigliati
Intraday / Scalping: M5–M30 con length ridotto (es. 10–14) e smoothLen piccolo.
Swing trading: H1–H4 con length 20–50.
Position trading: D1 con length maggiore per filtrare rumore.
Testa i parametri sul tuo asset e timeframe; nessun parametro è universale.
9) Limitazioni e avvertenze
L’indicatore non è un sistema di trading completo: è un tool di informazione e timing.
Dipende dalla qualità dei dati di volume del simbolo: su alcuni titoli/mercati (es. alcuni ETF, Forex su certi broker) il volume può essere parziale o non rappresentativo.
I valori di margine/multiplier e smoothing influenzano sensibilmente sensibilità e falsi segnali: backtest e ottimizzazione sono raccomandati.
Non usare il solo FlowPulse per entrare su leva elevata senza gestione del rischio12) Disclaimer da inserire
Disclaimer: Questo indicatore è fornito solo a scopo didattico e non costituisce consulenza finanziaria. L’uso comporta rischi: valuta sempre la gestione del rischio e testa su conto demo prima dell’applicazione in reale.
HTF Candle Projection by @TATraderSid(The Journal App Team)HTF Candle Projection Indicator
Overview
A professional multi-timeframe analysis tool that projects Higher Timeframe (HTF) candles onto lower timeframe charts with real-time countdown timer and optional zone highlights.
Key Features
📊 HTF Candle Projection
Visual HTF Candles: Projects last 2-3 HTF candles as transparent boxes with wicks
Color Coding: Green for bullish, red for bearish candles
Configurable Offset: Positions candles to the right of current price action
Clean Design: Minimal chart clutter with professional appearance
⏰ Real-Time Timer Box
Live Countdown: Shows time remaining until next HTF candle close (MM:SS format)
Symbol Display: Current trading pair (e.g., BTCUSDT)
Timeframe Model: Shows current TF to HTF relationship (e.g., 15m–60m)
HTF Bias: Real-time bullish/bearish/neutral bias indication
Top-Right Position: Fixed position that doesn't interfere with chart analysis
🎯 Optional Features
Session Zones: Previous day high/low shaded areas
HTF Levels: Optional HTF high/low reference lines (disabled by default)
Risk/Reward Framework: Structure for manual trade planning
Settings
Main Configuration
Higher Timeframe: Select HTF (default: 60 minutes)
Number of HTF Candles: Display 1-5 historical candles
Offset Bars: Distance from current price action
Show Timer Box: Toggle countdown timer display
Show Session Zones: Optional support/resistance zones
Display Options
Show HTF Levels: Toggle HTF high/low reference lines
Color Customization: Bullish/bearish candle colors
Transparency Settings: Adjustable candle body transparency
Best Use Cases
Multi-Timeframe Analysis
Scalping: Use 5m/15m charts with 1H/4H HTF candles
Swing Trading: Use 1H/4H charts with daily/weekly HTF candles
Trend Confirmation: Align lower TF entries with HTF direction
Timing Entries
HTF Candle Closes: Time entries around HTF candle completions
Bias Changes: Monitor HTF bias shifts for trend changes
Support/Resistance: Use projected HTF levels for key zones
Technical Specifications
Pine Script v6: Latest TradingView scripting version
Real-Time Updates: Uses request.security() for precise HTF data
Performance Optimized: Efficient rendering with minimal resource usage
Cross-Timeframe Compatible: Works on all timeframe combinations
Installation & Usage
Add indicator to chart
Select desired Higher Timeframe
Adjust number of candles and offset
Enable timer box for countdown functionality
Optionally enable session zones and HTF levels
Recommended Settings
For Scalping: 15m chart with 60m HTF, 3 candles, 10 bar offset
For Swing Trading: 1H chart with 240m HTF, 2 candles, 15 bar offset
For Position Trading: 4H chart with 1D HTF, 3 candles, 20 bar offset
Perfect for traders who need precise multi-timeframe analysis with professional visual presentation and real-time timing information.
Scalp Sense AI# Scalp Sense AI (No Repaint)
**Adaptive trend & reversal detector with an AI-driven score, multi-timeframe confirmations, robust volume filters, and a purpose-built Scalping Mode.**
Signals are generated **only on bar close** (no repaint), include structured alert payloads for webhooks, and come with optional ATR-based TP/SL visualization for study and validation.
---
## What it is (in one paragraph)
**Scalp Sense AI** combines classic market structure (DI/ADX, EMA, SMA, Keltner, ATR) with a continuous **AI Score** that fuses RSI normalization, EMA distance (in ATR units), and DI edge into a single, volatility-aware signal. It adaptively gates **trend** and **reversal** entries, applies **HTF confirmation** without lookahead, and enforces **guard rails** (e.g., strong-trend reversal blocking) unless a high-confidence AI override and volume confirmation are present. **Scalping Mode** compresses reaction times and adds micro price-action cues (wick rejections, micro-EMA crosses, small engulfing) to surface more—but disciplined—opportunities.
---
## Non-Repainting Design
* All signals, markers, state, and alerts are computed **after bar close** using `barstate.isconfirmed`.
* HTF data are requested with `lookahead_off`.
* No “future-peeking” constructs are used.
* Result: signals do **not** change after the candle closes.
---
## How the engine works (pipeline overview)
1. **Base metrics**
* **RSI**, **EMA**, **ATR** (+ ATR SMA for regime/volatility), **SMA long & short**, **Keltner** (EMA ± ATR×mult).
* **Manual DI/ADX** for fine control (DM+, DM−, true range smoothing).
2. **Volatility regime**
* Compares ATR to its SMA and scales thresholds by √(ATR/ATR\_SMA) → robust “high\_vol” gating.
3. **Volume & flow**
* **Volume Z-score**, **OBV slope**, and **MFI** (all computed manually) to confirm impulses and filter weak reversals.
4. **Higher-Timeframe confirmation (optional)**
* Imports HTF **PDI/MDI/ADX** and **SMA** (no lookahead) to require alignment when enabled.
5. **AI Score**
* Weighted fusion of **RSI (normalized around 0)**, **EMA distance (in ATR)**, and **DI edge**.
* Smoothed; then its **mean (μ)** and **volatility (σ)** are estimated to form **adaptive bands** (hi/lo), with optional **hysteresis**.
* **Debounce** (M in N bars) avoids flicker; **bias state** persists until truly invalidated.
6. **Signal logic**
* **Trend entries** require AI bias + trend confirmations (DI/ADX/SMA, HTF if enabled), volatility OK, and **anti-breakout** filter.
* **Reversal entries** come in **core**, **early**, and **scalp** flavors (progressively more frequent), guarded by strong-trend blocks that an **AI+volume+ADX-cooling override** can bypass.
7. **Scalping Mode**
* Adaptive parameter contraction (shorter lengths), gentler guards, micro-patterns (wick/engulf/micro-EMA cross), and reduced cooldown to increase high-quality opportunities.
8. **Cooldown & state**
* One signal per side after a configurable spacing in bars; internal “last direction” avoids clustering.
9. **Visualization & alerts**
* **Triangles** for trend, **circles** for reversals (offset by ATR to avoid overlap).
* **Single-line alert payload** (BUY/SELL, reason, AI, volZ, ADX) ready for webhooks.
---
## Signals & visualization
* **Trend Long/Short** → triangle markers (above/below) when:
* AI bias aligns with trend confirmations (DI edge, ADX above threshold, price vs long SMA, optional HTF alignment).
* Volatility regime agrees; **anti-breakout** prevents entries exactly at lookback highs/lows.
* **Reversal Long/Short** → circular markers when:
* **Core**: AI near “loose” band, OBV/MFI/volZ supportive, ADX cooling, DI spread relaxed, PA confirms (crosses/div).
* **Early**: anticipatory patterns (Keltner exhaustion, simple RSI “quasi-divergence”).
* **Scalp**: micro-EMA cross, wick rejection, mini-engulfing, with relaxed guards but AI/volume still in the loop.
* **Markers appear only on the bar that actually emitted the signal** (no repaint); offsets use ATR so shapes don’t overlap.
---
## Alerts (ready for webhooks)
Enable “**Any alert() function call**” and you’ll receive compact, single-line payloads once per bar:
```
action=BUY;reason=reversal-early;ai=0.1375;volZ=0.82;adx=27.5
action=SELL;reason=trend;ai=-0.2210;volZ=0.43;adx=31.9
```
* `action`: BUY / SELL
* `reason`: `trend` | `reversal-core` | `reversal-early` | `reversal-scalp`
* `ai`: current smoothed AI Score at signal bar
* `volZ`: volume Z-score
* `adx`: current ADX
---
## Inputs (exhaustive)
### 1) Core Inputs
* **RSI Length (Base)** (`rsi_length_base`, int)
Base RSI lookback. Shorter = more reactive; longer = smoother.
* **RSI Overbought Threshold** (`rsi_overbought`, int)
Informational for context; RSI is used normalized in the AI fusion.
* **RSI Oversold Threshold** (`rsi_oversold`, int)
Informational; complements visual context.
* **EMA Length (Base)** (`ema_length_base`, int)
Primary adaptive mean; also used for Keltner mid and distance metric.
* **ATR Length (Base)** (`atr_length_base`, int)
Volatility unit for Keltner, SL/TP (debug), and regime detection.
* **ATR SMA Length** (`atr_sma_len`, int)
Smooth baseline for ATR regime; supports “high\_vol” logic.
* **ATR Multiplier Base** (`atr_mult_base`, float)
Scales volatility gating (sqrt-scaled); higher = tighter high-vol requirement.
* **Disable Volatility Filter** (`disable_volatility_check`, bool)
Bypass volatility gating if true.
* **Price Change Period (bars)** (`price_change_period_base`, int)
Simple momentum check (+/−% over N bars) used in trend validation.
* **Base Cooldown Bars Between Signals** (`signal_cooldown_base`, int ≥ 0)
Minimum bars to wait between signals (per side).
* **Trend Confirmation Bars** (`trend_confirm_bars`, int ≥ 1)
Require persistence above/below long SMA for this many bars.
* **Use Higher Timeframe Confirmation** (`use_higher_tf`, bool)
Turn on/off HTF alignment (no repaint).
* **Higher Timeframe for Confirmation** (`higher_tf`, timeframe)
E.g., “60” to confirm M15 with H1; used for HTF PDI/MDI/ADX and SMA.
* **TP as ATR Multiple** (`tp_atr_mult`, float)
For **visual debug** only (drawn after entries); not an order manager.
* **SL as ATR Multiple** (`sl_atr_mult`, float)
For visual debug only.
* **Enable Scalping Mode** (`scalping_mode`, bool)
Compresses lengths/thresholds, unlocks micro-PA modules, reduces cooldown.
* **Show Debug Lines** (`show_debug`, bool)
Plots AI bands, DI/ADX, EMA/SMA, Keltner, vol metrics, and TP/SL (debug).
### 2) AI Score & Thresholds
* **AI Score Smooth Len** (`ai_len`, int)
EMA smoothing over the raw fusion.
* **AI Volatility Window** (`ai_sigma_len`, int)
Window to estimate AI mean (μ) and standard deviation (σ).
* **K High (sigma)** (`ai_k_hi`, float)
Upper band width (σ multiplier) for strong threshold.
* **K Low (sigma)** (`ai_k_lo`, float)
Lower band width (σ multiplier) for loose threshold.
* **Debounce Window (bars)** (`ai_debounce_m`, int ≥ 1)
Rolling window length used by the confirm counter.
* **Min Bars>Thr in Window** (`ai_debounce_n`, int ≥ 1)
Minimum confirmations inside the debounce window to validate a state.
* **Use Hysteresis Thresholds** (`ai_hysteresis`, bool)
Requires crossing back past a looser band to exit bias → fewer whipsaws.
* **Weight DI Edge (0–1)** (`ai_weight_di`, float)
Importance of DI edge within the fusion.
* **Weight EMA Dist (0–1)** (`ai_weight_ema`, float)
Importance of EMA distance (in ATR units).
* **Weight RSI Norm (0–1)** (`ai_weight_rsi`, float)
Importance of normalized RSI.
* **Sensitivity (0–1)** (`sensitivity`, float)
Contracts/expands bands (higher = more sensitive).
### 3) Volume Filters
* **Volume MA Length** (`vol_ma_len`, int)
Baseline for volume Z-score.
* **Volume Z-Score Window** (`vol_z_len`, int)
Std-dev window for Z-score; larger = fewer volume “spikes”.
* **Reversal: Min Volume Z for confirm** (`vol_rev_min_z`, float)
Minimum Z required to validate reversals (adaptively relaxed in scalping).
* **OBV Slope Lookback** (`obv_slope_len`, int)
Rising/falling OBV over this window supports bull/bear confirmations.
* **MFI Length** (`mfi_len`, int)
Money Flow Index lookback (manual calculation).
### 4) Filters (Breakout / ADX / Reversal)
* **Enable Breakout Filter** (`enable_breakout_fil`, bool)
Avoid trend entries at lookback highs/lows.
* **Breakout Lookback Bars** (`breakout_lookback`, int ≥ 1)
Window for the anti-breakout guard.
* **Base ADX Length** (`adx_length_base`, int)
Lookback for DI/ADX smoothing (also adapted in Scalping Mode).
* **Base ADX Threshold** (`adx_threshold_base`, float)
Minimum ADX to validate trend context (scaled in Scalping Mode).
* **Enable Reversal Filter** (`enable_rev_filter`, bool)
Master switch for reversal logic.
* **Max ADX for Reversal** (`rev_adx_max`, float)
Hard cap: above this ADX, reversals are blocked (unless overridden by AI if allowed in Guards).
### 5) Reversal Guard (regime protection & overrides)
* **Strong Trend: ADX add-above Thr** (`guard_adx_add`, float)
Extra ADX above `adx_threshold` to mark “strong” trend.
* **Strong Trend: min DI spread** (`guard_spread_min`, float)
Minimum DI separation to consider a trend “dominant”.
* **Require ADX drop from window max (%)** (`guard_adx_drop_min_pct`, float 0–1)
ADX must drop at least this fraction from its window maximum to consider “cooling”.
* **Regime Window (bars)** (`guard_regime_len`, int ≥ 10)
Window over which ADX max is measured for the “cooling” check.
* **EMA Slope Lookback** (`guard_slope_len`, int ≥ 2)
EMA slope horizon used alongside Keltner for strong-trend identification.
* **Keltner Mult (ATR)** (`guard_kc_mult`, float)
Keltner width for strong trend bands and exhaustion checks.
* **HTF Reversal Block Mode** (`htf_block_mode`, string: `Off` | `On` | `AI-controlled`)
* `Off`: never block by HTF.
* `On`: block reversals whenever HTF is strong.
* `AI-controlled`: block **unless** AI+volume+ADX-cooling override criteria are met.
* **AI-controlled: allow AI override** (`ai_htf_override`, bool)
Enables the override mechanism in `AI-controlled` mode.
* **AI override multiplier (vs band\_hi)** (`ai_override_mult`, float)
Strength needed beyond the high band to count as “strong AI”.
* **AI override: min bars beyond strong thr** (`ai_override_min_bars`, int ≥ 1)
Debounce on the override itself.
### 6) Markers
* **Reversal Circle ATR Offset** (`rev_marker_offset_atr`, float ≥ 0)
Vertical offset for reversal circles; trend triangles use a separate (internal) offset.
### 7) Scalping Mode Tuning
* **Reversal aggressiveness (0–1)** (`scalp_rev_aggr`, float)
Higher = looser guards and stronger AI sensitivity.
* **Wick: body multiple (bull/bear)** (`scalp_wick_body_mult`, float)
Wick must be at least this multiple of body to count as rejection.
* **Wick: ATR multiple (min)** (`scalp_wick_atr_mult`, float)
Minimal wick length in ATR units.
* **Micro EMA factor (vs EMA base)** (`scalp_ema_fast_factor`, float 0.2–0.9)
Fast EMA length = base EMA × factor (rounded/int).
* **Relax breakout filter in scalping** (`scalp_breakout_relax`, bool)
Lets more trend entries through in scalping context.
### 8) ICT-style SMA (bases)
* **ICT SMA Long Length (Base)** (`sma_long_len_base`, int)
Long-term baseline for regime/trend.
* **ICT SMA Short1 Length (Base)** (`sma_short1_len_base`, int)
Short baseline for price-action crosses.
* **ICT SMA Short2 Length (Base)** (`sma_short2_len_base`, int)
Companion short baseline used in PA cross checks.
> **Adaptive “effective” values:** When **Scalping Mode** is ON, the script internally shortens multiple lengths (RSI/EMA/ATR/ADX/μσ windows, SMAs) and gently relaxes guards (ADX drop %, DI spread, volume Z, override thresholds), reduces cooldown/confirm bars, and optionally relaxes the breakout filter—so you get **more frequent but still curated** signals.
---
## Plots & debug (optional)
* DI+/DI−, ADX (curr + HTF), EMA, long SMA, Keltner up/down (when strong), AI Score, AI mean, AI bands (hi/lo; low plots only when hysteresis is on), Volume MA and Z-score, and ATR-based TP/SL guide (after entries).
* These are **study aids**; the indicator does not manage trades.
---
## Recommended use
* **Timeframes**:
* Scalping Mode: M1–M15.
* Standard Mode: M15–H1 (or higher).
* **Markets**: Designed for liquid FX, indices, metals, and large-cap crypto.
* **Chart type**: Standard candles recommended (Heikin-Ashi alters inputs and hence signals).
* **Alerts**: Use “Any alert() function call”. Parse the key/value payloads server-side.
---
## Good to know
* **Why some alerts don’t draw shapes retroactively**: markers are drawn **only on** the bar that emitted the signal (no repaint by design).
* **Why a reversal didn’t fire**: strong-trend guards + HTF block may have been active; check ADX, DI spread, Keltner position, EMA slope, and whether AI override criteria were met.
* **Too many / too few signals**: tune **Scalping Mode**, `signal_cooldown_base`, AI bands (`ai_k_hi/lo`, `sensitivity`), volume Z (`vol_rev_min_z`), and guards (`rev_adx_max`, `guard_*`).
---
## Disclaimer
This is an **indicator**, not a strategy or an execution system. It does not place, modify, or manage orders. Markets carry risk—validate on historical data and demo before any live decisions. No performance claims are made.
---
### Version
**Scalp Sense AI v11.5** — Adaptive AI bands with hysteresis/debounce, HTF no-lookahead confirmations, guarded reversal logic with AI override, full volume suite (Z, OBV slope, MFI), anti-breakout filter, and a dedicated Scalping Mode with micro-PA cues.
BUY & SELL Dynamic DCA StrategyOverview
The BUY & SELL Dynamic DCA Strategy is a versatile Pine Script indicator designed for traders seeking a robust Dollar Cost Averaging (DCA) approach to manage both long and short positions across various market conditions and timeframes. This innovative tool combines breakout-based level initiation with a dynamic volatility adjustment, enabling traders to enter positions at optimal DCA points, average them strategically, and manage risk with adjustable stop-loss and take-profit levels. Ideal for scalping on short timeframes (1-minute, 5-minute) or swing trading on longer ones (15-minute, 1-hour, 4-hour).
Purpose and Originality
The "BUY & SELL Dynamic DCA Strategy" stands out by integrating several trading concepts into a cohesive, trader-friendly system. While it leverages familiar elements like breakout points and ATR (Average True Range), its originality lies in:
Dynamic Volatility Adjustment: A custom volatility factor, derived from a capped ATR calculation, dynamically scales DCA entry, averaging, and stop-loss levels. This ensures the strategy adapts to market conditions, tightening in low volatility for scalping and widening in high volatility for swing trading.
Dual-Direction DCA: Supports both buy (long) entries on pullbacks and sell (short) entries on rallies, with tailored averaging and exit strategies for each.
Timeframe Versatility: Adjusts its sensitivity based on the chart timeframe, making it suitable for rapid scalping or longer-term trend riding without requiring manual recalibration.
This unique synthesis justifies its publication as a invite-only script, offering a practical tool that enhances traditional DCA methods with adaptive precision.
How It Works
The indicator operates through a multi-step process designed to optimize entry, averaging, and exit points:
1. Initial Level Setting:
Utilizes high and low threshold (calculated over a user-defined period) to establish initial DCA entry levels. If no threshold is detected, it defaults to the previous bar’s price, ensuring immediate applicability.
2. Dynamic DCA Entry:
Entry levels are adjusted using a proprietary volatility factor, which scales the distance from the current price. Long entries trigger when the price falls below this level, while short entries trigger when the price rises above it, with a volume confirmation filter to reduce noise.
3. Averaging Mechanism:
A secondary level (Averaging Level) allows traders to add to their position when the price moves further against the trade (down for longs, up for shorts). This level is also volatility-adjusted, providing a structured cost-reduction strategy.
4. Risk and Reward Management:
A Final Stop-Loss (Final SL) is set farther out, calculated as a multiple of the volatility-adjusted risk distance, offering protection after averaging.
Take-Profit (TP) levels are determined using a user-defined risk-to-reward ratio, ensuring a balanced exit strategy tailored to market movement.
5. Performance Tracking:
A real-time win/loss table in the top-right corner records trade outcomes, with wins and losses color-coded based on the trade direction (green/red for long, red/green for short), aiding performance evaluation.
Features
1. Dual-Mode Operation : Facilitates both long entries on price dips and short entries on price surges, adaptable to bullish and bearish markets.
2. Volatility-Adaptive Levels: Employs a custom ATR-based adjustment to scale entry, averaging, and stop-loss levels, enhancing responsiveness across timeframes.
3. Visual Tools: Features dashed lines and labels for DCA Entry (green for long, red for short), Final SL (red), and TP (cyan), with debug labels for entries and averages.
4. Timeframe Flexibility: Automatically adjusts threshold periods and volatility factors based on the chart timeframe (1m, 5m, 15m, 1h, 4h), optimizing for scalping or swing trading.
5. Customizable Parameters: Allows fine-tuning of period, DCA factors, and visibility options.
Settings
Base Length (default: 10): Base period for pivot calculations, scaled by timeframe (e.g., 10 becomes 20 on 5m).
Type: 'Wicks' (high/low) or 'Body' (open/close) for price-based levels.
RR Ratio (default: 1.2): Risk-to-reward ratio for TP calculation.
DCA Entry Factor (default: 1.0): Multiplier for volatility-adjusted DCA entry distance.
Avg Level Factor (default: 2.0): Multiplier for averaging level distance.
Final SL Factor (default: 3.0): Multiplier for final stop-loss distance.
SL Type: 'Close' or 'High/Low' for stop-loss evaluation.
Show DCA Entry, Show Avg Level, Show Final SL: Toggle visibility of respective lines.
Show Win/Loss Table: Enable/disable performance tracking.
Line Style: Select 'Solid', 'Dashed', or 'Dotted'.
Usage Instructions
1. Application:
Add the "BUY & SELL Dynamic DCA Strategy - JOAT" via the Pine Editor or community scripts on TradingView.
2. Configuration:
Scalping (1m, 5m): Set Base Length to 5-10, use a low DCA Entry Factor (0.5-1.0) for tight entries, and a Final SL Factor of 2.0-3.0.
Swing Trading (15m, 1h, 4h): Increase Base Length to 15-20, use a higher DCA Entry Factor (1.0-2.0), and set Final SL Factor to 3.0-4.0 for wider stops.
Enable visual elements and adjust Line Style as preferred.
3. Signal Interpretation:
Long Trade: A green dashed "DCA Entry" line below the price triggers a "Long Entry" label on crossover down.
Short Trade: A red dashed "DCA Entry" line above the price triggers a "Short Entry" label on crossover up.
Averaging: A yellow "Avg" label (long) or magenta "Avg" label (short) appears at the respective averaging level.
Exits: TP (cyan) for wins, Final SL (red) for losses, tracked in the win/loss table.
Trade Management:
Scalping: Use 1m/5m for quick trades, averaging as price moves against you.
Swing Trading: Use 15m/1h/4h to capture trends, averaging for cost adjustment.
Manually adjust position size for averaging based on risk tolerance.
5. Performance Monitoring:
The top-right table updates with wins (green/red) and losses (red/green) per trade type, helping assess strategy effectiveness.
Limitations
Manual Averaging: Requires manual position size adjustment at the Averaging Level; automation is not included.
Timeframe Sensitivity: May require parameter tuning for optimal performance across 1m to 4h.
No Trend Filter: Sideways markets may generate noise; adding a trend indicator could enhance accuracy (future development).
Initialization Delay: First trade may be delayed until a pivot is detected, using the current price as a fallback.
Originality Justification
The custom volAdj method, which caps ATR at a percentage of price and scales it by timeframe, offering a unique volatility adjustment not found in standard indicators.
The dual-direction DCA with averaging, combining long and short strategies with volatility-modulated levels, providing a comprehensive trading framework.
The timeframe-adaptive design, automatically adjusting pivot periods and volatility factors, making it a versatile tool across scalping and swing trading.
HilalimSBHilalimSB A Wedding Gift 🌙
HilalimSB - Revealing the Secrets of the Trend
HilalimSB is a powerful indicator designed to help investors analyze market trends and optimize trading strategies. Designed to uncover the secrets at the heart of the trend, HilalimSB stands out with its unique features and impressive algorithm.
Hilalim Algorithm and Fixed ATR Value:
HilalimSB is equipped with a special algorithm called "Hilalim" to detect market trends. This algorithm can delve into the depths of price movements to determine the direction of the trend and provide users with the ability to predict future price movements. Additionally, HilalimSB uses its own fixed Average True Range (ATR) value. ATR is an indicator that measures price movement volatility and is often used to determine the strength of a trend. The fixed ATR value of HilalimSB has been tested over long periods and its reliability has been proven. This allows users to interpret the signals provided by the indicator more reliably.
ATR Calculation Steps
1.True Range Calculation:
+ The True Range (TR) is the greatest of the following three values:
1. Current high minus current low
2. Current high minus previous close (absolute value)
3. Current low minus previous close (absolute value)
2.Average True Range (ATR) Calculation:
-The initial ATR value is calculated as the average of the TR values over a specified period
(typically 14 periods).
-For subsequent periods, the ATR is calculated using the following formula:
ATRt=(ATRt−1×(n−1)+TRt)/n
Where:
+ ATRt is the ATR for the current period,
+ ATRt−1 is the ATR for the previous period,
+ TRt is the True Range for the current period,
+ n is the number of periods.
Pine Script to Calculate ATR with User-Defined Length and Multiplier
Here is the Pine Script code for calculating the ATR with user-defined X length and Y multiplier:
//@version=5
indicator("Custom ATR", overlay=false)
// User-defined inputs
X = input.int(14, minval=1, title="ATR Period (X)")
Y = input.float(1.0, title="ATR Multiplier (Y)")
// True Range calculation
TR1 = high - low
TR2 = math.abs(high - close )
TR3 = math.abs(low - close )
TR = math.max(TR1, math.max(TR2, TR3))
// ATR calculation
ATR = ta.rma(TR, X)
// Apply multiplier
customATR = ATR * Y
// Plot the ATR value
plot(customATR, title="Custom ATR", color=color.blue, linewidth=2)
This code can be added as a new Pine Script indicator in TradingView, allowing users to calculate and display the ATR on the chart according to their specified parameters.
HilalimSB's Distinction from Other ATR Indicators
HilalimSB emerges with its unique Average True Range (ATR) value, presenting itself to users. Equipped with a proprietary ATR algorithm, this indicator is released in a non-editable form for users. After meticulous testing across various instruments with predetermined period and multiplier values, it is made available for use.
ATR is acknowledged as a critical calculation tool in the financial sector. The ATR calculation process of HilalimSB is conducted as a result of various research efforts and concrete data-based computations. Therefore, the HilalimSB indicator is published with its proprietary ATR values, unavailable for modification.
The ATR period and multiplier values provided by HilalimSB constitute the fundamental logic of a trading strategy. This unique feature aids investors in making informed decisions.
Visual Aesthetics and Clear Charts:
HilalimSB provides a user-friendly interface with clear and impressive graphics. Trend changes are highlighted with vibrant colors and are visually easy to understand. You can choose colors based on eye comfort, allowing you to personalize your trading screen for a more enjoyable experience. While offering a flexible approach tailored to users' needs, HilalimSB also promises an aesthetic and professional experience.
Strong Signals and Buy/Sell Indicators:
After completing test operations, HilalimSB produces data at various time intervals. However, we would like to emphasize to users that based on our studies, it provides the best signals in 1-hour chart data. HilalimSB produces strong signals to identify trend reversals. Buy or sell points are clearly indicated, allowing users to develop and implement trading strategies based on these signals.
For example, let's imagine you wanted to open a position on BTC on 2023.11.02. You are aware that you need to calculate which of the buying or selling transactions would be more profitable. You need support from various indicators to open a position. Based on the analysis and calculations it has made from the data it contains, HilalimSB would have detected that the graph is more suitable for a selling position, and by producing a sell signal at the most ideal selling point at 08:00 on 2023.11.02 (UTC+3 Istanbul), it would have informed you of the direction the graph would follow, allowing you to benefit positively from a 2.56% decline.
Technology and Innovation:
HilalimSB aims to enhance the trading experience using the latest technology. With its innovative approach, it enables users to discover market opportunities and support their decisions. Thus, investors can make more informed and successful trades. Real-Time Data Analysis: HilalimSB analyzes market data in real-time and identifies updated trends instantly. This allows users to make more informed trading decisions by staying informed of the latest market developments. Continuous Update and Improvement: HilalimSB is constantly updated and improved. New features are added and existing ones are enhanced based on user feedback and market changes. Thus, HilalimSB always aims to provide the latest technology and the best user experience.
Social Order and Intrinsic Motivation:
Negative trends such as widespread illegal gambling and uncontrolled risk-taking can have adverse financial effects on society. The primary goal of HilalimSB is to counteract these negative trends by guiding and encouraging users with data-driven analysis and calculable investment systems. This allows investors to trade more consciously and safely.
vvvip2025// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
//@version=5
indicator("Joker", overlay=true, max_lines_count=500, max_labels_count=500, max_boxes_count=350)
bullcolor = #16e045
bearcolor = #e1320f
gr_customalert = "CUSTOM ALERTS CREATOR"
gr_signal = "MAIN SETTINGS"
gr_Basic_Settings = "BASIC SETTINGS"
gr_PullBacksignal = "PULLBACK SIGNALS SETTINGS"
gr_Other_Settings = "CLOUD SETTINGS"
gr_TrendTracer = "TREND TRACER SETTINGS"
gr_signalfilter = "SIGNAL FILTERS"
gr_candle = "CANDLE COLORING"
gr_RiskManage = "RISK MANAGEMENT"
gr_dash = "SMART PANEL"
gr_Conso = "CONSOLIDATION ZONE"
// Get user input
showSignals = input(true, "Show Signal's", group=gr_signal)
//showSignals = true
sensitivity = input.float(3.1, "Sensitivity", 0.1, step=0.1, group=gr_signal)
STuner = input.int(25, "Signal Tuner(1-25)", minval = 1, maxval = 25, group=gr_signal)
Presets = input.string("All Signals", "Presets", , group=gr_signal)
TextStyle = input.string("Minimal", "Signal Style", , group=gr_signal)
consSignalsFilter = input(false, "Trending Signal Only", group=gr_signalfilter ,inline = "F1")
StrongSignalsOnly = input(false, "Strong Signals Only", group=gr_signalfilter ,inline = "F1")
highVolSignals = input(false, "High Volume Signals only", group=gr_signalfilter ,inline = "F2")
signalsTrendCloud = input(false, "Cloud Signals only", group=gr_signalfilter ,inline = "F2")
ContrarianOnly = input(false, "Contrarian Signals Only ", group=gr_signalfilter ,inline = "F3")
Show_PR = input.bool(true, title="Show PullBack Signals", group = gr_PullBacksignal , inline = "Features1")
MSTuner = input.int(5, "PullBack Tuner(2-30)", minval = 2, maxval = 30, group=gr_PullBacksignal)
TrendMap = input.string(title='Heatmap Mode', defval='Trend Gradient', options= ,group=gr_candle,tooltip="Use to adjust the bar coloring to indicate market sentiment")
momentumCandles = input(false, "No Momentum Candles", group=gr_candle)
LongTrendAverage = input(true, 'Trend Tracer', group = gr_TrendTracer, tooltip='Places A EMA Which have a trend filtering capability \n \nTrend Cloud Line (EMA), Will Be Shown On The Chart')
LTAsensitivity = input.int(250, 'Trend Tracer Length', group=gr_TrendTracer)
showTrendCloud = input(true, "Show Trend cloud", group=gr_Other_Settings)
periodTrendCloud = input.string("Smooth", "Trend Cloud Style", , group=gr_Other_Settings)
//ScalpingPlus = input(false, "Fast trend cloud", group=gr_Other_Settings)
//fastTrendCloudLen = input.int(55, "Fast trend cloud", 2, group=gr_Other_Settings)
fastTrendCloudLen = 55
showDashboard = input(true, "Smart Panel", group = gr_dash , inline = "Features1")
locationDashboard = input.string("Bottom Right", "Table Location", , group = gr_dash , tooltip="Smart Panel")
sizeDashboard = input.string("Small", "Table Size", , group = gr_dash , tooltip="Smart Panel")
tpLabels = input(true, "Dynamic Take Profit Lables", group=gr_RiskManage)
ShowTpSlAreas = input(true, "Show take Profit/Stop-loss Area", group=gr_RiskManage)
ShowTrailingSL = input(false, "Show trailing Stop-loss", group=gr_RiskManage)
usePercSL = input(false, "SL/TRAILING", inline="1", group=gr_RiskManage)
percTrailingSL = input.float(1, "", 0, step=0.1, inline="1", group=gr_RiskManage)
useTP1 = input(true, "", inline="1", group=gr_RiskManage)
multTP1 = input.float(1, "TP 1", 0, inline="1", group=gr_RiskManage)
useTP2 = input(true, "", inline="4", group=gr_RiskManage)
multTP2 = input.float(2, "TP 2 ", 0, inline="4", group=gr_RiskManage)
useTP3 = input(true, "", inline="4", group=gr_RiskManage)
multTP3 = input.float(3, "TP 3", 0, inline="4", group=gr_RiskManage)
ShowSwings = input(false, "Show Market Structure ", inline="3", group=gr_RiskManage)
periodSwings = input.int(10, " ", 2, inline="3", group=gr_RiskManage)
//showTS = input(title='Show Trend Shifter', defval=false, group='Contrarian SIGNALS')
length = input.int(50, 'Length', minval=1, group='Contrarian SIGNALS')
SSF = input.int(30, 'Smoothing Factor ', minval=1, group='Contrarian SIGNALS')
CSFSELL = input.int(60, 'OB', minval=1, group='Contrarian SIGNALS' , inline = "SEXY")
CSFBUY = input.int(40, 'OS', minval=1, group='Contrarian SIGNALS', inline = "SEXY")
// showsignals = input(title='Show Signals', defval=false, group='Contrarian SIGNALS')
// Alerts Managemnt
Normalbuy_alert = input.bool(title='Buy Signal ', defval=false, inline = "NB", group=gr_customalert)
Strongbuy_alert = input.bool(title='Strong Buy', defval=false, inline = "NB", group=gr_customalert)
Normalsell_alert = input.bool(title='Sell Signal ', defval=false , inline = "NS", group=gr_customalert)
Strongsell_alert = input.bool(title='Strong Sell', defval=false , inline = "NS", group=gr_customalert)
slalert = input.bool(title='Stop-Loss ', defval=false , inline = "SLTP1", group=gr_customalert)
tp1alert = input.bool(title='Target 1', defval=false , inline = "SLTP1", group=gr_customalert)
tp2alert = input.bool(title='Target 2 ', defval=false , inline = "TP2TP3", group=gr_customalert)
tp3alert = input.bool(title='Target 3', defval=false , inline = "TP2TP3", group=gr_customalert)
bullcrosscloud_alert = input.bool(title='Bullish Cloud', defval=false, inline = "CD", group=gr_customalert)
bearcrosscloud_alert = input.bool(title='Bearish Cloud', defval=false, inline = "CD", group=gr_customalert)
showCons = false
paintCons = false
colorZone = color.white
lbPeriod = 10
lenCons = 5
// Signal Text
SimpleBuy = "Buy"
StrongB = "Strong\nBuy"
SimpleSell = "Sell"
StrongS = "Strong\nSell"
if TextStyle == "Normal"
SimpleBuy := "Buy"
StrongB := "Strong\nBuy"
SimpleSell:= "Sell"
StrongS := "Strong\nSell"
if TextStyle == "Minimal"
SimpleBuy := "Buy"
StrongB := "Strong\nBuy"
SimpleSell:= "Sell"
StrongS := "Strong\nSell"
// Signal Text Color
bullsignalcolor = color.rgb(0, 0, 0)
bearsignalcolor = color.rgb(0, 0, 0)
if TextStyle == "Normal"
bullsignalcolor := color.rgb(0, 0, 0)
bearsignalcolor := color.rgb(0, 0, 0)
if TextStyle == "Minimal"
bullsignalcolor := color.rgb(0, 0, 0)
bearsignalcolor := color.rgb(0, 0, 0)
src = close
RSII = ta.ema(ta.rsi(src, length), SSF)
TR = math.abs(RSII - RSII )
wwalpha = 1 / length
WWMA = 0.0
WWMA := wwalpha * TR + (1 - wwalpha) * nz(WWMA )
ATRRSI = 0.0
ATRRSI := wwalpha * WWMA + (1 - wwalpha) * nz(ATRRSI )
TsFast = ta.ema(ta.rsi(src, length), SSF)
TsUP = TsFast + ATRRSI * 4.236
TsDN = TsFast - ATRRSI * 4.236
TsSlow = 0.0
TsSlow := TsUP < nz(TsSlow ) ? TsUP : TsFast > nz(TsSlow ) and TsFast < nz(TsSlow ) ? TsDN : TsDN > nz(TsSlow ) ? TsDN : TsFast < nz(TsSlow ) and TsFast > nz(TsSlow ) ? TsUP : nz(TsSlow )
Colorh = TsFast > 55 ? color.rgb(255, 0, 0) : TsFast < 45 ? color.rgb(0, 255, 8) : #ffffff
//QQF = plot(TsFast, 'TS FAST', color=color.new(color.maroon, 100), linewidth=2, display=display.none, editable = false)
//QQS = plot(TsSlow, 'TS SLOW', color=color.new(color.white, 100), linewidth=2, display=display.none , editable = false)
//plot(TsFast, color=Colorh, linewidth=2, style=plot.style_area, histbase=50)
//BearLimit = hline(60, color=color.gray, linestyle=hline.style_dashed)
//BullLimt = hline(40, color=color.gray, linestyle=hline.style_dashed)
bulllim = 45
bearlim = 55
BullSignalr = ta.crossover(TsFast, TsSlow) and TsFast < bulllim
BearSignallr = ta.crossunder(TsFast, TsSlow) and TsFast > bearlim
/////////////////////////////////////////////////////////
// Trap Detector
////////////////////////////////////////////////////////
// Functions
wavetrend(src, chlLen, avgLen) =>
esa = ta.ema(src, chlLen)
d = ta.ema(math.abs(src - esa), chlLen)
ci = (src - esa) / (0.015 * d)
wt1 = ta.ema(ci, avgLen)
wt2 = ta.sma(wt1, 3)
f_top_fractal(src) => src < src and src < src and src > src and src > src
f_bot_fractal(src) => src > src and src > src and src < src and src < src
f_fractalize (src) => f_top_fractal(src) ? 1 : f_bot_fractal(src) ? -1 : 0
f_findDivs(src, topLimit, botLimit) =>
fractalTop = f_fractalize(src) > 0 and src >= topLimit ? src : na
fractalBot = f_fractalize(src) < 0 and src <= botLimit ? src : na
highPrev = ta.valuewhen(fractalTop, src , 0)
highPrice = ta.valuewhen(fractalTop, high , 0)
lowPrev = ta.valuewhen(fractalBot, src , 0)
lowPrice = ta.valuewhen(fractalBot, low , 0)
bearSignal = fractalTop and high > highPrice and src < highPrev
bullSignal = fractalBot and low < lowPrice and src > lowPrev
// Get components
= wavetrend(close, 5*MSTuner, 10*MSTuner)
= f_findDivs(wt2, 10, -35)
= f_findDivs(wt2, 40, -70)
wtDivBull = wtDivBull1 or wtDivBull2
wtDivBear = wtDivBear1 or wtDivBear2
plotshape(ta.crossover(wt1, wt2) and Show_PR and wt2 <= -60, "PullBack Buy" , shape.circle, location.belowbar, color.new(bullcolor,60), size=size.tiny)
plotshape(ta.crossunder(wt1, wt2) and Show_PR and wt2 >= 60, "PullBack Sell", shape.circle, location.abovebar, color.new(bearcolor,60), size=size.tiny)
rsi = ta.rsi(close ,14)
// Functions
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1. / 60 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
atr(len) =>
tr = ta.tr
atr = 0.0
atr := nz(atr + (tr - atr ) / len, tr)
supertrend(src, factor, len) =>
atr = ta.atr(len)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if prevSuperTrend == prevUpperBand
direction := close > upperBand ? 1 : -1
else
direction := close < lowerBand ? -1 : 1
superTrend := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
dchannel(len)=>
hh = ta.highest(len)
ll = ta.lowest (len)
trend = 0
trend := close > hh ? 1 : close < ll ? -1 : nz(trend )
trendScalper(show, len1, len2, len3, colorBull, colorBear, colorBarBull, colorBarBear) =>
avgOC = math.avg(open, close)
ha_o = 0.0, ha_o := na(ha_o ) ? avgOC : (ha_o + ohlc4 ) / 2
ema1 = ta.ema(ha_o, len1), ema2 = ta.ema(ha_o, len2), ema3 = ta.ema(ha_o, len3)
ris1 = ema1 > ema1 , ris2 = ema2 > ema2 , ris3 = ema3 > ema3
fal1 = ema1 < ema1 , fal2 = ema2 < ema2 , fal3 = ema3 < ema3
colorEma1 = ris1 ? colorBull : fal1 ? colorBear : na, colorEma2 = ris2 ? colorBull : fal2 ? colorBear : na, colorEma3 = ris3 ? colorBull : fal3 ? colorBear : na
fillEma1 = avgOC > ema1 ? colorBull : avgOC < ema1 ? colorBear : na, fillEma2 = ema1 > ema2 ? colorBull : ema1 < ema2 ? colorBear : na, fillEma3 = ema2 > ema3 ? colorBull : ema2 < ema3 ? colorBear : na
colorBar = close < ema1 and close < ema2 ? colorBarBear : colorBarBull
candlesMom() =>
= ta.macd(close, 2, 4, 3)
(macd > 10 and macd > macd ) or (macd < 10 and macd < macd )
trailingSL(buy, sell, factor, len, usePerc, perc) =>
atr = atr(len)
upperBand = high + (usePerc ? high * (perc / 100) : factor * atr)
lowerBand = low - (usePerc ? low * (perc / 100) : factor * atr)
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or buy ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or sell ? upperBand : prevUpperBand
int direction = na
float stop = na
prevSuperTrend = stop
if prevSuperTrend == prevUpperBand
direction := buy ? 1 : -1
else
direction := sell ? -1 : 1
stop := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
add_to_zz(zz, val, bi) =>
array.unshift(zz, bi)
array.unshift(zz, val)
if array.size(zz) > 12
array.pop(zz)
update_zz(zz, val, bi, dir) =>
if array.size(zz) == 0
add_to_zz(zz, val, bi)
else
if dir == 1 and val > array.get(zz, 0) or dir == -1 and val < array.get(zz, 0)
array.set(zz, 0, val)
array.set(zz, 1, bi)
0
// Get components
vosc = ta.obv - ta.ema(ta.obv, 20)
bs = ta.ema(nz(math.abs((open - close) / (high - low) * 100)), 3)
ema = ta.ema(close, 200)
emaBull = close > ema
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes()
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes()
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep(sym, res, src) =>
bool bull = na
bull := equal_tf(res) ? src : bull
bull := higher_tf(res) ? request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on) : bull
bull_array = request.security_lower_tf(syminfo.tickerid, higher_tf(res) ? str.tostring(f_chartTfInMinutes()) : too_small_tf(res) ? (timeframe.isweekly ? "3" : "10") : res, src)
if array.size(bull_array) > 1 and not equal_tf(res) and not higher_tf(res)
bull := array.pop(bull_array)
array.clear(bull_array)
bull
TF1Bull = securityNoRep(syminfo.tickerid, "1" , emaBull)
TF3Bull = securityNoRep(syminfo.tickerid, "3" , emaBull)
TF5Bull = securityNoRep(syminfo.tickerid, "5" , emaBull)
TF10Bull = securityNoRep(syminfo.tickerid, "10" , emaBull)
TF15Bull = securityNoRep(syminfo.tickerid, "15" , emaBull)
TF30Bull = securityNoRep(syminfo.tickerid, "30" , emaBull)
TF60Bull = securityNoRep(syminfo.tickerid, "60" , emaBull)
TF120Bull = securityNoRep(syminfo.tickerid, "120" , emaBull)
TF240Bull = securityNoRep(syminfo.tickerid, "240" , emaBull)
TF720Bull = securityNoRep(syminfo.tickerid, "720" , emaBull)
TFDBull = securityNoRep(syminfo.tickerid, "1440", emaBull)
ema150 = ta.ema(close, 150)
ema250 = ta.ema(close, 250)
hma55 = ta.hma(close, 55 )
= ta.macd(close, 12, 26, 9)
supertrend = supertrend(close, sensitivity, STuner)
maintrend = dchannel(30)
confBull = (ta.crossover (close, supertrend) or (ta.crossover (close, supertrend) and maintrend < 0)) and macd > 0 and macd > macd and ema150 > ema250 and hma55 > hma55 and maintrend > 0
confBear = (ta.crossunder(close, supertrend) or (ta.crossunder(close, supertrend) and maintrend > 0)) and macd < 0 and macd < macd and ema150 < ema250 and hma55 < hma55 and maintrend < 0
trendcloud = supertrend(ohlc4, periodTrendCloud == "Swing" ? 7 : 4, 10)
hma = periodTrendCloud == "Scalping+" ? ta.hma(close, fastTrendCloudLen) : na
none = close > 0
= ta.dmi(14, 14)
consFilter = adx > 20
ContBear = TsFast > CSFSELL
ContBull = TsFast < CSFBUY
StrongFilter = ta.ema(close, 200)
//volFilter = (ta.ema(volume, 25) - ta.ema(volume, 26)) / ta.ema(volume, 26) > 0
volFilter = (ta.ema(volume, 15) - ta.ema(volume, 20)) / ta.ema(volume, 25) > 0
trendFilter = trendcloud
bull = (Presets == "All Signals" ? ta.crossover (close, supertrend) : confBull and not confBull ) and Presets != "Trend Scalper" and (StrongSignalsOnly ? close > StrongFilter : none) and (ContrarianOnly ? ContBull : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "Smooth" ? ema150 > ema250 : close > trendFilter) : none)
bear = (Presets == "All Signals" ? ta.crossunder(close, supertrend) : confBear and not confBear ) and Presets != "Trend Scalper" and (StrongSignalsOnly ? close < StrongFilter : none) and (ContrarianOnly ? ContBear : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "Smooth" ? ema150 < ema250 : close < trendFilter) : none)
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
= trendScalper(Presets == "Trend Scalper" ? true : false, 5, 9, 21, bullcolor, bearcolor, bullcolor, bearcolor)
trailingStop = trailingSL(bull, bear, 2.2, 14, usePercSL, percTrailingSL)
float _ph = ta.highestbars(high, periodSwings) == 0 ? high : na
float _pl = ta.lowestbars (low, periodSwings) == 0 ? low : na
var _dir = 0, dir_ = _pl and na(_ph) ? -1 : _dir, _dir := _ph and na(_pl) ? 1 : dir_, dirChg = ta.change(_dir)
var zz = array.new_float(0), zzOld = array.copy(zz)
float zzLive = _ph or _pl ? (dirChg ? add_to_zz(zz, _dir == 1 ? _ph : _pl, bar_index) : update_zz(zz, _dir == 1 ? _ph : _pl, bar_index, _dir)) : na
float hb_ = ta.highestbars(lbPeriod) == 0 ? high : na
float lb_ = ta.lowestbars (lbPeriod) == 0 ? low : na
var int dir = 0
float zz_ = na
float pp = na
var int consCnt = 0
var float condHi = na
var float condLo = na
float H_ = ta.highest(lenCons)
float L_ = ta.lowest (lenCons)
var line lineUp = na
var line lineDn = na
bool breakUp = false
bool breakDn = false
var float pvh1_price = array.new_float(1000, na)
var int pvh1_time = array.new_int (1000, na)
var float pvl1_price = array.new_float(1000, na)
var int pvl1_time = array.new_int (1000, na)
var float pvh2_price = array.new_float(1000, na)
var int pvh2_time = array.new_int (1000, na)
var float pvl2_price = array.new_float(1000, na)
var int pvl2_time = array.new_int (1000, na)
var float htcmrll_price = na
var int htcmrll_time = na
var float ltcmrhh_price = na
var int ltcmrhh_time = na
var box long_boxes = array.new_box()
var box short_boxes = array.new_box()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
var buyBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(buyBars, i))
var sellBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(sellBars, i))
// Colors
green = bullcolor, green50 = color.new(green, 50), green20 = color.new(green, 80)
red = bearcolor, red50 = color.new(red, 50), red20 = color.new(red, 80)
silver = #B2B5BE, silver50 = color.new(silver, 50), silver20 = color.new(silver, 80)
// Plots
atrBand = usePercSL ? (trigger ? low : high) * (percTrailingSL / 100) : ta.atr(14) * 2.2
atrStop = trigger ? low - atrBand : high + atrBand
lastTrade(src) => ta.valuewhen(bull or bear, src, 0)
entry_y = lastTrade(close)
stop_y = lastTrade(atrStop)
tp1_y = (entry_y-lastTrade(atrStop))*multTP1 + entry_y
tp2_y = (entry_y-lastTrade(atrStop))*multTP2 + entry_y
tp3_y = (entry_y-lastTrade(atrStop))*multTP3 + entry_y
labelTpSl(cond, y, txt, color) =>
label labelTpSl = ShowTpSlAreas and cond ? label.new(bar_index + 1, y, txt, xloc.bar_index, yloc.price, color, label.style_label_left, color.white, size.normal) : na
label.delete(labelTpSl )
labelTpSl(none, entry_y, "Entry : " + str.tostring(math.round_to_mintick(entry_y)), color.orange)
labelTpSl(none, stop_y , "Stop loss : " + str.tostring(math.round_to_mintick(atrStop)), bearcolor)
labelTpSl(useTP1 and multTP1 != 0, tp1_y, "TP 1 : " + str.tostring(math.round_to_mintick(tp1_y)), bullcolor)
labelTpSl(useTP2 and multTP2 != 0, tp2_y, "TP 2 : " + str.tostring(math.round_to_mintick(tp2_y)), bullcolor)
labelTpSl(useTP3 and multTP3 != 0, tp3_y, "TP 3 : " + str.tostring(math.round_to_mintick(tp3_y)), bullcolor)
lineTpSl(cond, y, color, style) =>
line lineTpSl = ShowTpSlAreas and cond ? line.new(bar_index - (trigger ? countBull : countBear), y, bar_index + 1, y, xloc.bar_index, extend.none, color, style) : na
line.delete(lineTpSl )
lineTpSl(none, entry_y, color.orange, line.style_dashed)
lineTpSl(none, stop_y , bearcolor , line.style_solid )
lineTpSl(useTP1 and multTP1 != 0, tp1_y, bullcolor, line.style_dotted)
lineTpSl(useTP2 and multTP2 != 0, tp2_y, bullcolor, line.style_dotted)
lineTpSl(useTP3 and multTP3 != 0, tp3_y, bullcolor, line.style_dotted)
buy = showSignals and bull ? label.new(bar_index, low , close > StrongFilter ? StrongB : SimpleBuy , xloc.bar_index, yloc.belowbar, bullcolor, label.style_label_up , bullsignalcolor, size.normal) : na
sell = showSignals and bear ? label.new(bar_index, high, close < StrongFilter ? StrongS : SimpleSell , xloc.bar_index, yloc.abovebar, bearcolor , label.style_label_down, bearsignalcolor, size.normal) : na
tpLabels(tp) =>
tp1Bull = ta.crossover (rsi, 70), tp2Bull = ta.crossover (rsi, 75), tp3Bull = ta.crossover (rsi, 80)
tp1Bear = ta.crossunder(rsi, 30), tp2Bear = ta.crossunder(rsi, 25), tp3Bear = ta.crossunder(rsi, 20)
tp1Bull := tp1Bull and (nz(ta.barssince(tp1Bull) , 9999) > countBull), tp2Bull := tp2Bull and (ta.barssince(tp1Bull) <= countBull), tp2Bull := tp2Bull and (nz(ta.barssince(tp2Bull) , 9999) > countBull), tp3Bull := tp3Bull and (ta.barssince(tp2Bull) <= countBull), tp3Bull := tp3Bull and (nz(ta.barssince(tp3Bull) , 9999) > countBull)
tp1Bear := tp1Bear and (nz(ta.barssince(tp1Bear) , 9999) > countBear), tp2Bear := tp2Bear and (ta.barssince(tp1Bear) <= countBear), tp2Bear := tp2Bear and (nz(ta.barssince(tp2Bear) , 9999) > countBear), tp3Bear := tp3Bear and (ta.barssince(tp2Bear) <= countBear), tp3Bear := tp3Bear and (nz(ta.barssince(tp3Bear) , 9999) > countBear)
if Presets != "Trend Scalper" and tpLabels
trigger ? (tp == 1 ? tp1Bull : tp == 2 ? tp2Bull : tp3Bull) : (tp == 1 ? tp1Bear : tp == 2 ? tp2Bear : tp3Bear)
plotshape(tpLabels(1), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 1", trigger ? green : na , false)
plotshape(tpLabels(2), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 2", trigger ? green : na , false)
plotshape(tpLabels(3), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 3", trigger ? green : na , false)
plotshape(tpLabels(1), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 1", trigger ? na : red, false)
plotshape(tpLabels(2), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 2", trigger ? na : red, false)
plotshape(tpLabels(3), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 3", trigger ? na : red, false)
var label zzLabel = na
if array.size(zz) > 12 and ShowSwings
if array.get(zz, 0) != array.get(zzOld, 0) or array.get(zz, 1) != array.get(zzOld, 1)
if array.get(zz, 2) == array.get(zzOld, 2) and array.get(zz, 3) == array.get(zzOld, 3)
label.delete(zzLabel)
zzLabel := label.new(math.round(array.get(zz, 1)), array.get(zz, 0), _dir == 1 ? array.get(zz, 0) > array.get(zz, 4) ? ((array.get(zz, 4) < array.get(zz, 8)) ? "High" : "HH") : "LH" : array.get(zz, 0) < array.get(zz, 4) ? ((array.get(zz, 4) > array.get(zz, 8)) ? "Low" : "LL") : "HL", xloc.bar_index, yloc.price, color.new(color.white, 100), _dir == 1 ? label.style_label_down : label.style_label_up, _dir == 1 ? bullcolor : bearcolor)
if showCons and barstate.isconfirmed
dir := hb_ and na(lb_) ? 1 : lb_ and na(hb_) ? -1 : dir
if hb_ and lb_
if dir == 1
zz_ := hb_
else
zz_ := lb_
else
zz_ := hb_ ? hb_ : lb_ ? lb_ : na
for x = 0 to 1000
if na(close) or dir != dir
break
if zz_
if na(pp)
pp := zz_
else
if dir == 1 and zz_ > pp
pp := zz_
if dir == -1 and zz_ < pp
pp := zz_
if pp != pp
if consCnt > lenCons
if pp > condHi
breakUp := true
if pp < condLo
breakDn := true
if consCnt > 0 and pp <= condHi and pp >= condLo
consCnt += 1
else
consCnt := 0
else
consCnt += 1
if consCnt >= lenCons
if consCnt == lenCons
condHi := H_
condLo := L_
else
line.delete(lineUp)
line.delete(lineDn)
condHi := math.max(condHi, high)
condLo := math.min(condLo, low )
lineUp := line.new(bar_index, condHi , bar_index - consCnt, condHi , color=bearcolor , style=line.style_dashed)
lineDn := line.new(bar_index, condLo , bar_index - consCnt, condLo , color=color.lime, style=line.style_dashed)
fill(plot(condHi, "", na, 1, plot.style_stepline, editable=false), plot(condLo, "", na, 1, plot.style_stepline, editable=false), paintCons and consCnt > lenCons ? colorZone : na, "", false)
buy_col = color.new(#0ac20a,0)
sell_col = color.new(#fd1605,0)
text_col = color.new(#FFFFFF,0)
// -------- Bearish trend (blue) color selection --------
getSellColor(count) =>
if count == 1
color.new(#11e7f2,0)
else
if count == 2
color.new(#11d9f2,0)
else
if count == 3
color.new(#11cbf2,0)
else
if count == 4
color.new(#11aff2,0)
else
if count == 5
color.new(#1193f2,0)
else
if count == 6
color.new(#1176f2,0)
else
if count == 7
color.new(#105df4,0)
else
if count == 8
color.new(#1051f5,0)
else
if count == 9
color.new(#0f44f5,0)
else
if count == 10
color.new(#0c3de0,0)
else
if count == 11
color.new(#0935ca,0)
else
if count == 12
color.new(#062eb4,0)
else
if count == 13
color.new(#02269e,0)
// -------- Bullish trend (blue) color selection --------
getBuyColor(count) =>
if count == 1
color.new(#eef211,0)
else
if count == 2
color.new(#efdc11,0)
else
if count == 3
color.new(#f0c511,0)
else
if count == 4
color.new(#f1af11,0)
else
if count == 5
color.new(#f29811,0)
else
if count == 6
color.new(#f28811,0)
else
if count == 7
color.new(#f27811,0)
else
if count == 8
color.new(#f26811,0)
else
if count == 9
color.new(#f25811,0)
else
if count == 10
color.new(#ea420d,0)
else
if count == 11
color.new(#e12c09,0)
else
if count == 12
color.new(#d81605,0)
else
if count == 13
color.new(#cf0000,0)
// -------- Calculate bearish trend sequence --------
buySetup = 0
buySetup := close < close ? buySetup == 13 ? 1 : buySetup + 1 : 0
// -------- Calculate bullish trend sequence --------
sellSetup = 0
sellSetup := close > close ? sellSetup == 13 ? 1 : sellSetup + 1 : 0
// -------- Paint bars --------
barColour = buySetup >= 1 ? getBuyColor(buySetup) : sellSetup >= 1 ? getSellColor(sellSetup) : na
// Candle Coloring
// Input
FastteyLength = 12
SjlowLeyLength = 26
srrrc = close
signalXLength = 9
// Data reference
= ta.macd(srrrc, FastteyLength, SjlowLeyLength, signalXLength)
// 4 level of green
greenHigh = #eeff00
greenMidHigh = #c7ca00
greenMidLow = #ddb500
greenLow = #8635ff
// Yellow
yellowLow = #8635ff
// 4 level of red
redHigh = color.rgb(255, 255, 255)
redMidHigh = #cecece
redMidLow = #dbdbdb
redLow = #8635ff
// Default color
candleBody = yellowLow
// Ranging trend
if histX > 0
if histX > histX and histX > 0
candleBody := greenLow
if histX < 0
if histX < histX and histX < 0
candleBody := redLow
// Bullish trend
if MacdX > 0 and histX > 0
candleBody := greenMidLow
if histX > histX and MacdX > 0 and histX > 0
candleBody := greenMidHigh
if histX > histX and MacdX > 0 and histX > 0
candleBody := greenHigh
// Bearish trend
if MacdX < 0 and histX < 0
candleBody := redMidLow
if histX < histX and MacdX < 0 and histX < 0
candleBody := redMidHigh
if histX < histX and MacdX < 0 and histX < 0
candleBody := redHigh
//barcolor(candleBody)
//barcolor(TrendMap == 'RSI Gradient' ? barColour : na, title='Bar colors (heatmap)',editable=false)
barcolor(momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false)
//plotcandle(open, high, low, close , color = momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false , wickcolor = momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false , bordercolor = momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false , editable = false)
fill(plot(showTrendCloud and periodTrendCloud == "Smooth" ? ema150 : na, "", na, editable=false), plot(showTrendCloud and periodTrendCloud == "Smooth" ? ema250 : na, "", na, editable=false), ema150 > ema250 ? color.new(bullcolor, 70) : ema150 < ema250 ? color.new(bearcolor, 70) : na)
plot(ShowTrailingSL and trigger and nz(ta.barssince(low < trailingStop), bar_index) > countBull ? trailingStop : na, "", green, 1, plot.style_linebr, editable=false)
plot(ShowTrailingSL and not trigger and nz(ta.barssince(high > trailingStop), bar_index) > countBear ? trailingStop : na, "", red , 1, plot.style_linebr, editable=false)
p0 = plot(avgOC, "", na , editable=false)
p1 = plot(ema5 , "", colorEma5 , editable=false)
p2 = plot(ema9 , "", colorEma9 , editable=false)
p3 = plot(ema21, "", colorEma21, editable=false)
plot(LongTrendAverage ? ta.ema(close, LTAsensitivity) : na, 'Trend Tracer', linewidth=2, color=close > ta.ema(close, LTAsensitivity) ? color.new(bullcolor, 45) : color.new(bearcolor, 45))
fill(p0, p1, fillEma5 )
fill(p1, p2, fillEma9 )
fill(p2, p3, fillEma21)
fill(plot(showTrendCloud and periodTrendCloud != "Smooth" and periodTrendCloud != "Scalping+" and trendcloud != 0 and close > trendcloud ? trendcloud : na, "", bullcolor, 1, plot.style_linebr, editable=false), p0, color.new(bullcolor, 90))
fill(plot(showTrendCloud and periodTrendCloud != "Smooth" and periodTrendCloud != "Scalping+" and trendcloud != 0 and close < trendcloud ? trendcloud : na, "", bearcolor , 1, plot.style_linebr, editable=false), p0, color.new(bearcolor , 90))
fill(plot(hma, "", hma > hma ? green : hma < hma ? red : na, editable=false), plot(hma , "", hma > hma ? green : hma < hma ? red : na, editable=false), hma > hma ? green : hma < hma ? red : na)
/////////////////////////////////////////////////////////
// Money Moves
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// Get user input
indicatorTF = "Chart"
// Functions
sqz(bbLen, bbMult, kcLen, kcMult, source) =>
upperBB = ta.sma(source, bbLen) + ta.stdev(source, bbLen) * bbMult
lowerBB = ta.sma(source, bbLen) - ta.stdev(source, bbLen) * bbMult
upperKC = ta.sma(source, kcLen) + ta.sma(ta.tr, kcLen) * kcMult
lowerKC = ta.sma(source, kcLen) - ta.sma(ta.tr, kcLen) * kcMult
sqzOn = lowerBB > lowerKC and upperBB < upperKC
sqzOff = lowerBB < lowerKC and upperBB > upperKC
qqe(rsiLen, rsiSmooth, factor, source, bbLen, bbMult) =>
rsiMa = ta.ema(ta.rsi(source, rsiLen), rsiSmooth)
delta = ta.ema(ta.ema(math.abs(ta.mom(rsiMa, 1)), rsiLen * 2 - 1), rsiLen * 2 - 1) * factor
longBand = 0.0, longBand := rsiMa > longBand and rsiMa > longBand ? math.max(longBand , rsiMa - delta) : rsiMa - delta
shortBand = 0.0, shortBand := rsiMa < shortBand and rsiMa < shortBand ? math.min(shortBand , rsiMa + delta) : rsiMa + delta
cross1 = ta.cross(rsiMa, shortBand )
cross2 = ta.cross(rsiMa, longBand )
trend = 0.0, trend := cross1 ? 1 : cross2 ? -1 : nz(trend , 1)
fastDelta = trend == 1 ? longBand : shortBand
_hist = rsiMa - 50
_line = fastDelta - 50
= ta.bb(_line, bbLen, bbMult)
// Get components
cond(_offset) =>
top = ta.highest(high, 10)
bot = ta.lowest(low, 10)
osc = ta.ema(hlc3, 5) - ta.ema(ohlc4, 20)
oscRis = osc > osc
oscFal = osc < osc
oscA0 = osc > 0
oscB0 = osc < 0
oscTop = oscFal and oscRis
oscBot = oscRis and oscFal
bullR = oscB0 and oscBot and ((osc > ta.valuewhen(oscB0 and oscBot, osc, 1) and bot < ta.valuewhen(oscB0 and oscBot, bot, 1)))
bearR = oscA0 and oscTop and ((osc < ta.valuewhen(oscA0 and oscTop, osc, 1) and top > ta.valuewhen(oscA0 and oscTop, top, 1)))
bullH = oscB0 and oscBot and ((osc < ta.valuewhen(oscB0 and oscBot, osc, 1) and bot > ta.valuewhen(oscB0 and oscBot, bot, 1)))
bearH = oscA0 and oscTop and ((osc > ta.valuewhen(oscA0 and oscTop, osc, 1) and top < ta.valuewhen(oscA0 and oscTop, top, 1)))
= sqz(20, 2, 20, 2, close)
= qqe(6, 6, 3, close, 50, 0.001)
= qqe(6, 5, 1.618, close, 50, 1)
= ta.dmi(14, 14)
[osc , oscRis , oscFal , oscA0 , oscB0 , oscTop , oscBot , bullR , bearR , bullH , bearH , sqzOn , sqzOff , _hist1 , upper1 , lower1 , _hist2 , _line2 , tvr ]
tf = indicatorTF == "Chart" ? timeframe.period : indicatorTF == "1 minute" ? "1" : indicatorTF == "3 minutes" ? "3" : indicatorTF == "5 minutes" ? "5" : indicatorTF == "10 minutes" ? "10" : indicatorTF == "15 minutes" ? "15" : indicatorTF == "30 minutes" ? "30" : indicatorTF == "45 minutes" ? "45" : indicatorTF == "1 hour" ? "60" : indicatorTF == "2 hours" ? "120" : indicatorTF == "3 hours" ? "180" : indicatorTF == "4 hours" ? "240" : indicatorTF == "12 hours" ? "720" : indicatorTF == "1 day" ? "1D" : indicatorTF == "1 week" ? "1W" : indicatorTF == "1 month" ? "1M" : na
= request.security(syminfo.tickerid, tf, cond(indicatorTF != "Chart" and barstate.isrealtime ? 1 : 0))
colorTVR = tvr < 15 ? #F6525F : tvr > 15 and tvr < 25 ? #B2B5BE : #66BB6A
// Plots
//plot(Presets == "Money Moves TrendVR" ? tvr : na, "", colorTVR, editable=false)
TrendText = "Trending"
if tvr < 15 and tvr < 25
TrendText := "No trend"
if tvr > 15 and tvr < 25
TrendText := "Ranging"
//------------------------------------------------------------------------------------------------------- Volatitiry
//Calculates Volatility for Dashboard
atrr = 3 * ta.atr(10)
stdAtr = 2 * ta.stdev(atrr, 20)
smaAtr = ta.sma(atrr, 20)
topAtrDev = smaAtr + stdAtr
bottomAtrDev = smaAtr - stdAtr
calcDev = (atrr - bottomAtrDev) / (topAtrDev - bottomAtrDev)
percentVol = 40 * calcDev + 30
AvrLength = 21
PercentFilter = 144
xAavrVolume = ta.rma(volume, AvrLength)
nResLess = volume * 100 / xAavrVolume < PercentFilter ? 0 : volume
nRes = nResLess
clr = close < open ? color.red : color.green
//plot(nRes, color=clr, style=plot.style_columns, title='Volume Filter', transp=20)
VolitiText = "Inactive"
if nRes
VolitiText := "Active"
//////////////////////////////////////////
ema69 = ta.ema(close, 9)
totalSentTxt = ema69 > ema69 ? 'Bullish' : ema69 < ema69 ? 'Bearish' : 'Flat'
// INputs
//Timezones
tz_incr = 0
use_exchange = false
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
//Session A
NYSes = true
NYTxt = 'New York'
NYTime = '1300-2200'
//Session B
LDSes = true
sesb_txt = 'London'
sesb_ses = '0700-1600'
//Session C
show_sesc = true
sesc_txt = 'Tokyo'
sesc_ses = '0000-0900'
//Session D
show_sesd = true
sesd_txt = 'Sydney'
sesd_ses = '2100-0600'
//-----------------------------------------------------------------------------}
//Sessions
//-----------------------------------------------------------------------------{
tff = timeframe.period
var tz = use_exchange ? syminfo.timezone :
str.format('UTC{0}{1}', tz_incr >= 0 ? '+' : '-', math.abs(tz_incr))
is_sesa = math.sign(nz(time(tff, NYTime, tz)))
is_sesb = math.sign(nz(time(tff, sesb_ses, tz)))
is_sesc = math.sign(nz(time(tff, sesc_ses, tz)))
is_sesd = math.sign(nz(time(tff, sesd_ses, tz)))
////////////////////////////////////////////
SessionText = "Default"
//Session a = Newyork
//Session b = London
//Session c = Tokyo
//Session d = Sydney
if is_sesd
SessionText := sesd_txt
if is_sesc
SessionText := sesc_txt
if is_sesb
SessionText := sesb_txt
if is_sesa
SessionText := NYTxt
if is_sesd and is_sesc
SessionText := "Sydney/Tokyo"
if is_sesb and is_sesc
SessionText := "Tokyo/London"
if is_sesb and is_sesa
SessionText := "London/Newyork"
if is_sesa and is_sesd
SessionText := "Newyork/Sydney"
//-----------------------------------------------------------------------------}
//Overlays color.green : color.red
//-----------------------------------------------------------------------------{
//
var dashboard_loc = locationDashboard == "Top Right" ? position.top_right : locationDashboard == "Middle Right" ? position.middle_right : locationDashboard == "Bottom Right" ? position.bottom_right : locationDashboard == "Top Center" ? position.top_center : locationDashboard == "Middle Center" ? position.middle_center : locationDashboard == "Bottom Center" ? position.bottom_center : locationDashboard == "Top Left" ? position.top_left : locationDashboard == "Middle Left" ? position.middle_left : position.bottom_left
var dashboard_size = sizeDashboard == "Large" ? size.large : sizeDashboard == "Normal" ? size.normal : sizeDashboard == "Small" ? size.small : size.tiny
var dashboard = showDashboard ? table.new(dashboard_loc, 3, 7, color.rgb(30, 34, 45 , 60), #3d384300, 2, color.rgb(30, 34, 45 , 60), 1) : na
dashboard_cell(column, row, txt, signal=false) => table.cell(dashboard, column, row, txt, 0, 0, signal ? #000000 : color.white, text_size=dashboard_size)
dashboard_cell_bg(column, row, col) => table.cell_set_bgcolor(dashboard, column, row, col)
if barstate.islast and showDashboard
// MTF Trend
dashboard_cell(0, 0 , "MTF")
dashboard_cell(0, 2 , "M5") , dashboard_cell_bg(0, 2 , TF5Bull ? color.green : color.red)
dashboard_cell(0, 3 , "M15") , dashboard_cell_bg(0, 3 , TF15Bull ? color.green : color.red)
dashboard_cell(0, 4 , "M30") , dashboard_cell_bg(0, 4 , TF30Bull ? color.green : color.red)
dashboard_cell(0, 5 , "1H") , dashboard_cell_bg(0, 5 , TF60Bull ? color.green : color.red)
dashboard_cell(0, 6 , "4H") , dashboard_cell_bg(0, 6 , TF240Bull ? color.green : color.red)
// Middel part
dashboard_cell(1, 0 , " Double GAMBLER STRATEGY ")
dashboard_cell(1, 2 , "🔥 Market State ")
dashboard_cell(1, 3 , "⚠️ Volatility ")
dashboard_cell(1, 4 , "🏦 Institutional Activity ")
dashboard_cell(1, 5 , "🕒 Current Session (UTC) ")
dashboard_cell(1, 6 , "🌊 Trend Pressure ")
// End part
dashboard_cell(2, 0 , "")
dashboard_cell(2, 2 , TrendText)
dashboard_cell(2, 3 , str.tostring(percentVol, '##.##') + '%')
dashboard_cell(2, 4 , VolitiText)
dashboard_cell(2, 5 , SessionText)
dashboard_cell(2, 6 , totalSentTxt)
// Alerts
f_sl_crossed() =>
ret = false
stop = ShowTrailingSL ? trailingStop : stop_y
crossBull = low >= stop and low < stop and ta.barssince(low >= stop and low < stop ) >= countBull - 1
crossBear = high <= stop and high > stop and ta.barssince(high <= stop and high > stop ) >= countBear - 1
ret := trigger ? crossBull : crossBear
f_tp_crossed(tp) =>
ret = false
profit = tp
crossBull = high <= profit and high > profit and ta.barssince(high <= profit and high > profit ) >= countBull - 1
crossBear = low >= profit and low < profit and ta.barssince(low >= profit and low < profit ) >= countBear - 1
ret := trigger ? crossBull : crossBear
alert01 = (bull and close <= StrongFilter) or (bear and close >= StrongFilter)
alert02 = bull or bear
alert03 = (bull and close > StrongFilter) or (bear and close < StrongFilter)
alert04 = bull and close <= StrongFilter
alert06 = bear and close >= StrongFilter
alert07 = bull and close > StrongFilter
alert08 = bear and close < StrongFilter
alert09 = f_sl_crossed()
alert11 = f_tp_crossed(tp1_y)
alert12 = f_tp_crossed(tp2_y)
alert13 = f_tp_crossed(tp3_y)
alert14 = periodTrendCloud == "Smooth" ? ta.crossunder(ema150, ema250) : (close < trendcloud) and (close > trendcloud)
alert15 = periodTrendCloud == "Smooth" ? ta.crossover (ema150, ema250) : (close > trendcloud) and (close < trendcloud)
//alerts(sym) =>
// if alert01 or alert02 or alert03 or alert04 or alert05 or alert06 or alert07 or alert08 or alert09 or alert10 or alert11 or alert12 or alert13 or alert14 or alert15
// alert("NEW ALERT", alert.freq_once_per_bar_close)
//alerts(syminfo.tickerid)
// Signal Alerts
if alert04 and Normalbuy_alert
alert('Buy Signal Alert !!!' , alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert07 and Strongbuy_alert
alert('Strong Buy Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if (bear and close >= StrongFilter) and Normalsell_alert
alert('Sell Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if (bear and close < StrongFilter) and Strongsell_alert
alert('Strong Sell Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Risk Management Alerts
if alert09 and slalert
alert('SL Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert11 and tp1alert
alert('Target 1 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert12 and tp2alert
alert('Target 2 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert13 and tp3alert
alert('Target 3 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Cloud Alert
if alert15 and bullcrosscloud_alert
alert('Cloud Turned Bullish !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert14 and bearcrosscloud_alert
alert('Cloud Turned Bearish !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
alertcondition(alert01, "Any Signal Contrarian Buy / Contrarian sell", "Buy or Sell")
alertcondition(alert04, "Contrarian Buy alert", "Buy")
alertcondition(alert06, "Contrarian Sell alert", "Sell")
// ==========================================================================================
// === Dashboard with Telegram Link ===
var table myTable = table.new(position.top_center, 1, 1, border_width=1, frame_color=color.black, bgcolor=color.white)
// Add Telegram Message to Dashboard
table.cell(myTable, 0, 0, "Join Telegram @mrexpert_ai", bgcolor=color.blue, text_color=color.white, text_size=size.normal)
bsam11
//@version=5
indicator("bsam11", overlay=true, max_lines_count=500, max_labels_count=500, max_boxes_count=350)
bullcolor = color.rgb(60, 192, 17)
bearcolor = #e21818
gr_customalert = "CUSTOM ALERTS CREATOR"
gr_signal = "MAIN SETTINGS"
gr_Basic_Settings = "BASIC SETTINGS"
gr_PullBacksignal = "PULLBACK SIGNALS SETTINGS"
gr_Other_Settings = "CLOUD SETTINGS"
gr_TrendTracer = "TREND TRACER SETTINGS"
gr_signalfilter = "SIGNAL FILTERS"
gr_candle = "CANDLE COLORING"
gr_RiskManage = "RISK MANAGEMENT"
gr_dash = "SMART PANEL"
gr_Conso = "CONSOLIDATION ZONE"
// Get user input
showSignals = input(true, "Show Signal's", group=gr_signal)
//showSignals = true
sensitivity = input.float(3.1, "Sensitivity", 0.1, step=0.1, group=gr_signal)
STuner = input.int(25, "Signal Tuner(1-25)", minval = 1, maxval = 25, group=gr_signal)
Presets = input.string("All Signals", "Presets", , group=gr_signal)
TextStyle = input.string("Minimal", "Signal Style", , group=gr_signal)
consSignalsFilter = input(false, "Trending Signal Only", group=gr_signalfilter ,inline = "F1")
StrongSignalsOnly = input(false, "Strong Signals Only", group=gr_signalfilter ,inline = "F1")
highVolSignals = input(false, "High Volume Signals only", group=gr_signalfilter ,inline = "F2")
signalsTrendCloud = input(false, "Cloud Signals only", group=gr_signalfilter ,inline = "F2")
ContrarianOnly = input(false, "Contrarian Signals Only ", group=gr_signalfilter ,inline = "F3")
Show_PR = input.bool(true, title="Show PullBack Signals", group = gr_PullBacksignal , inline = "Features1")
MSTuner = input.int(5, "PullBack Tuner(2-30)", minval = 2, maxval = 30, group=gr_PullBacksignal)
TrendMap = input.string(title='Heatmap Mode', defval='Trend Gradient', options= ,group=gr_candle,tooltip="Use to adjust the bar coloring to indicate market sentiment")
momentumCandles = input(false, "No Momentum Candles", group=gr_candle)
LongTrendAverage = input(true, 'Trend Tracer', group = gr_TrendTracer, tooltip='Places A EMA Which have a trend filtering capability \n \nTrend Cloud Line (EMA), Will Be Shown On The Chart')
LTAsensitivity = input.int(250, 'Trend Tracer Length', group=gr_TrendTracer)
showTrendCloud = input(true, "Show Trend cloud", group=gr_Other_Settings)
periodTrendCloud = input.string("Smooth", "Trend Cloud Style", , group=gr_Other_Settings)
//ScalpingPlus = input(false, "Fast trend cloud", group=gr_Other_Settings)
//fastTrendCloudLen = input.int(55, "Fast trend cloud", 2, group=gr_Other_Settings)
fastTrendCloudLen = 55
showDashboard = input(true, "Smart Panel", group = gr_dash , inline = "Features1")
locationDashboard = input.string("Bottom Right", "Table Location", , group = gr_dash , tooltip="Smart Panel")
sizeDashboard = input.string("Small", "Table Size", , group = gr_dash , tooltip="Smart Panel")
tpLabels = input(true, "Dynamic Take Profit Lables", group=gr_RiskManage)
ShowTpSlAreas = input(true, "Show take Profit/Stop-loss Area", group=gr_RiskManage)
ShowTrailingSL = input(false, "Show trailing Stop-loss", group=gr_RiskManage)
usePercSL = input(false, "SL/TRAILING", inline="1", group=gr_RiskManage)
percTrailingSL = input.float(1, "", 0, step=0.1, inline="1", group=gr_RiskManage)
useTP1 = input(true, "", inline="1", group=gr_RiskManage)
multTP1 = input.float(1, "TP 1", 0, inline="1", group=gr_RiskManage)
useTP2 = input(true, "", inline="4", group=gr_RiskManage)
multTP2 = input.float(2, "TP 2 ", 0, inline="4", group=gr_RiskManage)
useTP3 = input(true, "", inline="4", group=gr_RiskManage)
multTP3 = input.float(3, "TP 3", 0, inline="4", group=gr_RiskManage)
ShowSwings = input(false, "Show Market Structure ", inline="3", group=gr_RiskManage)
periodSwings = input.int(10, " ", 2, inline="3", group=gr_RiskManage)
//showTS = input(title='Show Trend Shifter', defval=false, group='Contrarian SIGNALS')
length = input.int(50, 'Length', minval=1, group='Contrarian SIGNALS')
SSF = input.int(30, 'Smoothing Factor ', minval=1, group='Contrarian SIGNALS')
CSFSELL = input.int(60, 'OB', minval=1, group='Contrarian SIGNALS' , inline = "SEXY")
CSFBUY = input.int(40, 'OS', minval=1, group='Contrarian SIGNALS', inline = "SEXY")
// showsignals = input(title='Show Signals', defval=false, group='Contrarian SIGNALS')
// Alerts Managemnt
Normalbuy_alert = input.bool(title='Buy Signal ', defval=false, inline = "NB", group=gr_customalert)
Strongbuy_alert = input.bool(title='Strong Buy', defval=false, inline = "NB", group=gr_customalert)
Normalsell_alert = input.bool(title='Sell Signal ', defval=false , inline = "NS", group=gr_customalert)
Strongsell_alert = input.bool(title='Strong Sell', defval=false , inline = "NS", group=gr_customalert)
slalert = input.bool(title='Stop-Loss ', defval=false , inline = "SLTP1", group=gr_customalert)
tp1alert = input.bool(title='Target 1', defval=false , inline = "SLTP1", group=gr_customalert)
tp2alert = input.bool(title='Target 2 ', defval=false , inline = "TP2TP3", group=gr_customalert)
tp3alert = input.bool(title='Target 3', defval=false , inline = "TP2TP3", group=gr_customalert)
bullcrosscloud_alert = input.bool(title='Bullish Cloud', defval=false, inline = "CD", group=gr_customalert)
bearcrosscloud_alert = input.bool(title='Bearish Cloud', defval=false, inline = "CD", group=gr_customalert)
showCons = false
paintCons = false
colorZone = color.white
lbPeriod = 10
lenCons = 5
// Signal Text
SimpleBuy = "Buy"
StrongB = "Strong\nBuy"
SimpleSell = "Sell"
StrongS = "Strong\nSell"
if TextStyle == "Normal"
SimpleBuy := "Buy"
StrongB := "Strong\nBuy"
SimpleSell:= "Sell"
StrongS := "Strong\nSell"
if TextStyle == "Minimal"
SimpleBuy := "Buy"
StrongB := "Strong\nBuy"
SimpleSell:= "Sell"
StrongS := "Strong\nSell"
// Signal Text Color
bullsignalcolor = color.rgb(0, 0, 0)
bearsignalcolor = color.rgb(0, 0, 0)
if TextStyle == "Normal"
bullsignalcolor := color.rgb(0, 0, 0)
bearsignalcolor := color.rgb(0, 0, 0)
if TextStyle == "Minimal"
bullsignalcolor := color.rgb(0, 0, 0)
bearsignalcolor := color.rgb(0, 0, 0)
src = close
RSII = ta.ema(ta.rsi(src, length), SSF)
TR = math.abs(RSII - RSII )
wwalpha = 1 / length
WWMA = 0.0
WWMA := wwalpha * TR + (1 - wwalpha) * nz(WWMA )
ATRRSI = 0.0
ATRRSI := wwalpha * WWMA + (1 - wwalpha) * nz(ATRRSI )
TsFast = ta.ema(ta.rsi(src, length), SSF)
TsUP = TsFast + ATRRSI * 4.236
TsDN = TsFast - ATRRSI * 4.236
TsSlow = 0.0
TsSlow := TsUP < nz(TsSlow ) ? TsUP : TsFast > nz(TsSlow ) and TsFast < nz(TsSlow ) ? TsDN : TsDN > nz(TsSlow ) ? TsDN : TsFast < nz(TsSlow ) and TsFast > nz(TsSlow ) ? TsUP : nz(TsSlow )
Colorh = TsFast > 55 ? color.rgb(255, 0, 0) : TsFast < 45 ? color.rgb(0, 255, 8) : #ffffff
//QQF = plot(TsFast, 'TS FAST', color=color.new(color.maroon, 100), linewidth=2, display=display.none, editable = false)
//QQS = plot(TsSlow, 'TS SLOW', color=color.new(color.white, 100), linewidth=2, display=display.none , editable = false)
//plot(TsFast, color=Colorh, linewidth=2, style=plot.style_area, histbase=50)
//BearLimit = hline(60, color=color.gray, linestyle=hline.style_dashed)
//BullLimt = hline(40, color=color.gray, linestyle=hline.style_dashed)
bulllim = 45
bearlim = 55
BullSignalr = ta.crossover(TsFast, TsSlow) and TsFast < bulllim
BearSignallr = ta.crossunder(TsFast, TsSlow) and TsFast > bearlim
/////////////////////////////////////////////////////////
// Trap Detector
////////////////////////////////////////////////////////
// Functions
wavetrend(src, chlLen, avgLen) =>
esa = ta.ema(src, chlLen)
d = ta.ema(math.abs(src - esa), chlLen)
ci = (src - esa) / (0.015 * d)
wt1 = ta.ema(ci, avgLen)
wt2 = ta.sma(wt1, 3)
f_top_fractal(src) => src < src and src < src and src > src and src > src
f_bot_fractal(src) => src > src and src > src and src < src and src < src
f_fractalize (src) => f_top_fractal(src) ? 1 : f_bot_fractal(src) ? -1 : 0
f_findDivs(src, topLimit, botLimit) =>
fractalTop = f_fractalize(src) > 0 and src >= topLimit ? src : na
fractalBot = f_fractalize(src) < 0 and src <= botLimit ? src : na
highPrev = ta.valuewhen(fractalTop, src , 0)
highPrice = ta.valuewhen(fractalTop, high , 0)
lowPrev = ta.valuewhen(fractalBot, src , 0)
lowPrice = ta.valuewhen(fractalBot, low , 0)
bearSignal = fractalTop and high > highPrice and src < highPrev
bullSignal = fractalBot and low < lowPrice and src > lowPrev
// Get components
= wavetrend(close, 5*MSTuner, 10*MSTuner)
= f_findDivs(wt2, 10, -35)
= f_findDivs(wt2, 40, -70)
wtDivBull = wtDivBull1 or wtDivBull2
wtDivBear = wtDivBear1 or wtDivBear2
plotshape(ta.crossover(wt1, wt2) and Show_PR and wt2 <= -60, "PullBack Buy" , shape.circle, location.belowbar, color.new(bullcolor,60), size=size.tiny)
plotshape(ta.crossunder(wt1, wt2) and Show_PR and wt2 >= 60, "PullBack Sell", shape.circle, location.abovebar, color.new(bearcolor,60), size=size.tiny)
rsi = ta.rsi(close ,14)
// Functions
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1. / 60 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
atr(len) =>
tr = ta.tr
atr = 0.0
atr := nz(atr + (tr - atr ) / len, tr)
supertrend(src, factor, len) =>
atr = ta.atr(len)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if prevSuperTrend == prevUpperBand
direction := close > upperBand ? 1 : -1
else
direction := close < lowerBand ? -1 : 1
superTrend := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
dchannel(len)=>
hh = ta.highest(len)
ll = ta.lowest (len)
trend = 0
trend := close > hh ? 1 : close < ll ? -1 : nz(trend )
trendScalper(show, len1, len2, len3, colorBull, colorBear, colorBarBull, colorBarBear) =>
avgOC = math.avg(open, close)
ha_o = 0.0, ha_o := na(ha_o ) ? avgOC : (ha_o + ohlc4 ) / 2
ema1 = ta.ema(ha_o, len1), ema2 = ta.ema(ha_o, len2), ema3 = ta.ema(ha_o, len3)
ris1 = ema1 > ema1 , ris2 = ema2 > ema2 , ris3 = ema3 > ema3
fal1 = ema1 < ema1 , fal2 = ema2 < ema2 , fal3 = ema3 < ema3
colorEma1 = ris1 ? colorBull : fal1 ? colorBear : na, colorEma2 = ris2 ? colorBull : fal2 ? colorBear : na, colorEma3 = ris3 ? colorBull : fal3 ? colorBear : na
fillEma1 = avgOC > ema1 ? colorBull : avgOC < ema1 ? colorBear : na, fillEma2 = ema1 > ema2 ? colorBull : ema1 < ema2 ? colorBear : na, fillEma3 = ema2 > ema3 ? colorBull : ema2 < ema3 ? colorBear : na
colorBar = close < ema1 and close < ema2 ? colorBarBear : colorBarBull
candlesMom() =>
= ta.macd(close, 2, 4, 3)
(macd > 10 and macd > macd ) or (macd < 10 and macd < macd )
trailingSL(buy, sell, factor, len, usePerc, perc) =>
atr = atr(len)
upperBand = high + (usePerc ? high * (perc / 100) : factor * atr)
lowerBand = low - (usePerc ? low * (perc / 100) : factor * atr)
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or buy ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or sell ? upperBand : prevUpperBand
int direction = na
float stop = na
prevSuperTrend = stop
if prevSuperTrend == prevUpperBand
direction := buy ? 1 : -1
else
direction := sell ? -1 : 1
stop := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
add_to_zz(zz, val, bi) =>
array.unshift(zz, bi)
array.unshift(zz, val)
if array.size(zz) > 12
array.pop(zz)
update_zz(zz, val, bi, dir) =>
if array.size(zz) == 0
add_to_zz(zz, val, bi)
else
if dir == 1 and val > array.get(zz, 0) or dir == -1 and val < array.get(zz, 0)
array.set(zz, 0, val)
array.set(zz, 1, bi)
0
// Get components
vosc = ta.obv - ta.ema(ta.obv, 20)
bs = ta.ema(nz(math.abs((open - close) / (high - low) * 100)), 3)
ema = ta.ema(close, 200)
emaBull = close > ema
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes()
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes()
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep(sym, res, src) =>
bool bull = na
bull := equal_tf(res) ? src : bull
bull := higher_tf(res) ? request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on) : bull
bull_array = request.security_lower_tf(syminfo.tickerid, higher_tf(res) ? str.tostring(f_chartTfInMinutes()) : too_small_tf(res) ? (timeframe.isweekly ? "3" : "10") : res, src)
if array.size(bull_array) > 1 and not equal_tf(res) and not higher_tf(res)
bull := array.pop(bull_array)
array.clear(bull_array)
bull
TF1Bull = securityNoRep(syminfo.tickerid, "1" , emaBull)
TF3Bull = securityNoRep(syminfo.tickerid, "3" , emaBull)
TF5Bull = securityNoRep(syminfo.tickerid, "5" , emaBull)
TF10Bull = securityNoRep(syminfo.tickerid, "10" , emaBull)
TF15Bull = securityNoRep(syminfo.tickerid, "15" , emaBull)
TF30Bull = securityNoRep(syminfo.tickerid, "30" , emaBull)
TF60Bull = securityNoRep(syminfo.tickerid, "60" , emaBull)
TF120Bull = securityNoRep(syminfo.tickerid, "120" , emaBull)
TF240Bull = securityNoRep(syminfo.tickerid, "240" , emaBull)
TF720Bull = securityNoRep(syminfo.tickerid, "720" , emaBull)
TFDBull = securityNoRep(syminfo.tickerid, "1440", emaBull)
ema150 = ta.ema(close, 150)
ema250 = ta.ema(close, 250)
hma55 = ta.hma(close, 55 )
= ta.macd(close, 12, 26, 9)
supertrend = supertrend(close, sensitivity, STuner)
maintrend = dchannel(30)
confBull = (ta.crossover (close, supertrend) or (ta.crossover (close, supertrend) and maintrend < 0)) and macd > 0 and macd > macd and ema150 > ema250 and hma55 > hma55 and maintrend > 0
confBear = (ta.crossunder(close, supertrend) or (ta.crossunder(close, supertrend) and maintrend > 0)) and macd < 0 and macd < macd and ema150 < ema250 and hma55 < hma55 and maintrend < 0
trendcloud = supertrend(ohlc4, periodTrendCloud == "Swing" ? 7 : 4, 10)
hma = periodTrendCloud == "Scalping+" ? ta.hma(close, fastTrendCloudLen) : na
none = close > 0
= ta.dmi(14, 14)
consFilter = adx > 20
ContBear = TsFast > CSFSELL
ContBull = TsFast < CSFBUY
StrongFilter = ta.ema(close, 200)
//volFilter = (ta.ema(volume, 25) - ta.ema(volume, 26)) / ta.ema(volume, 26) > 0
volFilter = (ta.ema(volume, 15) - ta.ema(volume, 20)) / ta.ema(volume, 25) > 0
trendFilter = trendcloud
bull = (Presets == "All Signals" ? ta.crossover (close, supertrend) : confBull and not confBull ) and Presets != "Trend Scalper" and (StrongSignalsOnly ? close > StrongFilter : none) and (ContrarianOnly ? ContBull : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "Smooth" ? ema150 > ema250 : close > trendFilter) : none)
bear = (Presets == "All Signals" ? ta.crossunder(close, supertrend) : confBear and not confBear ) and Presets != "Trend Scalper" and (StrongSignalsOnly ? close < StrongFilter : none) and (ContrarianOnly ? ContBear : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "Smooth" ? ema150 < ema250 : close < trendFilter) : none)
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
= trendScalper(Presets == "Trend Scalper" ? true : false, 5, 9, 21, bullcolor, bearcolor, bullcolor, bearcolor)
trailingStop = trailingSL(bull, bear, 2.2, 14, usePercSL, percTrailingSL)
float _ph = ta.highestbars(high, periodSwings) == 0 ? high : na
float _pl = ta.lowestbars (low, periodSwings) == 0 ? low : na
var _dir = 0, dir_ = _pl and na(_ph) ? -1 : _dir, _dir := _ph and na(_pl) ? 1 : dir_, dirChg = ta.change(_dir)
var zz = array.new_float(0), zzOld = array.copy(zz)
float zzLive = _ph or _pl ? (dirChg ? add_to_zz(zz, _dir == 1 ? _ph : _pl, bar_index) : update_zz(zz, _dir == 1 ? _ph : _pl, bar_index, _dir)) : na
float hb_ = ta.highestbars(lbPeriod) == 0 ? high : na
float lb_ = ta.lowestbars (lbPeriod) == 0 ? low : na
var int dir = 0
float zz_ = na
float pp = na
var int consCnt = 0
var float condHi = na
var float condLo = na
float H_ = ta.highest(lenCons)
float L_ = ta.lowest (lenCons)
var line lineUp = na
var line lineDn = na
bool breakUp = false
bool breakDn = false
var float pvh1_price = array.new_float(1000, na)
var int pvh1_time = array.new_int (1000, na)
var float pvl1_price = array.new_float(1000, na)
var int pvl1_time = array.new_int (1000, na)
var float pvh2_price = array.new_float(1000, na)
var int pvh2_time = array.new_int (1000, na)
var float pvl2_price = array.new_float(1000, na)
var int pvl2_time = array.new_int (1000, na)
var float htcmrll_price = na
var int htcmrll_time = na
var float ltcmrhh_price = na
var int ltcmrhh_time = na
var box long_boxes = array.new_box()
var box short_boxes = array.new_box()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
var buyBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(buyBars, i))
var sellBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(sellBars, i))
// Colors
green = bullcolor, green50 = color.new(green, 50), green20 = color.new(green, 80)
red = bearcolor, red50 = color.new(red, 50), red20 = color.new(red, 80)
silver = #B2B5BE, silver50 = color.new(silver, 50), silver20 = color.new(silver, 80)
// Plots
atrBand = usePercSL ? (trigger ? low : high) * (percTrailingSL / 100) : ta.atr(14) * 2.2
atrStop = trigger ? low - atrBand : high + atrBand
lastTrade(src) => ta.valuewhen(bull or bear, src, 0)
entry_y = lastTrade(close)
stop_y = lastTrade(atrStop)
tp1_y = (entry_y-lastTrade(atrStop))*multTP1 + entry_y
tp2_y = (entry_y-lastTrade(atrStop))*multTP2 + entry_y
tp3_y = (entry_y-lastTrade(atrStop))*multTP3 + entry_y
labelTpSl(cond, y, txt, color) =>
label labelTpSl = ShowTpSlAreas and cond ? label.new(bar_index + 1, y, txt, xloc.bar_index, yloc.price, color, label.style_label_left, color.white, size.normal) : na
label.delete(labelTpSl )
labelTpSl(none, entry_y, "Entry : " + str.tostring(math.round_to_mintick(entry_y)), color.orange)
labelTpSl(none, stop_y , "Stop loss : " + str.tostring(math.round_to_mintick(atrStop)), bearcolor)
labelTpSl(useTP1 and multTP1 != 0, tp1_y, "TP 1 : " + str.tostring(math.round_to_mintick(tp1_y)), bullcolor)
labelTpSl(useTP2 and multTP2 != 0, tp2_y, "TP 2 : " + str.tostring(math.round_to_mintick(tp2_y)), bullcolor)
labelTpSl(useTP3 and multTP3 != 0, tp3_y, "TP 3 : " + str.tostring(math.round_to_mintick(tp3_y)), bullcolor)
lineTpSl(cond, y, color, style) =>
line lineTpSl = ShowTpSlAreas and cond ? line.new(bar_index - (trigger ? countBull : countBear), y, bar_index + 1, y, xloc.bar_index, extend.none, color, style) : na
line.delete(lineTpSl )
lineTpSl(none, entry_y, color.orange, line.style_dashed)
lineTpSl(none, stop_y , bearcolor , line.style_solid )
lineTpSl(useTP1 and multTP1 != 0, tp1_y, bullcolor, line.style_dotted)
lineTpSl(useTP2 and multTP2 != 0, tp2_y, bullcolor, line.style_dotted)
lineTpSl(useTP3 and multTP3 != 0, tp3_y, bullcolor, line.style_dotted)
buy = showSignals and bull ? label.new(bar_index, low , close > StrongFilter ? StrongB : SimpleBuy , xloc.bar_index, yloc.belowbar, bullcolor, label.style_label_up , bullsignalcolor, size.normal) : na
sell = showSignals and bear ? label.new(bar_index, high, close < StrongFilter ? StrongS : SimpleSell , xloc.bar_index, yloc.abovebar, bearcolor , label.style_label_down, bearsignalcolor, size.normal) : na
tpLabels(tp) =>
tp1Bull = ta.crossover (rsi, 70), tp2Bull = ta.crossover (rsi, 75), tp3Bull = ta.crossover (rsi, 80)
tp1Bear = ta.crossunder(rsi, 30), tp2Bear = ta.crossunder(rsi, 25), tp3Bear = ta.crossunder(rsi, 20)
tp1Bull := tp1Bull and (nz(ta.barssince(tp1Bull) , 9999) > countBull), tp2Bull := tp2Bull and (ta.barssince(tp1Bull) <= countBull), tp2Bull := tp2Bull and (nz(ta.barssince(tp2Bull) , 9999) > countBull), tp3Bull := tp3Bull and (ta.barssince(tp2Bull) <= countBull), tp3Bull := tp3Bull and (nz(ta.barssince(tp3Bull) , 9999) > countBull)
tp1Bear := tp1Bear and (nz(ta.barssince(tp1Bear) , 9999) > countBear), tp2Bear := tp2Bear and (ta.barssince(tp1Bear) <= countBear), tp2Bear := tp2Bear and (nz(ta.barssince(tp2Bear) , 9999) > countBear), tp3Bear := tp3Bear and (ta.barssince(tp2Bear) <= countBear), tp3Bear := tp3Bear and (nz(ta.barssince(tp3Bear) , 9999) > countBear)
if Presets != "Trend Scalper" and tpLabels
trigger ? (tp == 1 ? tp1Bull : tp == 2 ? tp2Bull : tp3Bull) : (tp == 1 ? tp1Bear : tp == 2 ? tp2Bear : tp3Bear)
plotshape(tpLabels(1), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 1", trigger ? green : na , false)
plotshape(tpLabels(2), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 2", trigger ? green : na , false)
plotshape(tpLabels(3), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 3", trigger ? green : na , false)
plotshape(tpLabels(1), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 1", trigger ? na : red, false)
plotshape(tpLabels(2), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 2", trigger ? na : red, false)
plotshape(tpLabels(3), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 3", trigger ? na : red, false)
var label zzLabel = na
if array.size(zz) > 12 and ShowSwings
if array.get(zz, 0) != array.get(zzOld, 0) or array.get(zz, 1) != array.get(zzOld, 1)
if array.get(zz, 2) == array.get(zzOld, 2) and array.get(zz, 3) == array.get(zzOld, 3)
label.delete(zzLabel)
zzLabel := label.new(math.round(array.get(zz, 1)), array.get(zz, 0), _dir == 1 ? array.get(zz, 0) > array.get(zz, 4) ? ((array.get(zz, 4) < array.get(zz, 8)) ? "High" : "HH") : "LH" : array.get(zz, 0) < array.get(zz, 4) ? ((array.get(zz, 4) > array.get(zz, 8)) ? "Low" : "LL") : "HL", xloc.bar_index, yloc.price, color.new(color.white, 100), _dir == 1 ? label.style_label_down : label.style_label_up, _dir == 1 ? bullcolor : bearcolor)
if showCons and barstate.isconfirmed
dir := hb_ and na(lb_) ? 1 : lb_ and na(hb_) ? -1 : dir
if hb_ and lb_
if dir == 1
zz_ := hb_
else
zz_ := lb_
else
zz_ := hb_ ? hb_ : lb_ ? lb_ : na
for x = 0 to 1000
if na(close) or dir != dir
break
if zz_
if na(pp)
pp := zz_
else
if dir == 1 and zz_ > pp
pp := zz_
if dir == -1 and zz_ < pp
pp := zz_
if pp != pp
if consCnt > lenCons
if pp > condHi
breakUp := true
if pp < condLo
breakDn := true
if consCnt > 0 and pp <= condHi and pp >= condLo
consCnt += 1
else
consCnt := 0
else
consCnt += 1
if consCnt >= lenCons
if consCnt == lenCons
condHi := H_
condLo := L_
else
line.delete(lineUp)
line.delete(lineDn)
condHi := math.max(condHi, high)
condLo := math.min(condLo, low )
lineUp := line.new(bar_index, condHi , bar_index - consCnt, condHi , color=bearcolor , style=line.style_dashed)
lineDn := line.new(bar_index, condLo , bar_index - consCnt, condLo , color=color.lime, style=line.style_dashed)
fill(plot(condHi, "", na, 1, plot.style_stepline, editable=false), plot(condLo, "", na, 1, plot.style_stepline, editable=false), paintCons and consCnt > lenCons ? colorZone : na, "", false)
buy_col = color.new(#0ac20a,0)
sell_col = color.new(#fd1605,0)
text_col = color.new(#FFFFFF,0)
// -------- Bearish trend (blue) color selection --------
getSellColor(count) =>
if count == 1
color.new(#11e7f2,0)
else
if count == 2
color.new(#11d9f2,0)
else
if count == 3
color.new(#11cbf2,0)
else
if count == 4
color.new(#11aff2,0)
else
if count == 5
color.new(#1193f2,0)
else
if count == 6
color.new(#1176f2,0)
else
if count == 7
color.new(#105df4,0)
else
if count == 8
color.new(#1051f5,0)
else
if count == 9
color.new(#0f44f5,0)
else
if count == 10
color.new(#0c3de0,0)
else
if count == 11
color.new(#0935ca,0)
else
if count == 12
color.new(#062eb4,0)
else
if count == 13
color.new(#02269e,0)
// -------- Bullish trend (blue) color selection --------
getBuyColor(count) =>
if count == 1
color.new(#eef211,0)
else
if count == 2
color.new(#efdc11,0)
else
if count == 3
color.new(#f0c511,0)
else
if count == 4
color.new(#f1af11,0)
else
if count == 5
color.new(#f29811,0)
else
if count == 6
color.new(#f28811,0)
else
if count == 7
color.new(#f27811,0)
else
if count == 8
color.new(#f26811,0)
else
if count == 9
color.new(#f25811,0)
else
if count == 10
color.new(#ea420d,0)
else
if count == 11
color.new(#e12c09,0)
else
if count == 12
color.new(#d81605,0)
else
if count == 13
color.new(#cf0000,0)
// -------- Calculate bearish trend sequence --------
buySetup = 0
buySetup := close < close ? buySetup == 13 ? 1 : buySetup + 1 : 0
// -------- Calculate bullish trend sequence --------
sellSetup = 0
sellSetup := close > close ? sellSetup == 13 ? 1 : sellSetup + 1 : 0
// -------- Paint bars --------
barColour = buySetup >= 1 ? getBuyColor(buySetup) : sellSetup >= 1 ? getSellColor(sellSetup) : na
// Candle Coloring
// Input
FastteyLength = 12
SjlowLeyLength = 26
srrrc = close
signalXLength = 9
// Data reference
= ta.macd(srrrc, FastteyLength, SjlowLeyLength, signalXLength)
fill(plot(showTrendCloud and periodTrendCloud == "Smooth" ? ema150 : na, "", na, editable=false), plot(showTrendCloud and periodTrendCloud == "Smooth" ? ema250 : na, "", na, editable=false), ema150 > ema250 ? color.new(bullcolor, 70) : ema150 < ema250 ? color.new(bearcolor, 70) : na)
plot(ShowTrailingSL and trigger and nz(ta.barssince(low < trailingStop), bar_index) > countBull ? trailingStop : na, "", green, 1, plot.style_linebr, editable=false)
plot(ShowTrailingSL and not trigger and nz(ta.barssince(high > trailingStop), bar_index) > countBear ? trailingStop : na, "", red , 1, plot.style_linebr, editable=false)
p0 = plot(avgOC, "", na , editable=false)
p1 = plot(ema5 , "", colorEma5 , editable=false)
p2 = plot(ema9 , "", colorEma9 , editable=false)
p3 = plot(ema21, "", colorEma21, editable=false)
plot(LongTrendAverage ? ta.ema(close, LTAsensitivity) : na, 'Trend Tracer', linewidth=2, color=close > ta.ema(close, LTAsensitivity) ? color.new(bullcolor, 45) : color.new(bearcolor, 45))
fill(p0, p1, fillEma5 )
fill(p1, p2, fillEma9 )
fill(p2, p3, fillEma21)
fill(plot(showTrendCloud and periodTrendCloud != "Smooth" and periodTrendCloud != "Scalping+" and trendcloud != 0 and close > trendcloud ? trendcloud : na, "", bullcolor, 1, plot.style_linebr, editable=false), p0, color.new(bullcolor, 90))
fill(plot(showTrendCloud and periodTrendCloud != "Smooth" and periodTrendCloud != "Scalping+" and trendcloud != 0 and close < trendcloud ? trendcloud : na, "", bearcolor , 1, plot.style_linebr, editable=false), p0, color.new(bearcolor , 90))
fill(plot(hma, "", hma > hma ? green : hma < hma ? red : na, editable=false), plot(hma , "", hma > hma ? green : hma < hma ? red : na, editable=false), hma > hma ? green : hma < hma ? red : na)
/////////////////////////////////////////////////////////
// Money Moves
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// Get user input
indicatorTF = "Chart"
// Functions
sqz(bbLen, bbMult, kcLen, kcMult, source) =>
upperBB = ta.sma(source, bbLen) + ta.stdev(source, bbLen) * bbMult
lowerBB = ta.sma(source, bbLen) - ta.stdev(source, bbLen) * bbMult
upperKC = ta.sma(source, kcLen) + ta.sma(ta.tr, kcLen) * kcMult
lowerKC = ta.sma(source, kcLen) - ta.sma(ta.tr, kcLen) * kcMult
sqzOn = lowerBB > lowerKC and upperBB < upperKC
sqzOff = lowerBB < lowerKC and upperBB > upperKC
qqe(rsiLen, rsiSmooth, factor, source, bbLen, bbMult) =>
rsiMa = ta.ema(ta.rsi(source, rsiLen), rsiSmooth)
delta = ta.ema(ta.ema(math.abs(ta.mom(rsiMa, 1)), rsiLen * 2 - 1), rsiLen * 2 - 1) * factor
longBand = 0.0, longBand := rsiMa > longBand and rsiMa > longBand ? math.max(longBand , rsiMa - delta) : rsiMa - delta
shortBand = 0.0, shortBand := rsiMa < shortBand and rsiMa < shortBand ? math.min(shortBand , rsiMa + delta) : rsiMa + delta
cross1 = ta.cross(rsiMa, shortBand )
cross2 = ta.cross(rsiMa, longBand )
trend = 0.0, trend := cross1 ? 1 : cross2 ? -1 : nz(trend , 1)
fastDelta = trend == 1 ? longBand : shortBand
_hist = rsiMa - 50
_line = fastDelta - 50
= ta.bb(_line, bbLen, bbMult)
// Get components
cond(_offset) =>
top = ta.highest(high, 10)
bot = ta.lowest(low, 10)
osc = ta.ema(hlc3, 5) - ta.ema(ohlc4, 20)
oscRis = osc > osc
oscFal = osc < osc
oscA0 = osc > 0
oscB0 = osc < 0
oscTop = oscFal and oscRis
oscBot = oscRis and oscFal
bullR = oscB0 and oscBot and ((osc > ta.valuewhen(oscB0 and oscBot, osc, 1) and bot < ta.valuewhen(oscB0 and oscBot, bot, 1)))
bearR = oscA0 and oscTop and ((osc < ta.valuewhen(oscA0 and oscTop, osc, 1) and top > ta.valuewhen(oscA0 and oscTop, top, 1)))
bullH = oscB0 and oscBot and ((osc < ta.valuewhen(oscB0 and oscBot, osc, 1) and bot > ta.valuewhen(oscB0 and oscBot, bot, 1)))
bearH = oscA0 and oscTop and ((osc > ta.valuewhen(oscA0 and oscTop, osc, 1) and top < ta.valuewhen(oscA0 and oscTop, top, 1)))
= sqz(20, 2, 20, 2, close)
= qqe(6, 6, 3, close, 50, 0.001)
= qqe(6, 5, 1.618, close, 50, 1)
= ta.dmi(14, 14)
[osc , oscRis , oscFal , oscA0 , oscB0 , oscTop , oscBot , bullR , bearR , bullH , bearH , sqzOn , sqzOff , _hist1 , upper1 , lower1 , _hist2 , _line2 , tvr ]
tf = indicatorTF == "Chart" ? timeframe.period : indicatorTF == "1 minute" ? "1" : indicatorTF == "3 minutes" ? "3" : indicatorTF == "5 minutes" ? "5" : indicatorTF == "10 minutes" ? "10" : indicatorTF == "15 minutes" ? "15" : indicatorTF == "30 minutes" ? "30" : indicatorTF == "45 minutes" ? "45" : indicatorTF == "1 hour" ? "60" : indicatorTF == "2 hours" ? "120" : indicatorTF == "3 hours" ? "180" : indicatorTF == "4 hours" ? "240" : indicatorTF == "12 hours" ? "720" : indicatorTF == "1 day" ? "1D" : indicatorTF == "1 week" ? "1W" : indicatorTF == "1 month" ? "1M" : na
= request.security(syminfo.tickerid, tf, cond(indicatorTF != "Chart" and barstate.isrealtime ? 1 : 0))
colorTVR = tvr < 15 ? #F6525F : tvr > 15 and tvr < 25 ? #B2B5BE : #66BB6A
// Plots
//plot(Presets == "Money Moves TrendVR" ? tvr : na, "", colorTVR, editable=false)
TrendText = "Trending"
if tvr < 15 and tvr < 25
TrendText := "No trend"
if tvr > 15 and tvr < 25
TrendText := "Ranging"
//------------------------------------------------------------------------------------------------------- Volatitiry
//Calculates Volatility for Dashboard
atrr = 3 * ta.atr(10)
stdAtr = 2 * ta.stdev(atrr, 20)
smaAtr = ta.sma(atrr, 20)
topAtrDev = smaAtr + stdAtr
bottomAtrDev = smaAtr - stdAtr
calcDev = (atrr - bottomAtrDev) / (topAtrDev - bottomAtrDev)
percentVol = 40 * calcDev + 30
AvrLength = 21
PercentFilter = 144
xAavrVolume = ta.rma(volume, AvrLength)
nResLess = volume * 100 / xAavrVolume < PercentFilter ? 0 : volume
nRes = nResLess
clr = close < open ? color.red : color.green
//plot(nRes, color=clr, style=plot.style_columns, title='Volume Filter', transp=20)
VolitiText = "Inactive"
if nRes
VolitiText := "Active"
//////////////////////////////////////////
ema69 = ta.ema(close, 9)
totalSentTxt = ema69 > ema69 ? 'Bullish' : ema69 < ema69 ? 'Bearish' : 'Flat'
// INputs
//Timezones
tz_incr = 0
use_exchange = false
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
//Session A
NYSes = true
NYTxt = 'New York'
NYTime = '1300-2200'
//Session B
LDSes = true
sesb_txt = 'London'
sesb_ses = '0700-1600'
//Session C
show_sesc = true
sesc_txt = 'Tokyo'
sesc_ses = '0000-0900'
//Session D
show_sesd = true
sesd_txt = 'Sydney'
sesd_ses = '2100-0600'
//-----------------------------------------------------------------------------}
//Sessions
//-----------------------------------------------------------------------------{
tff = timeframe.period
var tz = use_exchange ? syminfo.timezone :
str.format('UTC{0}{1}', tz_incr >= 0 ? '+' : '-', math.abs(tz_incr))
is_sesa = math.sign(nz(time(tff, NYTime, tz)))
is_sesb = math.sign(nz(time(tff, sesb_ses, tz)))
is_sesc = math.sign(nz(time(tff, sesc_ses, tz)))
is_sesd = math.sign(nz(time(tff, sesd_ses, tz)))
////////////////////////////////////////////
SessionText = "Default"
//Session a = Newyork
//Session b = London
//Session c = Tokyo
//Session d = Sydney
if is_sesd
SessionText := sesd_txt
if is_sesc
SessionText := sesc_txt
if is_sesb
SessionText := sesb_txt
if is_sesa
SessionText := NYTxt
if is_sesd and is_sesc
SessionText := "Sydney/Tokyo"
if is_sesb and is_sesc
SessionText := "Tokyo/London"
if is_sesb and is_sesa
SessionText := "London/Newyork"
if is_sesa and is_sesd
SessionText := "Newyork/Sydney"
//-----------------------------------------------------------------------------}
//Overlays color.green : color.red
//-----------------------------------------------------------------------------{
//
var dashboard_loc = locationDashboard == "Top Right" ? position.top_right : locationDashboard == "Middle Right" ? position.middle_right : locationDashboard == "Bottom Right" ? position.bottom_right : locationDashboard == "Top Center" ? position.top_center : locationDashboard == "Middle Center" ? position.middle_center : locationDashboard == "Bottom Center" ? position.bottom_center : locationDashboard == "Top Left" ? position.top_left : locationDashboard == "Middle Left" ? position.middle_left : position.bottom_left
var dashboard_size = sizeDashboard == "Large" ? size.large : sizeDashboard == "Normal" ? size.normal : sizeDashboard == "Small" ? size.small : size.tiny
var dashboard = showDashboard ? table.new(dashboard_loc, 3, 7, color.rgb(30, 34, 45 , 60), #3d384300, 2, color.rgb(30, 34, 45 , 60), 1) : na
dashboard_cell(column, row, txt, signal=false) => table.cell(dashboard, column, row, txt, 0, 0, signal ? #000000 : color.white, text_size=dashboard_size)
dashboard_cell_bg(column, row, col) => table.cell_set_bgcolor(dashboard, column, row, col)
if barstate.islast and showDashboard
// MTF Trend
dashboard_cell(0, 0 , "MTF")
dashboard_cell(0, 2 , "M5") , dashboard_cell_bg(0, 2 , TF5Bull ? color.green : color.red)
dashboard_cell(0, 3 , "M15") , dashboard_cell_bg(0, 3 , TF15Bull ? color.green : color.red)
dashboard_cell(0, 4 , "M30") , dashboard_cell_bg(0, 4 , TF30Bull ? color.green : color.red)
dashboard_cell(0, 5 , "1H") , dashboard_cell_bg(0, 5 , TF60Bull ? color.green : color.red)
dashboard_cell(0, 6 , "4H") , dashboard_cell_bg(0, 6 , TF240Bull ? color.green : color.red)
// Middel part
dashboard_cell(1, 0 , " ")
dashboard_cell(1, 2 , "")
dashboard_cell(1, 3 , "")
dashboard_cell(1, 4 ,")")
dashboard_cell(1, 5 , "")
dashboard_cell(1, 6 , "")
// Alerts
f_sl_crossed() =>
ret = false
stop = ShowTrailingSL ? trailingStop : stop_y
crossBull = low >= stop and low < stop and ta.barssince(low >= stop and low < stop ) >= countBull - 1
crossBear = high <= stop and high > stop and ta.barssince(high <= stop and high > stop ) >= countBear - 1
ret := trigger ? crossBull : crossBear
f_tp_crossed(tp) =>
ret = false
profit = tp
crossBull = high <= profit and high > profit and ta.barssince(high <= profit and high > profit ) >= countBull - 1
crossBear = low >= profit and low < profit and ta.barssince(low >= profit and low < profit ) >= countBear - 1
ret := trigger ? crossBull : crossBear
alert01 = (bull and close <= StrongFilter) or (bear and close >= StrongFilter)
alert02 = bull or bear
alert03 = (bull and close > StrongFilter) or (bear and close < StrongFilter)
alert04 = bull and close <= StrongFilter
alert06 = bear and close >= StrongFilter
alert07 = bull and close > StrongFilter
alert08 = bear and close < StrongFilter
alert09 = f_sl_crossed()
alert11 = f_tp_crossed(tp1_y)
alert12 = f_tp_crossed(tp2_y)
alert13 = f_tp_crossed(tp3_y)
alert14 = periodTrendCloud == "Smooth" ? ta.crossunder(ema150, ema250) : (close < trendcloud) and (close > trendcloud)
alert15 = periodTrendCloud == "Smooth" ? ta.crossover (ema150, ema250) : (close > trendcloud) and (close < trendcloud)
//alerts(sym) =>
// if alert01 or alert02 or alert03 or alert04 or alert05 or alert06 or alert07 or alert08 or alert09 or alert10 or alert11 or alert12 or alert13 or alert14 or alert15
// alert("NEW ALERT", alert.freq_once_per_bar_close)
//alerts(syminfo.tickerid)
// Signal Alerts
if alert04 and Normalbuy_alert
alert('Buy Signal Alert !!!' , alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert07 and Strongbuy_alert
alert('Strong Buy Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if (bear and close >= StrongFilter) and Normalsell_alert
alert('Sell Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if (bear and close < StrongFilter) and Strongsell_alert
alert('Strong Sell Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Risk Management Alerts
if alert09 and slalert
alert('SL Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert11 and tp1alert
alert('Target 1 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert12 and tp2alert
alert('Target 2 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert13 and tp3alert
alert('Target 3 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Cloud Alert
if alert15 and bullcrosscloud_alert
alert('Cloud Turned Bullish !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert14 and bearcrosscloud_alert
alert('Cloud Turned Bearish !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
alertcondition(alert01, "Any Signal Contrarian Buy / Contrarian sell", "Buy or Sell")
alertcondition(alert04, "Contrarian Buy alert", "Buy")
alertcondition(alert06, "Contrarian Sell alert", "Sell")
Tensor Market Analysis Engine (TMAE)# Tensor Market Analysis Engine (TMAE)
## Advanced Multi-Dimensional Mathematical Analysis System
*Where Quantum Mathematics Meets Market Structure*
---
## 🎓 THEORETICAL FOUNDATION
The Tensor Market Analysis Engine represents a revolutionary synthesis of three cutting-edge mathematical frameworks that have never before been combined for comprehensive market analysis. This indicator transcends traditional technical analysis by implementing advanced mathematical concepts from quantum mechanics, information theory, and fractal geometry.
### 🌊 Multi-Dimensional Volatility with Jump Detection
**Hawkes Process Implementation:**
The TMAE employs a sophisticated Hawkes process approximation for detecting self-exciting market jumps. Unlike traditional volatility measures that treat price movements as independent events, the Hawkes process recognizes that market shocks cluster and exhibit memory effects.
**Mathematical Foundation:**
```
Intensity λ(t) = μ + Σ α(t - Tᵢ)
```
Where market jumps at times Tᵢ increase the probability of future jumps through the decay function α, controlled by the Hawkes Decay parameter (0.5-0.99).
**Mahalanobis Distance Calculation:**
The engine calculates volatility jumps using multi-dimensional Mahalanobis distance across up to 5 volatility dimensions:
- **Dimension 1:** Price volatility (standard deviation of returns)
- **Dimension 2:** Volume volatility (normalized volume fluctuations)
- **Dimension 3:** Range volatility (high-low spread variations)
- **Dimension 4:** Correlation volatility (price-volume relationship changes)
- **Dimension 5:** Microstructure volatility (intrabar positioning analysis)
This creates a volatility state vector that captures market behavior impossible to detect with traditional single-dimensional approaches.
### 📐 Hurst Exponent Regime Detection
**Fractal Market Hypothesis Integration:**
The TMAE implements advanced Rescaled Range (R/S) analysis to calculate the Hurst exponent in real-time, providing dynamic regime classification:
- **H > 0.6:** Trending (persistent) markets - momentum strategies optimal
- **H < 0.4:** Mean-reverting (anti-persistent) markets - contrarian strategies optimal
- **H ≈ 0.5:** Random walk markets - breakout strategies preferred
**Adaptive R/S Analysis:**
Unlike static implementations, the TMAE uses adaptive windowing that adjusts to market conditions:
```
H = log(R/S) / log(n)
```
Where R is the range of cumulative deviations and S is the standard deviation over period n.
**Dynamic Regime Classification:**
The system employs hysteresis to prevent regime flipping, requiring sustained Hurst values before regime changes are confirmed. This prevents false signals during transitional periods.
### 🔄 Transfer Entropy Analysis
**Information Flow Quantification:**
Transfer entropy measures the directional flow of information between price and volume, revealing lead-lag relationships that indicate future price movements:
```
TE(X→Y) = Σ p(yₜ₊₁, yₜ, xₜ) log
```
**Causality Detection:**
- **Volume → Price:** Indicates accumulation/distribution phases
- **Price → Volume:** Suggests retail participation or momentum chasing
- **Balanced Flow:** Market equilibrium or transition periods
The system analyzes multiple lag periods (2-20 bars) to capture both immediate and structural information flows.
---
## 🔧 COMPREHENSIVE INPUT SYSTEM
### Core Parameters Group
**Primary Analysis Window (10-100, Default: 50)**
The fundamental lookback period affecting all calculations. Optimization by timeframe:
- **1-5 minute charts:** 20-30 (rapid adaptation to micro-movements)
- **15 minute-1 hour:** 30-50 (balanced responsiveness and stability)
- **4 hour-daily:** 50-100 (smooth signals, reduced noise)
- **Asset-specific:** Cryptocurrency 20-35, Stocks 35-50, Forex 40-60
**Signal Sensitivity (0.1-2.0, Default: 0.7)**
Master control affecting all threshold calculations:
- **Conservative (0.3-0.6):** High-quality signals only, fewer false positives
- **Balanced (0.7-1.0):** Optimal risk-reward ratio for most trading styles
- **Aggressive (1.1-2.0):** Maximum signal frequency, requires careful filtering
**Signal Generation Mode:**
- **Aggressive:** Any component signals (highest frequency)
- **Confluence:** 2+ components agree (balanced approach)
- **Conservative:** All 3 components align (highest quality)
### Volatility Jump Detection Group
**Volatility Dimensions (2-5, Default: 3)**
Determines the mathematical space complexity:
- **2D:** Price + Volume volatility (suitable for clean markets)
- **3D:** + Range volatility (optimal for most conditions)
- **4D:** + Correlation volatility (advanced multi-asset analysis)
- **5D:** + Microstructure volatility (maximum sensitivity)
**Jump Detection Threshold (1.5-4.0σ, Default: 3.0σ)**
Standard deviations required for volatility jump classification:
- **Cryptocurrency:** 2.0-2.5σ (naturally volatile)
- **Stock Indices:** 2.5-3.0σ (moderate volatility)
- **Forex Major Pairs:** 3.0-3.5σ (typically stable)
- **Commodities:** 2.0-3.0σ (varies by commodity)
**Jump Clustering Decay (0.5-0.99, Default: 0.85)**
Hawkes process memory parameter:
- **0.5-0.7:** Fast decay (jumps treated as independent)
- **0.8-0.9:** Moderate clustering (realistic market behavior)
- **0.95-0.99:** Strong clustering (crisis/event-driven markets)
### Hurst Exponent Analysis Group
**Calculation Method Options:**
- **Classic R/S:** Original Rescaled Range (fast, simple)
- **Adaptive R/S:** Dynamic windowing (recommended for trading)
- **DFA:** Detrended Fluctuation Analysis (best for noisy data)
**Trending Threshold (0.55-0.8, Default: 0.60)**
Hurst value defining persistent market behavior:
- **0.55-0.60:** Weak trend persistence
- **0.65-0.70:** Clear trending behavior
- **0.75-0.80:** Strong momentum regimes
**Mean Reversion Threshold (0.2-0.45, Default: 0.40)**
Hurst value defining anti-persistent behavior:
- **0.35-0.45:** Weak mean reversion
- **0.25-0.35:** Clear ranging behavior
- **0.15-0.25:** Strong reversion tendency
### Transfer Entropy Parameters Group
**Information Flow Analysis:**
- **Price-Volume:** Classic flow analysis for accumulation/distribution
- **Price-Volatility:** Risk flow analysis for sentiment shifts
- **Multi-Timeframe:** Cross-timeframe causality detection
**Maximum Lag (2-20, Default: 5)**
Causality detection window:
- **2-5 bars:** Immediate causality (scalping)
- **5-10 bars:** Short-term flow (day trading)
- **10-20 bars:** Structural flow (swing trading)
**Significance Threshold (0.05-0.3, Default: 0.15)**
Minimum entropy for signal generation:
- **0.05-0.10:** Detect subtle information flows
- **0.10-0.20:** Clear causality only
- **0.20-0.30:** Very strong flows only
---
## 🎨 ADVANCED VISUAL SYSTEM
### Tensor Volatility Field Visualization
**Five-Layer Resonance Bands:**
The tensor field creates dynamic support/resistance zones that expand and contract based on mathematical field strength:
- **Core Layer (Purple):** Primary tensor field with highest intensity
- **Layer 2 (Neutral):** Secondary mathematical resonance
- **Layer 3 (Info Blue):** Tertiary harmonic frequencies
- **Layer 4 (Warning Gold):** Outer field boundaries
- **Layer 5 (Success Green):** Maximum field extension
**Field Strength Calculation:**
```
Field Strength = min(3.0, Mahalanobis Distance × Tensor Intensity)
```
The field amplitude adjusts to ATR and mathematical distance, creating dynamic zones that respond to market volatility.
**Radiation Line Network:**
During active tensor states, the system projects directional radiation lines showing field energy distribution:
- **8 Directional Rays:** Complete angular coverage
- **Tapering Segments:** Progressive transparency for natural visual flow
- **Pulse Effects:** Enhanced visualization during volatility jumps
### Dimensional Portal System
**Portal Mathematics:**
Dimensional portals visualize regime transitions using category theory principles:
- **Green Portals (◉):** Trending regime detection (appear below price for support)
- **Red Portals (◎):** Mean-reverting regime (appear above price for resistance)
- **Yellow Portals (○):** Random walk regime (neutral positioning)
**Tensor Trail Effects:**
Each portal generates 8 trailing particles showing mathematical momentum:
- **Large Particles (●):** Strong mathematical signal
- **Medium Particles (◦):** Moderate signal strength
- **Small Particles (·):** Weak signal continuation
- **Micro Particles (˙):** Signal dissipation
### Information Flow Streams
**Particle Stream Visualization:**
Transfer entropy creates flowing particle streams indicating information direction:
- **Upward Streams:** Volume leading price (accumulation phases)
- **Downward Streams:** Price leading volume (distribution phases)
- **Stream Density:** Proportional to information flow strength
**15-Particle Evolution:**
Each stream contains 15 particles with progressive sizing and transparency, creating natural flow visualization that makes information transfer immediately apparent.
### Fractal Matrix Grid System
**Multi-Timeframe Fractal Levels:**
The system calculates and displays fractal highs/lows across five Fibonacci periods:
- **8-Period:** Short-term fractal structure
- **13-Period:** Intermediate-term patterns
- **21-Period:** Primary swing levels
- **34-Period:** Major structural levels
- **55-Period:** Long-term fractal boundaries
**Triple-Layer Visualization:**
Each fractal level uses three-layer rendering:
- **Shadow Layer:** Widest, darkest foundation (width 5)
- **Glow Layer:** Medium white core line (width 3)
- **Tensor Layer:** Dotted mathematical overlay (width 1)
**Intelligent Labeling System:**
Smart spacing prevents label overlap using ATR-based minimum distances. Labels include:
- **Fractal Period:** Time-based identification
- **Topological Class:** Mathematical complexity rating (0, I, II, III)
- **Price Level:** Exact fractal price
- **Mahalanobis Distance:** Current mathematical field strength
- **Hurst Exponent:** Current regime classification
- **Anomaly Indicators:** Visual strength representations (○ ◐ ● ⚡)
### Wick Pressure Analysis
**Rejection Level Mathematics:**
The system analyzes candle wick patterns to project future pressure zones:
- **Upper Wick Analysis:** Identifies selling pressure and resistance zones
- **Lower Wick Analysis:** Identifies buying pressure and support zones
- **Pressure Projection:** Extends lines forward based on mathematical probability
**Multi-Layer Glow Effects:**
Wick pressure lines use progressive transparency (1-8 layers) creating natural glow effects that make pressure zones immediately visible without cluttering the chart.
### Enhanced Regime Background
**Dynamic Intensity Mapping:**
Background colors reflect mathematical regime strength:
- **Deep Transparency (98% alpha):** Subtle regime indication
- **Pulse Intensity:** Based on regime strength calculation
- **Color Coding:** Green (trending), Red (mean-reverting), Neutral (random)
**Smoothing Integration:**
Regime changes incorporate 10-bar smoothing to prevent background flicker while maintaining responsiveness to genuine regime shifts.
### Color Scheme System
**Six Professional Themes:**
- **Dark (Default):** Professional trading environment optimization
- **Light:** High ambient light conditions
- **Classic:** Traditional technical analysis appearance
- **Neon:** High-contrast visibility for active trading
- **Neutral:** Minimal distraction focus
- **Bright:** Maximum visibility for complex setups
Each theme maintains mathematical accuracy while optimizing visual clarity for different trading environments and personal preferences.
---
## 📊 INSTITUTIONAL-GRADE DASHBOARD
### Tensor Field Status Section
**Field Strength Display:**
Real-time Mahalanobis distance calculation with dynamic emoji indicators:
- **⚡ (Lightning):** Extreme field strength (>1.5× threshold)
- **● (Solid Circle):** Strong field activity (>1.0× threshold)
- **○ (Open Circle):** Normal field state
**Signal Quality Rating:**
Democratic algorithm assessment:
- **ELITE:** All 3 components aligned (highest probability)
- **STRONG:** 2 components aligned (good probability)
- **GOOD:** 1 component active (moderate probability)
- **WEAK:** No clear component signals
**Threshold and Anomaly Monitoring:**
- **Threshold Display:** Current mathematical threshold setting
- **Anomaly Level (0-100%):** Combined volatility and volume spike measurement
- **>70%:** High anomaly (red warning)
- **30-70%:** Moderate anomaly (orange caution)
- **<30%:** Normal conditions (green confirmation)
### Tensor State Analysis Section
**Mathematical State Classification:**
- **↑ BULL (Tensor State +1):** Trending regime with bullish bias
- **↓ BEAR (Tensor State -1):** Mean-reverting regime with bearish bias
- **◈ SUPER (Tensor State 0):** Random walk regime (neutral)
**Visual State Gauge:**
Five-circle progression showing tensor field polarity:
- **🟢🟢🟢⚪⚪:** Strong bullish mathematical alignment
- **⚪⚪🟡⚪⚪:** Neutral/transitional state
- **⚪⚪🔴🔴🔴:** Strong bearish mathematical alignment
**Trend Direction and Phase Analysis:**
- **📈 BULL / 📉 BEAR / ➡️ NEUTRAL:** Primary trend classification
- **🌪️ CHAOS:** Extreme information flow (>2.0 flow strength)
- **⚡ ACTIVE:** Strong information flow (1.0-2.0 flow strength)
- **😴 CALM:** Low information flow (<1.0 flow strength)
### Trading Signals Section
**Real-Time Signal Status:**
- **🟢 ACTIVE / ⚪ INACTIVE:** Long signal availability
- **🔴 ACTIVE / ⚪ INACTIVE:** Short signal availability
- **Components (X/3):** Active algorithmic components
- **Mode Display:** Current signal generation mode
**Signal Strength Visualization:**
Color-coded component count:
- **Green:** 3/3 components (maximum confidence)
- **Aqua:** 2/3 components (good confidence)
- **Orange:** 1/3 components (moderate confidence)
- **Gray:** 0/3 components (no signals)
### Performance Metrics Section
**Win Rate Monitoring:**
Estimated win rates based on signal quality with emoji indicators:
- **🔥 (Fire):** ≥60% estimated win rate
- **👍 (Thumbs Up):** 45-59% estimated win rate
- **⚠️ (Warning):** <45% estimated win rate
**Mathematical Metrics:**
- **Hurst Exponent:** Real-time fractal dimension (0.000-1.000)
- **Information Flow:** Volume/price leading indicators
- **📊 VOL:** Volume leading price (accumulation/distribution)
- **💰 PRICE:** Price leading volume (momentum/speculation)
- **➖ NONE:** Balanced information flow
- **Volatility Classification:**
- **🔥 HIGH:** Above 1.5× jump threshold
- **📊 NORM:** Normal volatility range
- **😴 LOW:** Below 0.5× jump threshold
### Market Structure Section (Large Dashboard)
**Regime Classification:**
- **📈 TREND:** Hurst >0.6, momentum strategies optimal
- **🔄 REVERT:** Hurst <0.4, contrarian strategies optimal
- **🎲 RANDOM:** Hurst ≈0.5, breakout strategies preferred
**Mathematical Field Analysis:**
- **Dimensions:** Current volatility space complexity (2D-5D)
- **Hawkes λ (Lambda):** Self-exciting jump intensity (0.00-1.00)
- **Jump Status:** 🚨 JUMP (active) / ✅ NORM (normal)
### Settings Summary Section (Large Dashboard)
**Active Configuration Display:**
- **Sensitivity:** Current master sensitivity setting
- **Lookback:** Primary analysis window
- **Theme:** Active color scheme
- **Method:** Hurst calculation method (Classic R/S, Adaptive R/S, DFA)
**Dashboard Sizing Options:**
- **Small:** Essential metrics only (mobile/small screens)
- **Normal:** Balanced information density (standard desktop)
- **Large:** Maximum detail (multi-monitor setups)
**Position Options:**
- **Top Right:** Standard placement (avoids price action)
- **Top Left:** Wide chart optimization
- **Bottom Right:** Recent price focus (scalping)
- **Bottom Left:** Maximum price visibility (swing trading)
---
## 🎯 SIGNAL GENERATION LOGIC
### Multi-Component Convergence System
**Component Signal Architecture:**
The TMAE generates signals through sophisticated component analysis rather than simple threshold crossing:
**Volatility Component:**
- **Jump Detection:** Mahalanobis distance threshold breach
- **Hawkes Intensity:** Self-exciting process activation (>0.2)
- **Multi-dimensional:** Considers all volatility dimensions simultaneously
**Hurst Regime Component:**
- **Trending Markets:** Price above SMA-20 with positive momentum
- **Mean-Reverting Markets:** Price at Bollinger Band extremes
- **Random Markets:** Bollinger squeeze breakouts with directional confirmation
**Transfer Entropy Component:**
- **Volume Leadership:** Information flow from volume to price
- **Volume Spike:** Volume 110%+ above 20-period average
- **Flow Significance:** Above entropy threshold with directional bias
### Democratic Signal Weighting
**Signal Mode Implementation:**
- **Aggressive Mode:** Any single component triggers signal
- **Confluence Mode:** Minimum 2 components must agree
- **Conservative Mode:** All 3 components must align
**Momentum Confirmation:**
All signals require momentum confirmation:
- **Long Signals:** RSI >50 AND price >EMA-9
- **Short Signals:** RSI <50 AND price 0.6):**
- **Increase Sensitivity:** Catch momentum continuation
- **Lower Mean Reversion Threshold:** Avoid counter-trend signals
- **Emphasize Volume Leadership:** Institutional accumulation/distribution
- **Tensor Field Focus:** Use expansion for trend continuation
- **Signal Mode:** Aggressive or Confluence for trend following
**Range-Bound Markets (Hurst <0.4):**
- **Decrease Sensitivity:** Avoid false breakouts
- **Lower Trending Threshold:** Quick regime recognition
- **Focus on Price Leadership:** Retail sentiment extremes
- **Fractal Grid Emphasis:** Support/resistance trading
- **Signal Mode:** Conservative for high-probability reversals
**Volatile Markets (High Jump Frequency):**
- **Increase Hawkes Decay:** Recognize event clustering
- **Higher Jump Threshold:** Avoid noise signals
- **Maximum Dimensions:** Capture full volatility complexity
- **Reduce Position Sizing:** Risk management adaptation
- **Enhanced Visuals:** Maximum information for rapid decisions
**Low Volatility Markets (Low Jump Frequency):**
- **Decrease Jump Threshold:** Capture subtle movements
- **Lower Hawkes Decay:** Treat moves as independent
- **Reduce Dimensions:** Simplify analysis
- **Increase Position Sizing:** Capitalize on compressed volatility
- **Minimal Visuals:** Reduce distraction in quiet markets
---
## 🚀 ADVANCED TRADING STRATEGIES
### The Mathematical Convergence Method
**Entry Protocol:**
1. **Fractal Grid Approach:** Monitor price approaching significant fractal levels
2. **Tensor Field Confirmation:** Verify field expansion supporting direction
3. **Portal Signal:** Wait for dimensional portal appearance
4. **ELITE/STRONG Quality:** Only trade highest quality mathematical signals
5. **Component Consensus:** Confirm 2+ components agree in Confluence mode
**Example Implementation:**
- Price approaching 21-period fractal high
- Tensor field expanding upward (bullish mathematical alignment)
- Green portal appears below price (trending regime confirmation)
- ELITE quality signal with 3/3 components active
- Enter long position with stop below fractal level
**Risk Management:**
- **Stop Placement:** Below/above fractal level that generated signal
- **Position Sizing:** Based on Mahalanobis distance (higher distance = smaller size)
- **Profit Targets:** Next fractal level or tensor field resistance
### The Regime Transition Strategy
**Regime Change Detection:**
1. **Monitor Hurst Exponent:** Watch for persistent moves above/below thresholds
2. **Portal Color Change:** Regime transitions show different portal colors
3. **Background Intensity:** Increasing regime background intensity
4. **Mathematical Confirmation:** Wait for regime confirmation (hysteresis)
**Trading Implementation:**
- **Trending Transitions:** Trade momentum breakouts, follow trend
- **Mean Reversion Transitions:** Trade range boundaries, fade extremes
- **Random Transitions:** Trade breakouts with tight stops
**Advanced Techniques:**
- **Multi-Timeframe:** Confirm regime on higher timeframe
- **Early Entry:** Enter on regime transition rather than confirmation
- **Regime Strength:** Larger positions during strong regime signals
### The Information Flow Momentum Strategy
**Flow Detection Protocol:**
1. **Monitor Transfer Entropy:** Watch for significant information flow shifts
2. **Volume Leadership:** Strong edge when volume leads price
3. **Flow Acceleration:** Increasing flow strength indicates momentum
4. **Directional Confirmation:** Ensure flow aligns with intended trade direction
**Entry Signals:**
- **Volume → Price Flow:** Enter during accumulation/distribution phases
- **Price → Volume Flow:** Enter on momentum confirmation breaks
- **Flow Reversal:** Counter-trend entries when flow reverses
**Optimization:**
- **Scalping:** Use immediate flow detection (2-5 bar lag)
- **Swing Trading:** Use structural flow (10-20 bar lag)
- **Multi-Asset:** Compare flow between correlated assets
### The Tensor Field Expansion Strategy
**Field Mathematics:**
The tensor field expansion indicates mathematical pressure building in market structure:
**Expansion Phases:**
1. **Compression:** Field contracts, volatility decreases
2. **Tension Building:** Mathematical pressure accumulates
3. **Expansion:** Field expands rapidly with directional movement
4. **Resolution:** Field stabilizes at new equilibrium
**Trading Applications:**
- **Compression Trading:** Prepare for breakout during field contraction
- **Expansion Following:** Trade direction of field expansion
- **Reversion Trading:** Fade extreme field expansion
- **Multi-Dimensional:** Consider all field layers for confirmation
### The Hawkes Process Event Strategy
**Self-Exciting Jump Trading:**
Understanding that market shocks cluster and create follow-on opportunities:
**Jump Sequence Analysis:**
1. **Initial Jump:** First volatility jump detected
2. **Clustering Phase:** Hawkes intensity remains elevated
3. **Follow-On Opportunities:** Additional jumps more likely
4. **Decay Period:** Intensity gradually decreases
**Implementation:**
- **Jump Confirmation:** Wait for mathematical jump confirmation
- **Direction Assessment:** Use other components for direction
- **Clustering Trades:** Trade subsequent moves during high intensity
- **Decay Exit:** Exit positions as Hawkes intensity decays
### The Fractal Confluence System
**Multi-Timeframe Fractal Analysis:**
Combining fractal levels across different periods for high-probability zones:
**Confluence Zones:**
- **Double Confluence:** 2 fractal levels align
- **Triple Confluence:** 3+ fractal levels cluster
- **Mathematical Confirmation:** Tensor field supports the level
- **Information Flow:** Transfer entropy confirms direction
**Trading Protocol:**
1. **Identify Confluence:** Find 2+ fractal levels within 1 ATR
2. **Mathematical Support:** Verify tensor field alignment
3. **Signal Quality:** Wait for STRONG or ELITE signal
4. **Risk Definition:** Use fractal level for stop placement
5. **Profit Targeting:** Next major fractal confluence zone
---
## ⚠️ COMPREHENSIVE RISK MANAGEMENT
### Mathematical Position Sizing
**Mahalanobis Distance Integration:**
Position size should inversely correlate with mathematical field strength:
```
Position Size = Base Size × (Threshold / Mahalanobis Distance)
```
**Risk Scaling Matrix:**
- **Low Field Strength (<2.0):** Standard position sizing
- **Moderate Field Strength (2.0-3.0):** 75% position sizing
- **High Field Strength (3.0-4.0):** 50% position sizing
- **Extreme Field Strength (>4.0):** 25% position sizing or no trade
### Signal Quality Risk Adjustment
**Quality-Based Position Sizing:**
- **ELITE Signals:** 100% of planned position size
- **STRONG Signals:** 75% of planned position size
- **GOOD Signals:** 50% of planned position size
- **WEAK Signals:** No position or paper trading only
**Component Agreement Scaling:**
- **3/3 Components:** Full position size
- **2/3 Components:** 75% position size
- **1/3 Components:** 50% position size or skip trade
### Regime-Adaptive Risk Management
**Trending Market Risk:**
- **Wider Stops:** Allow for trend continuation
- **Trend Following:** Trade with regime direction
- **Higher Position Size:** Trend probability advantage
- **Momentum Stops:** Trail stops based on momentum indicators
**Mean-Reverting Market Risk:**
- **Tighter Stops:** Quick exits on trend continuation
- **Contrarian Positioning:** Trade against extremes
- **Smaller Position Size:** Higher reversal failure rate
- **Level-Based Stops:** Use fractal levels for stops
**Random Market Risk:**
- **Breakout Focus:** Trade only clear breakouts
- **Tight Initial Stops:** Quick exit if breakout fails
- **Reduced Frequency:** Skip marginal setups
- **Range-Based Targets:** Profit targets at range boundaries
### Volatility-Adaptive Risk Controls
**High Volatility Periods:**
- **Reduced Position Size:** Account for wider price swings
- **Wider Stops:** Avoid noise-based exits
- **Lower Frequency:** Skip marginal setups
- **Faster Exits:** Take profits more quickly
**Low Volatility Periods:**
- **Standard Position Size:** Normal risk parameters
- **Tighter Stops:** Take advantage of compressed ranges
- **Higher Frequency:** Trade more setups
- **Extended Targets:** Allow for compressed volatility expansion
### Multi-Timeframe Risk Alignment
**Higher Timeframe Trend:**
- **With Trend:** Standard or increased position size
- **Against Trend:** Reduced position size or skip
- **Neutral Trend:** Standard position size with tight management
**Risk Hierarchy:**
1. **Primary:** Current timeframe signal quality
2. **Secondary:** Higher timeframe trend alignment
3. **Tertiary:** Mathematical field strength
4. **Quaternary:** Market regime classification
---
## 📚 EDUCATIONAL VALUE AND MATHEMATICAL CONCEPTS
### Advanced Mathematical Concepts
**Tensor Analysis in Markets:**
The TMAE introduces traders to tensor analysis, a branch of mathematics typically reserved for physics and advanced engineering. Tensors provide a framework for understanding multi-dimensional market relationships that scalar and vector analysis cannot capture.
**Information Theory Applications:**
Transfer entropy implementation teaches traders about information flow in markets, a concept from information theory that quantifies directional causality between variables. This provides intuition about market microstructure and participant behavior.
**Fractal Geometry in Trading:**
The Hurst exponent calculation exposes traders to fractal geometry concepts, helping understand that markets exhibit self-similar patterns across multiple timeframes. This mathematical insight transforms how traders view market structure.
**Stochastic Process Theory:**
The Hawkes process implementation introduces concepts from stochastic process theory, specifically self-exciting point processes. This provides mathematical framework for understanding why market events cluster and exhibit memory effects.
### Learning Progressive Complexity
**Beginner Mathematical Concepts:**
- **Volatility Dimensions:** Understanding multi-dimensional analysis
- **Regime Classification:** Learning market personality types
- **Signal Democracy:** Algorithmic consensus building
- **Visual Mathematics:** Interpreting mathematical concepts visually
**Intermediate Mathematical Applications:**
- **Mahalanobis Distance:** Statistical distance in multi-dimensional space
- **Rescaled Range Analysis:** Fractal dimension measurement
- **Information Entropy:** Quantifying uncertainty and causality
- **Field Theory:** Understanding mathematical fields in market context
**Advanced Mathematical Integration:**
- **Tensor Field Dynamics:** Multi-dimensional market force analysis
- **Stochastic Self-Excitation:** Event clustering and memory effects
- **Categorical Composition:** Mathematical signal combination theory
- **Topological Market Analysis:** Understanding market shape and connectivity
### Practical Mathematical Intuition
**Developing Market Mathematics Intuition:**
The TMAE serves as a bridge between abstract mathematical concepts and practical trading applications. Traders develop intuitive understanding of:
- **How markets exhibit mathematical structure beneath apparent randomness**
- **Why multi-dimensional analysis reveals patterns invisible to single-variable approaches**
- **How information flows through markets in measurable, predictable ways**
- **Why mathematical models provide probabilistic edges rather than certainties**
---
## 🔬 IMPLEMENTATION AND OPTIMIZATION
### Getting Started Protocol
**Phase 1: Observation (Week 1)**
1. **Apply with defaults:** Use standard settings on your primary trading timeframe
2. **Study visual elements:** Learn to interpret tensor fields, portals, and streams
3. **Monitor dashboard:** Observe how metrics change with market conditions
4. **No trading:** Focus entirely on pattern recognition and understanding
**Phase 2: Pattern Recognition (Week 2-3)**
1. **Identify signal patterns:** Note what market conditions produce different signal qualities
2. **Regime correlation:** Observe how Hurst regimes affect signal performance
3. **Visual confirmation:** Learn to read tensor field expansion and portal signals
4. **Component analysis:** Understand which components drive signals in different markets
**Phase 3: Parameter Optimization (Week 4-5)**
1. **Asset-specific tuning:** Adjust parameters for your specific trading instrument
2. **Timeframe optimization:** Fine-tune for your preferred trading timeframe
3. **Sensitivity adjustment:** Balance signal frequency with quality
4. **Visual customization:** Optimize colors and intensity for your trading environment
**Phase 4: Live Implementation (Week 6+)**
1. **Paper trading:** Test signals with hypothetical trades
2. **Small position sizing:** Begin with minimal risk during learning phase
3. **Performance tracking:** Monitor actual vs. expected signal performance
4. **Continuous optimization:** Refine settings based on real performance data
### Performance Monitoring System
**Signal Quality Tracking:**
- **ELITE Signal Win Rate:** Track highest quality signals separately
- **Component Performance:** Monitor which components provide best signals
- **Regime Performance:** Analyze performance across different market regimes
- **Timeframe Analysis:** Compare performance across different session times
**Mathematical Metric Correlation:**
- **Field Strength vs. Performance:** Higher field strength should correlate with better performance
- **Component Agreement vs. Win Rate:** More component agreement should improve win rates
- **Regime Alignment vs. Success:** Trading with mathematical regime should outperform
### Continuous Optimization Process
**Monthly Review Protocol:**
1. **Performance Analysis:** Review win rates, profit factors, and maximum drawdown
2. **Parameter Assessment:** Evaluate if current settings remain optimal
3. **Market Adaptation:** Adjust for changes in market character or volatility
4. **Component Weighting:** Consider if certain components should receive more/less emphasis
**Quarterly Deep Analysis:**
1. **Mathematical Model Validation:** Verify that mathematical relationships remain valid
2. **Regime Distribution:** Analyze time spent in different market regimes
3. **Signal Evolution:** Track how signal characteristics change over time
4. **Correlation Analysis:** Monitor correlations between different mathematical components
---
## 🌟 UNIQUE INNOVATIONS AND CONTRIBUTIONS
### Revolutionary Mathematical Integration
**First-Ever Implementations:**
1. **Multi-Dimensional Volatility Tensor:** First indicator to implement true tensor analysis for market volatility
2. **Real-Time Hawkes Process:** First trading implementation of self-exciting point processes
3. **Transfer Entropy Trading Signals:** First practical application of information theory for trade generation
4. **Democratic Component Voting:** First algorithmic consensus system for signal generation
5. **Fractal-Projected Signal Quality:** First system to predict signal quality at future price levels
### Advanced Visualization Innovations
**Mathematical Visualization Breakthroughs:**
- **Tensor Field Radiation:** Visual representation of mathematical field energy
- **Dimensional Portal System:** Category theory visualization for regime transitions
- **Information Flow Streams:** Real-time visual display of market information transfer
- **Multi-Layer Fractal Grid:** Intelligent spacing and projection system
- **Regime Intensity Mapping:** Dynamic background showing mathematical regime strength
### Practical Trading Innovations
**Trading System Advances:**
- **Quality-Weighted Signal Generation:** Signals rated by mathematical confidence
- **Regime-Adaptive Strategy Selection:** Automatic strategy optimization based on market personality
- **Anti-Spam Signal Protection:** Mathematical prevention of signal clustering
- **Component Performance Tracking:** Real-time monitoring of algorithmic component success
- **Field-Strength Position Sizing:** Mathematical volatility integration for risk management
---
## ⚖️ RESPONSIBLE USAGE AND LIMITATIONS
### Mathematical Model Limitations
**Understanding Model Boundaries:**
While the TMAE implements sophisticated mathematical concepts, traders must understand fundamental limitations:
- **Markets Are Not Purely Mathematical:** Human psychology, news events, and fundamental factors create unpredictable elements
- **Past Performance Limitations:** Mathematical relationships that worked historically may not persist indefinitely
- **Model Risk:** Complex models can fail during unprecedented market conditions
- **Overfitting Potential:** Highly optimized parameters may not generalize to future market conditions
### Proper Implementation Guidelines
**Risk Management Requirements:**
- **Never Risk More Than 2% Per Trade:** Regardless of signal quality
- **Diversification Mandatory:** Don't rely solely on mathematical signals
- **Position Sizing Discipline:** Use mathematical field strength for sizing, not confidence
- **Stop Loss Non-Negotiable:** Every trade must have predefined risk parameters
**Realistic Expectations:**
- **Mathematical Edge, Not Certainty:** The indicator provides probabilistic advantages, not guaranteed outcomes
- **Learning Curve Required:** Complex mathematical concepts require time to master
- **Market Adaptation Necessary:** Parameters must evolve with changing market conditions
- **Continuous Education Important:** Understanding underlying mathematics improves application
### Ethical Trading Considerations
**Market Impact Awareness:**
- **Information Asymmetry:** Advanced mathematical analysis may provide advantages over other market participants
- **Position Size Responsibility:** Large positions based on mathematical signals can impact market structure
- **Sharing Knowledge:** Consider educational contributions to trading community
- **Fair Market Participation:** Use mathematical advantages responsibly within market framework
### Professional Development Path
**Skill Development Sequence:**
1. **Basic Mathematical Literacy:** Understand fundamental concepts before advanced application
2. **Risk Management Mastery:** Develop disciplined risk control before relying on complex signals
3. **Market Psychology Understanding:** Combine mathematical analysis with behavioral market insights
4. **Continuous Learning:** Stay updated on mathematical finance developments and market evolution
---
## 🔮 CONCLUSION
The Tensor Market Analysis Engine represents a quantum leap forward in technical analysis, successfully bridging the gap between advanced pure mathematics and practical trading applications. By integrating multi-dimensional volatility analysis, fractal market theory, and information flow dynamics, the TMAE reveals market structure invisible to conventional analysis while maintaining visual clarity and practical usability.
### Mathematical Innovation Legacy
This indicator establishes new paradigms in technical analysis:
- **Tensor analysis for market volatility understanding**
- **Stochastic self-excitation for event clustering prediction**
- **Information theory for causality-based trade generation**
- **Democratic algorithmic consensus for signal quality enhancement**
- **Mathematical field visualization for intuitive market understanding**
### Practical Trading Revolution
Beyond mathematical innovation, the TMAE transforms practical trading:
- **Quality-rated signals replace binary buy/sell decisions**
- **Regime-adaptive strategies automatically optimize for market personality**
- **Multi-dimensional risk management integrates mathematical volatility measures**
- **Visual mathematical concepts make complex analysis immediately interpretable**
- **Educational value creates lasting improvement in trading understanding**
### Future-Proof Design
The mathematical foundations ensure lasting relevance:
- **Universal mathematical principles transcend market evolution**
- **Multi-dimensional analysis adapts to new market structures**
- **Regime detection automatically adjusts to changing market personalities**
- **Component democracy allows for future algorithmic additions**
- **Mathematical visualization scales with increasing market complexity**
### Commitment to Excellence
The TMAE represents more than an indicator—it embodies a philosophy of bringing rigorous mathematical analysis to trading while maintaining practical utility and visual elegance. Every component, from the multi-dimensional tensor fields to the democratic signal generation, reflects a commitment to mathematical accuracy, trading practicality, and educational value.
### Trading with Mathematical Precision
In an era where markets grow increasingly complex and computational, the TMAE provides traders with mathematical tools previously available only to institutional quantitative research teams. Yet unlike academic mathematical models, the TMAE translates complex concepts into intuitive visual representations and practical trading signals.
By combining the mathematical rigor of tensor analysis, the statistical power of multi-dimensional volatility modeling, and the information-theoretic insights of transfer entropy, traders gain unprecedented insight into market structure and dynamics.
### Final Perspective
Markets, like nature, exhibit profound mathematical beauty beneath apparent chaos. The Tensor Market Analysis Engine serves as a mathematical lens that reveals this hidden order, transforming how traders perceive and interact with market structure.
Through mathematical precision, visual elegance, and practical utility, the TMAE empowers traders to see beyond the noise and trade with the confidence that comes from understanding the mathematical principles governing market behavior.
Trade with mathematical insight. Trade with the power of tensors. Trade with the TMAE.
*"In mathematics, you don't understand things. You just get used to them." - John von Neumann*
*With the TMAE, mathematical market understanding becomes not just possible, but intuitive.*
— Dskyz, Trade with insight. Trade with anticipation.
Green*DiamondGreen*Diamond (GD1)
Unleash Dynamic Trading Signals with Volatility and Momentum
Overview
GreenDiamond is a versatile overlay indicator designed for traders seeking actionable buy and sell signals across various markets and timeframes. Combining Volatility Bands (VB) bands, Consolidation Detection, MACD, RSI, and a unique Ribbon Wave, it highlights high-probability setups while filtering out noise. With customizable signals like Green-Yellow Buy, Pullback Sell, and Inverse Pullback Buy, plus vibrant candle and volume visuals, GreenDiamond adapts to your trading style—whether you’re scalping, day trading, or swing trading.
Key Features
Volatility Bands (VB): Plots dynamic upper and lower bands to identify breakouts or reversals, with toggleable buy/sell signals outside consolidation zones.
Consolidation Detection: Marks low-range periods to avoid choppy markets, ensuring signals fire during trending conditions.
MACD Signals: Offers flexible buy/sell conditions (e.g., cross above signal, above zero, histogram up) with RSI divergence integration for precision.
RSI Filter: Enhances signals with customizable levels (midline, oversold/overbought) and bullish divergence detection.
Ribbon Wave: Visualizes trend strength using three EMAs, colored by MACD and RSI for intuitive momentum cues.
Custom Signals: Includes Green-Yellow Buy, Pullback Sell, and Inverse Pullback Buy, with limits on consecutive signals to prevent overtrading.
Candle & Volume Styling: Blends MACD/RSI colors on candles and scales volume bars to highlight momentum spikes.
Alerts: Set up alerts for VB signals, MACD crosses, Green*Diamond signals, and custom conditions to stay on top of opportunities.
How It Works
Green*Diamond integrates multiple indicators to generate signals:
Volatility Bands: Calculates bands using a pivot SMA and standard deviation. Buy signals trigger on crossovers above the lower band, sell signals on crossunders below the upper band (if enabled).
Consolidation Filter: Suppresses signals when candle ranges are below a threshold, keeping you out of flat markets.
MACD & RSI: Combines MACD conditions (e.g., cross above signal) with RSI filters (e.g., above midline) and optional volume spikes for robust signals.
Custom Logic: Green-Yellow Buy uses MACD bullishness, Pullback Sell targets retracements, and Inverse Pullback Buy catches reversals after downmoves—all filtered to avoid consolidation.
Visuals: Ribbon Wave shows trend direction, candles blend momentum colors, and volume bars scale dynamically to confirm signals.
Settings
Volatility Bands Settings:
VB Lookback Period (20): Adjust to 10–15 for faster markets (e.g., 1-minute scalping) or 25–30 for daily charts.
Upper/Lower Band Multiplier (1.0): Increase to 1.5–2.0 for wider bands in volatile stocks like AEHL; decrease to 0.5 for calmer markets.
Show Volatility Bands: Toggle off to reduce chart clutter.
Use VB Signals: Enable for breakout-focused trades; disable to focus on Green*Diamond signals.
Consolidation Settings:
Consolidation Lookback (14): Set to 5–10 for small caps (e.g., AEHL) to catch quick consolidations; 20 for higher timeframes.
Range Threshold (0.5): Lower to 0.3 for stricter filtering in choppy markets; raise to 0.7 for looser signals.
MACD Settings:
Fast/Slow Length (12/26): Shorten to 8/21 for scalping; extend to 15/34 for swing trading.
Signal Smoothing (9): Reduce to 5 for faster signals; increase to 12 for smoother trends.
Buy/Sell Signal Options: Choose “Cross Above Signal” for classic MACD; “Histogram Up” for momentum plays.
Use RSI Div + MACD Cross: Enable for high-probability reversal signals.
RSI Settings:
RSI Period (14): Drop to 10 for 1-minute charts; raise to 20 for daily.
Filter Level (50): Set to 55 for stricter buys; 45 for sells.
Overbought/Oversold (70/30): Tighten to 65/35 for small caps; widen to 75/25 for indices.
RSI Buy/Sell Options: Select “Bullish Divergence” for reversals; “Cross Above Oversold” for momentum.
Color Settings:
Adjust bullish/bearish colors for visibility (e.g., brighter green/red for dark themes).
Border Thickness (1): Increase to 2–3 for clearer candle outlines.
Volume Settings:
Volume Average Length (20): Shorten to 10 for scalping; extend to 30 for swing trades.
Volume Multiplier (2.0): Raise to 3.0 for AEHL’s volume surges; lower to 1.5 for steady stocks.
Bar Height (10%): Increase to 15% for prominent bars; decrease to 5% to reduce clutter.
Ribbon Settings:
EMA Periods (10/20/30): Tighten to 5/10/15 for scalping; widen to 20/40/60 for trends.
Color by MACD/RSI: Disable for simpler visuals; enable for dynamic momentum cues.
Gradient Fill: Toggle on for trend clarity; off for minimalism.
Custom Signals:
Enable Green-Yellow Buy: Use for momentum confirmation; limit to 1–2 signals to avoid spam.
Pullback/Inverse Pullback % (50): Set to 30–40% for small caps; 60–70% for indices.
Max Buy Signals (1): Increase to 2–3 for active markets; keep at 1 for discipline.
Tips and Tricks
Scalping Small Caps (e.g., AEHL):
Use 1-minute charts with VB Lookback = 10, Consolidation Lookback = 5, and Volume Multiplier = 3.0 to catch $0.10–$0.20 moves.
Enable Green-Yellow Buy and Inverse Pullback Buy for quick entries; disable VB Signals to focus on Green*Diamond logic.
Pair with SMC+ green boxes (if you use them) for reversal confirmation.
Day Trading:
Try 5-minute charts with MACD Fast/Slow = 8/21 and RSI Period = 10.
Enable RSI Divergence + MACD Cross for high-probability setups; set Max Buy Signals = 2.
Watch for volume bars turning yellow to confirm entries.
Swing Trading:
Use daily charts with VB Lookback = 30, Ribbon EMAs = 20/40/60.
Enable Pullback Sell (60%) to exit after rallies; disable RSI Color for cleaner candles.
Check Ribbon Wave gradient for trend strength—bright green signals strong bulls.
Avoiding Noise:
Increase Consolidation Threshold to 0.7 on volatile days to skip false breakouts.
Disable Ribbon Wave or Volume Bars if the chart feels crowded.
Limit Max Buy Signals to 1 for disciplined trading.
Alert Setup:
In TradingView’s Alerts panel, select:
“GD Buy Signal” for standard entries.
“RSI Div + MACD Cross Buy” for reversals.
“VB Buy Signal” for breakout plays.
Set to “Once Per Bar Close” for confirmed signals; “Once Per Bar” for scalping.
Backtesting:
Replay on small caps ( Float < 5M, Price $0.50–$5) to test signals.
Focus on “GD Buy Signal” with yellow volume bars and green Ribbon Wave.
Avoid signals during gray consolidation squares unless paired with RSI Divergence.
Usage Notes
Markets: Works on stocks, forex, crypto, and indices. Best for volatile assets (e.g., small-cap stocks, BTCUSD).
Timeframes: Scalping (1–5 minutes), day trading (15–60 minutes), or swing trading (daily). Adjust settings per timeframe.
Risk Management: Combine with stop-losses (e.g., 1% risk, $0.05 below AEHL entry) and take-profits (3–5%).
Customization: Tweak inputs to match your strategy—experiment in replay to find your sweet spot.
Disclaimer
Green*Diamond is a technical tool to assist with trade identification, not a guarantee of profits. Trading involves risks, and past performance doesn’t predict future results. Always conduct your own analysis, manage risk, and test settings before live trading.
Feedback
Love Green*Diamond? Found a killer setup?
ICT Turtle Soup (Riz)The ICT Turtle Soup Complete System is an advanced implementation of the Inner Circle Trader's interpretation of the classic Turtle Soup pattern, designed to identify and trade liquidity sweeps at key market levels. This strategy capitalizes on the systematic stop-loss hunting behavior of institutional traders by detecting when price temporarily breaches significant support/resistance levels to trigger retail stop-losses, then quickly reverses direction.
Core Trading Logic
Liquidity Sweep Detection Method
The strategy monitors five critical liquidity pools where retail traders commonly place stop-loss orders:
⦁ Yesterday's High/Low: Previous daily session extremes
⦁ Daily High/Low: Rolling 20-day period extremes
⦁ 4-Hour High/Low: 30-period extremes on 4H timeframe
⦁ 1-Hour High/Low: 50-period extremes on hourly timeframe
⦁ Recent High/Low: Current timeframe extremes (20-40 bars based on trading mode)
Entry Signal Generation Process
Buy Signal (Sell-Side Liquidity Sweep):
1. Price penetrates below a key support level by a minimum threshold (5-15 ticks depending on signal quality settings)
2. The penetration bar must show strong rejection with at least 30-50% of the candle's range closing back above the swept level
3. Multi-timeframe confirmation checks for structure shift on lower timeframe (break of recent swing high)
4. Confluence scoring system evaluates 7 factors, requiring minimum 3 confirmations:
⦁ Liquidity sweep detected (weighted 2x)
⦁ Higher timeframe bullish market structure
⦁ Lower timeframe bullish break of structure
⦁ Bullish Fair Value Gap presence
⦁ Bullish Order Block formation
⦁ ICT Kill Zone timing alignment
Sell Signal (Buy-Side Liquidity Sweep):
Mirror opposite of buy signal logic, detecting sweeps above resistance levels with bearish rejection.
Risk Management & Position Sizing
Stop Loss Placement:
⦁ Calculated using ATR (Average True Range) multiplied by an adaptive factor
⦁ Base multipliers: Scalping (1.0x), Day Trading (1.5x), Swing Trading (2.0x)
⦁ Further adjusted by signal quality: Conservative (-20%), Balanced (0%), Aggressive (+20%)
⦁ Positioned beyond the liquidity sweep point to avoid re-sweeping
Take Profit Targets:
⦁ TP1: 2.0R (Risk-Reward ratio)
⦁ TP2: 3.5R
⦁ TP3: 5.0R
⦁ All levels rounded to tick precision for accurate order placement
Advanced Features & Filters
Multi-Timeframe Structure Analysis
The system performs top-down analysis across three timeframes:
⦁ Higher Timeframe (HTF): Determines primary trend bias
⦁ Medium Timeframe (MTF): Confirms intermediate structure
⦁ Lower Timeframe (LTF): Identifies precise entry triggers
ICT Kill Zones
Incorporates time-based filtering for optimal trading sessions:
⦁ Asian Session (8PM-12AM UTC)
⦁ London Session (2AM-5AM UTC)
⦁ New York Session (7AM-10AM UTC)
⦁ London Close (10AM-12PM UTC)
Smart Money Concepts Integration
⦁ Fair Value Gaps (FVG): Identifies and displays price inefficiencies that act as magnets
⦁ Order Blocks: Marks institutional accumulation/distribution zones
⦁ Mitigation Detection: Automatically removes FVGs and Order Blocks when price fills them
⦁ Duplicate Sweep Prevention: 10-bar lookback prevents multiple signals at same level
Adaptive Trading Modes
Three pre-configured modes automatically adjust all parameters:
⦁ Scalping: Tight stops, quick targets, 15-minute to 1-hour focus
⦁ Day Trading: Balanced approach, 4-hour to daily analysis
⦁ Swing Trading: Wide stops, extended targets, daily to weekly perspective
⦁ Custom Mode: Full manual control of all parameters
Signal Quality Management
⦁ Conservative: Requires 5/7 confluence factors, tighter sweep threshold (5 ticks), 50% minimum rejection
⦁ Balanced: Standard 3/7 confluence, moderate threshold (10 ticks), 30% rejection
⦁ Aggressive: Only 2/7 confluence needed, wider threshold (15 ticks), 20% rejection
Visual Components & Dashboard
Real-Time Information Panel
Displays current market conditions including:
⦁ Active trading mode and quality settings
⦁ Timeframe configuration (HTF/MTF/LTF)
⦁ Market bias from higher timeframes
⦁ Current kill zone status
⦁ Liquidity sweep detection status
⦁ Confluence scoring for both directions
⦁ Risk parameters and targets
Trade Visualization
⦁ Entry, stop-loss, and three take-profit levels with precise price labels
⦁ Automatic cleanup when targets are hit or new signals appear
⦁ Maximum of one active setup displayed for chart clarity
⦁ Color-coded boxes for Fair Value Gaps and Order Blocks
How to Use This Indicator
Recommended Timeframes
⦁ Scalping Mode: 1-minute to 5-minute charts
⦁ Day Trading Mode: 5-minute to 15-minute charts
⦁ Swing Trading Mode: 1-hour to 4-hour charts
Optimal Market Conditions
⦁ Works best in ranging or trending markets with clear support/resistance levels
⦁ Most effective during high-liquidity sessions (London/New York overlap)
⦁ Avoid using during major news events unless specifically targeting news-driven sweeps
Signal Interpretation
1. Wait for triangle signal (up/down) with confluence score
2. Verify the swept level shown in the dashboard
3. Confirm risk-reward ratios match your trading plan
4. Enter at market or set limit order at indicated entry level
5. Place stop-loss and take-profit orders at displayed levels
Customization Tips
⦁ Adjust Signal Quality based on market volatility (Conservative for volatile, Aggressive for quiet)
⦁ Modify sweep threshold if getting too many/few signals
⦁ Toggle individual liquidity levels based on their relevance to your timeframe
⦁ Use Kill Zone filter for session-specific trading
Risk Disclaimer
This indicator identifies potential trade setups based on liquidity sweep patterns but does not guarantee profitable outcomes. Past performance does not indicate future results. Always use proper risk management and never risk more than you can afford to lose. The indicator should be used as part of a comprehensive trading plan that includes your own analysis and risk tolerance assessment.
HMA V1 – Hull ATR SuperTrend with HTF Gate (Optimized for ES & NOverview
HMA V1 is a directional trend-following indicator designed for ES and NQ futures, combining a Hull ATR-based SuperTrend system with a Higher Timeframe HMA gate to filter entries. It can also be used on major indices and liquid stocks, but accuracy will be lower compared to ES/NQ optimization.
The indicator generates Buy and Sell signals based on the alignment of short-term price action with the higher timeframe trend filter. The logic is tuned for both scalping (more frequent signals, lower win rate) and day trading (fewer signals, higher win rate).
⸻
Signal Logic
1. Base Trend Engine:
• Uses an ATR-based Hull Moving Average (HMA) to dynamically calculate upper and lower bands for trend detection.
• Price crossing above the upper band in an uptrend = potential Buy trigger.
• Price crossing below the lower band in a downtrend = potential Sell trigger.
2. HTF HMA Gate Filter:
• All signals must pass a Higher Timeframe HMA check to confirm the broader trend direction.
• This acts as a noise filter, reducing false signals in choppy conditions.
3. Timeframe Behavior:
• Long Signals:
• Works best on 15m for day trading (higher win rate).
• 5m gives more scalping opportunities but with more false signals.
• If you want to trade longs, uncheck “Lock Long Signals to Specific Timeframe” for flexibility.
• Short Signals:
• Currently only coded to appear on 5m timeframe (bug to be fixed in future versions).
4. Partial Profit Logic (optional):
• Although not enforced in this version, the system is often used with partial profit-taking at fixed % targets and moving stops to breakeven after P1.
⸻
Best Use Practices:
• ES/NQ Futures: Best performance and most accurate filtering.
• Other Indices/Stocks: Usable but expect lower accuracy; re-tune ATR/HMA parameters for better results.
• Scalping: Use 5m for quicker entries, accept more noise.
• Day Trading: Use 15m for fewer, higher-probability setups.
• Always combine with your own market structure and higher timeframe bias for best results.
⸻
Known Bugs / Limitations:
• Long signal lock is sometimes overly restrictive — uncheck the “Lock Long Signals to Specific Timeframe” option to see more entries.
• Short signals currently only appear on the 5m timeframe.
Daily Short-Term Levels & Pivots with BOS/CHoCHDaily Short-Term Levels & Pivots with BOS/CHoCH
OverviewThis indicator combines essential tools for short-term and long-term traders, integrating Daily Short-Term Levels (NDCP), Pivots, and detection of Break of Structure (BOS) and Change of Character (CHoCH). Designed for TradingView, it’s ideal for scalping, day trading, and market structure analysis across any timeframe. It provides clear visualization of key levels, pivots, and structural patterns, with customizable settings to suit various trading styles.
Key Features
1. Daily Short-Term Levels (NDCP)
Purpose: Displays support and resistance levels based on the daily open, calculated as bullish and bearish percentages.
Levels: Up to 10 bullish levels (L+1 to L+10) and 10 bearish levels (L-1 to L-10), with configurable percentages (default: 0.236% to 2.618%).
Daily Open: A line marking the daily open price, with an option to display its value.
Customization:
Enable/disable levels and daily open.
Adjust colors, line thickness, and style (solid, dashed, dotted).
Position labels (Left, Right, Center) with adjustable offsets.
Show levels on all timeframes or only on daily and higher.
2. Pivots
Purpose: Identifies significant highs and lows (pivots) on the chart, useful for spotting reversal or continuation points.
Visualization: Green triangles (highs) and red triangles (lows) mark pivot points.
Customization:
Enable/disable pivot visualization.
Adjust the number of left and right bars to define pivots (default: 5 bars).
Change triangle colors.
3. Break of Structure (BOS) and Change of Character (CHoCH)
Purpose: Detects Break of Structure (BOS) and Change of Character (CHoCH) based on pivots, aiding in trend identification and reversals.
Visualization:
Resistance (green) and support (red) lines drawn from the latest pivots.
Labels for "BOS" (trend continuation), "CHoCH" (trend reversal), and "CD" (cross detected).
Historical CHoCH lines (optional, dotted) to track past structural changes.
Customization:
Enable/disable BOS/CHoCH and historical CHoCH lines.
Adjust colors and thickness for lines and labels.
Configure pivot sensitivity for BOS/CHoCH detection.
Indicator Settings
General Settings
Enable Daily Short-Term Levels: Toggle daily open-based levels.
Enable Pivots: Show triangles for significant highs/lows.
Enable BOS and CHoCH: Activate detection of structural breaks and reversals.
Daily Short-Term Levels
Show Daily Levels: Enable/disable bullish and bearish level lines.
Enable on All Timeframes: Display levels on intraday timeframes (e.g., 1M, 5M).
Text Color: Set the color for level labels.
Daily Open: Options to show the open line, its value, color, thickness, and style.
Label Alignment: Left (near daily open), Right (chart edge), or Center, with adjustable offsets.
Bullish/Bearish Levels: Configure percentages (0.236% to 2.618%), colors, line thickness, style, and value visibility.
Pivots and BOS/CHoCH
Pivot Colors: Green for highs, red for lows.
Left/Right Bars: Define pivot sensitivity (number of bars without breaking the high/low).
Show BOS: Enable labels for structural breaks.
Show Historical CHoCH Lines: Display dotted lines for past CHoCH events.
Colors and Thickness: Customize support, resistance, BOS, CHoCH lines, and "CD" labels.
How to Use
Add to Chart:
Search for "Daily Short-Term Levels & Pivots with BOS/CHoCH" in TradingView’s indicators and add it.
Initial Setup:
By default, daily levels, pivots, and BOS/CHoCH are enabled.
Adjust level percentages, colors, and styles to match your strategy.
Interpretation:
Daily Levels: Use bullish (L+1 to L+10) and bearish (L-1 to L-10) levels as support/resistance zones for entries, exits, or stops.
Pivots: Triangles mark key reversal or continuation points. Use them to confirm trends or identify high-probability zones.
BOS/CHoCH:
BOS: Indicates trend continuation (bullish if breaking a support, bearish if breaking a resistance).
CHoCH: Signals a potential trend reversal (bullish to bearish or vice versa).
CD: Confirms a pivot level cross, marking the start of a BOS or CHoCH.
Timeframes:
Ideal for scalping (1M, 5M) with "Enable on All Timeframes" activated.
Effective on higher timeframes (4H, D) for structural analysis.
Customization:
Adjust pivot bars (left_bars, right_bars) for more/less sensitivity.
Configure label offsets to avoid clutter on detailed charts.
Notes and Recommendations
Scalping: Use low timeframes (1M, 5M) with "Enable on All Timeframes" for visible daily levels. Set left_bars/right_bars to lower values (3-5) for faster pivots.
Swing Trading: On higher timeframes (4H, D), daily levels and BOS/CHoCH help identify key trend zones.
Avoid Clutter: If labels overlap, adjust offset_etiquetas, offset_derecha, or offset_centro, or select "Right" or "Center" alignment.
Testing: Experiment with percentage settings and styles to suit your market (Forex, stocks, crypto, etc.).
Limitations: On very low timeframes, pivots may be sensitive to noise. Increase left_bars/right_bars for more robust pivots.
Acknowledgments
Developed with passion for the TradingView community. I hope this indicator enhances your technical analysis! Feel free to leave feedback or contact me with suggestions or issues.
Happy trading!
Langlands-Operadic Möbius Vortex (LOMV)Langlands-Operadic Möbius Vortex (LOMV)
Where Pure Mathematics Meets Market Reality
A Revolutionary Synthesis of Number Theory, Category Theory, and Market Dynamics
🎓 THEORETICAL FOUNDATION
The Langlands-Operadic Möbius Vortex represents a groundbreaking fusion of three profound mathematical frameworks that have never before been combined for market analysis:
The Langlands Program: Harmonic Analysis in Markets
Developed by Robert Langlands (Fields Medal recipient), the Langlands Program creates bridges between number theory, algebraic geometry, and harmonic analysis. In our indicator:
L-Function Implementation:
- Utilizes the Möbius function μ(n) for weighted price analysis
- Applies Riemann zeta function convergence principles
- Calculates quantum harmonic resonance between -2 and +2
- Measures deep mathematical patterns invisible to traditional analysis
The L-Function core calculation employs:
L_sum = Σ(return_val × μ(n) × n^(-s))
Where s is the critical strip parameter (0.5-2.5), controlling mathematical precision and signal smoothness.
Operadic Composition Theory: Multi-Strategy Democracy
Category theory and operads provide the mathematical framework for composing multiple trading strategies into a unified signal. This isn't simple averaging - it's mathematical composition using:
Strategy Composition Arity (2-5 strategies):
- Momentum analysis via RSI transformation
- Mean reversion through Bollinger Band mathematics
- Order Flow Polarity Index (revolutionary T3-smoothed volume analysis)
- Trend detection using Directional Movement
- Higher timeframe momentum confirmation
Agreement Threshold System: Democratic voting where strategies must reach consensus before signal generation. This prevents false signals during market uncertainty.
Möbius Function: Number Theory in Action
The Möbius function μ(n) forms the mathematical backbone:
- μ(n) = 1 if n is a square-free positive integer with even number of prime factors
- μ(n) = -1 if n is a square-free positive integer with odd number of prime factors
- μ(n) = 0 if n has a squared prime factor
This creates oscillating weights that reveal hidden market periodicities and harmonic structures.
🔧 COMPREHENSIVE INPUT SYSTEM
Langlands Program Parameters
Modular Level N (5-50, default 30):
Primary lookback for quantum harmonic analysis. Optimized by timeframe:
- Scalping (1-5min): 15-25
- Day Trading (15min-1H): 25-35
- Swing Trading (4H-1D): 35-50
- Asset-specific: Crypto 15-25, Stocks 30-40, Forex 35-45
L-Function Critical Strip (0.5-2.5, default 1.5):
Controls Riemann zeta convergence precision:
- Higher values: More stable, smoother signals
- Lower values: More reactive, catches quick moves
- High frequency: 0.8-1.2, Medium: 1.3-1.7, Low: 1.8-2.3
Frobenius Trace Period (5-50, default 21):
Galois representation lookback for price-volume correlation:
- Measures harmonic relationships in market flows
- Scalping: 8-15, Day Trading: 18-25, Swing: 25-40
HTF Multi-Scale Analysis:
Higher timeframe context prevents trading against major trends:
- Provides market bias and filters signals
- Improves win rates by 15-25% through trend alignment
Operadic Composition Parameters
Strategy Composition Arity (2-5, default 4):
Number of algorithms composed for final signal:
- Conservative: 4-5 strategies (higher confidence)
- Moderate: 3-4 strategies (balanced approach)
- Aggressive: 2-3 strategies (more frequent signals)
Category Agreement Threshold (2-5, default 3):
Democratic voting minimum for signal generation:
- Higher agreement: Fewer but higher quality signals
- Lower agreement: More signals, potential false positives
Swiss-Cheese Mixing (0.1-0.5, default 0.382):
Golden ratio φ⁻¹ based blending of trend factors:
- 0.382 is φ⁻¹, optimal for natural market fractals
- Higher values: Stronger trend following
- Lower values: More contrarian signals
OFPI Configuration:
- OFPI Length (5-30, default 14): Order Flow calculation period
- T3 Smoothing (3-10, default 5): Advanced exponential smoothing
- T3 Volume Factor (0.5-1.0, default 0.7): Smoothing aggressiveness control
Unified Scoring System
Component Weights (sum ≈ 1.0):
- L-Function Weight (0.1-0.5, default 0.3): Mathematical harmony emphasis
- Galois Rank Weight (0.1-0.5, default 0.2): Market structure complexity
- Operadic Weight (0.1-0.5, default 0.3): Multi-strategy consensus
- Correspondence Weight (0.1-0.5, default 0.2): Theory-practice alignment
Signal Threshold (0.5-10.0, default 5.0):
Quality filter producing:
- 8.0+: EXCEPTIONAL signals only
- 6.0-7.9: STRONG signals
- 4.0-5.9: MODERATE signals
- 2.0-3.9: WEAK signals
🎨 ADVANCED VISUAL SYSTEM
Multi-Dimensional Quantum Aura Bands
Five-layer resonance field showing market energy:
- Colors: Theme-matched gradients (Quantum purple, Holographic cyan, etc.)
- Expansion: Dynamic based on score intensity and volatility
- Function: Multi-timeframe support/resistance zones
Morphism Flow Portals
Category theory visualization showing market topology:
- Green/Cyan Portals: Bullish mathematical flow
- Red/Orange Portals: Bearish mathematical flow
- Size/Intensity: Proportional to signal strength
- Recursion Depth (1-8): Nested patterns for flow evolution
Fractal Grid System
Dynamic support/resistance with projected L-Scores:
- Multiple Timeframes: 10, 20, 30, 40, 50-period highs/lows
- Smart Spacing: Prevents level overlap using ATR-based minimum distance
- Projections: Estimated signal scores when price reaches levels
- Usage: Precise entry/exit timing with mathematical confirmation
Wick Pressure Analysis
Rejection level prediction using candle mathematics:
- Upper Wicks: Selling pressure zones (purple/red lines)
- Lower Wicks: Buying pressure zones (purple/green lines)
- Glow Intensity (1-8): Visual emphasis and line reach
- Application: Confluence with fractal grid creates high-probability zones
Regime Intensity Heatmap
Background coloring showing market energy:
- Black/Dark: Low activity, range-bound markets
- Purple Glow: Building momentum and trend development
- Bright Purple: High activity, strong directional moves
- Calculation: Combines trend, momentum, volatility, and score intensity
Six Professional Themes
- Quantum: Purple/violet for general trading and mathematical focus
- Holographic: Cyan/magenta optimized for cryptocurrency markets
- Crystalline: Blue/turquoise for conservative, stability-focused trading
- Plasma: Gold/magenta for high-energy volatility trading
- Cosmic Neon: Bright neon colors for maximum visibility and aggressive trading
📊 INSTITUTIONAL-GRADE DASHBOARD
Unified AI Score Section
- Total Score (-10 to +10): Primary decision metric
- >5: Strong bullish signals
- <-5: Strong bearish signals
- Quality ratings: EXCEPTIONAL > STRONG > MODERATE > WEAK
- Component Analysis: Individual L-Function, Galois, Operadic, and Correspondence contributions
Order Flow Analysis
Revolutionary OFPI integration:
- OFPI Value (-100% to +100%): Real buying vs selling pressure
- Visual Gauge: Horizontal bar chart showing flow intensity
- Momentum Status: SHIFTING, ACCELERATING, STRONG, MODERATE, or WEAK
- Trading Application: Flow shifts often precede major moves
Signal Performance Tracking
- Win Rate Monitoring: Real-time success percentage with emoji indicators
- Signal Count: Total signals generated for frequency analysis
- Current Position: LONG, SHORT, or NONE with P&L tracking
- Volatility Regime: HIGH, MEDIUM, or LOW classification
Market Structure Analysis
- Möbius Field Strength: Mathematical field oscillation intensity
- CHAOTIC: High complexity, use wider stops
- STRONG: Active field, normal position sizing
- MODERATE: Balanced conditions
- WEAK: Low activity, consider smaller positions
- HTF Trend: Higher timeframe bias (BULL/BEAR/NEUTRAL)
- Strategy Agreement: Multi-algorithm consensus level
Position Management
When in trades, displays:
- Entry Price: Original signal price
- Current P&L: Real-time percentage with risk level assessment
- Duration: Bars in trade for timing analysis
- Risk Level: HIGH/MEDIUM/LOW based on current exposure
🚀 SIGNAL GENERATION LOGIC
Balanced Long/Short Architecture
The indicator generates signals through multiple convergent pathways:
Long Entry Conditions:
- Score threshold breach with algorithmic agreement
- Strong bullish order flow (OFPI > 0.15) with positive composite signal
- Bullish pattern recognition with mathematical confirmation
- HTF trend alignment with momentum shifting
- Extreme bullish OFPI (>0.3) with any positive score
Short Entry Conditions:
- Score threshold breach with bearish agreement
- Strong bearish order flow (OFPI < -0.15) with negative composite signal
- Bearish pattern recognition with mathematical confirmation
- HTF trend alignment with momentum shifting
- Extreme bearish OFPI (<-0.3) with any negative score
Exit Logic:
- Score deterioration below continuation threshold
- Signal quality degradation
- Opposing order flow acceleration
- 10-bar minimum between signals prevents overtrading
⚙️ OPTIMIZATION GUIDELINES
Asset-Specific Settings
Cryptocurrency Trading:
- Modular Level: 15-25 (capture volatility)
- L-Function Precision: 0.8-1.3 (reactive to price swings)
- OFPI Length: 10-20 (fast correlation shifts)
- Cascade Levels: 5-7, Theme: Holographic
Stock Index Trading:
- Modular Level: 25-35 (balanced trending)
- L-Function Precision: 1.5-1.8 (stable patterns)
- OFPI Length: 14-20 (standard correlation)
- Cascade Levels: 4-5, Theme: Quantum
Forex Trading:
- Modular Level: 35-45 (smooth trends)
- L-Function Precision: 1.6-2.1 (high smoothing)
- OFPI Length: 18-25 (disable volume amplification)
- Cascade Levels: 3-4, Theme: Crystalline
Timeframe Optimization
Scalping (1-5 minute charts):
- Reduce all lookback parameters by 30-40%
- Increase L-Function precision for noise reduction
- Enable all visual elements for maximum information
- Use Small dashboard to save screen space
Day Trading (15 minute - 1 hour):
- Use default parameters as starting point
- Adjust based on market volatility
- Normal dashboard provides optimal information density
- Focus on OFPI momentum shifts for entries
Swing Trading (4 hour - Daily):
- Increase lookback parameters by 30-50%
- Higher L-Function precision for stability
- Large dashboard for comprehensive analysis
- Emphasize HTF trend alignment
🏆 ADVANCED TRADING STRATEGIES
The Mathematical Confluence Method
1. Wait for Fractal Grid level approach
2. Confirm with projected L-Score > threshold
3. Verify OFPI alignment with direction
4. Enter on portal signal with quality ≥ STRONG
5. Exit on score deterioration or opposing flow
The Regime Trading System
1. Monitor Aether Flow background intensity
2. Trade aggressively during bright purple periods
3. Reduce position size during dark periods
4. Use Möbius Field strength for stop placement
5. Align with HTF trend for maximum probability
The OFPI Momentum Strategy
1. Watch for momentum shifting detection
2. Confirm with accelerating flow in direction
3. Enter on immediate portal signal
4. Scale out at Fibonacci levels
5. Exit on flow deceleration or reversal
⚠️ RISK MANAGEMENT INTEGRATION
Mathematical Position Sizing
- Use Galois Rank for volatility-adjusted sizing
- Möbius Field strength determines stop width
- Fractal Dimension guides maximum exposure
- OFPI momentum affects entry timing
Signal Quality Filtering
- Trade only STRONG or EXCEPTIONAL quality signals
- Increase position size with higher agreement levels
- Reduce risk during CHAOTIC Möbius field periods
- Respect HTF trend alignment for directional bias
🔬 DEVELOPMENT JOURNEY
Creating the LOMV was an extraordinary mathematical undertaking that pushed the boundaries of what's possible in technical analysis. This indicator almost didn't happen. The theoretical complexity nearly proved insurmountable.
The Mathematical Challenge
Implementing the Langlands Program required deep research into:
- Number theory and the Möbius function
- Riemann zeta function convergence properties
- L-function analytical continuation
- Galois representations in finite fields
The mathematical literature spans decades of pure mathematics research, requiring translation from abstract theory to practical market application.
The Computational Complexity
Operadic composition theory demanded:
- Category theory implementation in Pine Script
- Multi-dimensional array management for strategy composition
- Real-time democratic voting algorithms
- Performance optimization for complex calculations
The Integration Breakthrough
Bringing together three disparate mathematical frameworks required:
- Novel approaches to signal weighting and combination
- Revolutionary Order Flow Polarity Index development
- Advanced T3 smoothing implementation
- Balanced signal generation preventing directional bias
Months of intensive research culminated in breakthrough moments when the mathematics finally aligned with market reality. The result is an indicator that reveals market structure invisible to conventional analysis while maintaining practical trading utility.
🎯 PRACTICAL IMPLEMENTATION
Getting Started
1. Apply indicator with default settings
2. Select appropriate theme for your markets
3. Observe dashboard metrics during different market conditions
4. Practice signal identification without trading
5. Gradually adjust parameters based on observations
Signal Confirmation Process
- Never trade on score alone - verify quality rating
- Confirm OFPI alignment with intended direction
- Check fractal grid level proximity for timing
- Ensure Möbius field strength supports position size
- Validate against HTF trend for bias confirmation
Performance Monitoring
- Track win rate in dashboard for strategy assessment
- Monitor component contributions for optimization
- Adjust threshold based on desired signal frequency
- Document performance across different market regimes
🌟 UNIQUE INNOVATIONS
1. First Integration of Langlands Program mathematics with practical trading
2. Revolutionary OFPI with T3 smoothing and momentum detection
3. Operadic Composition using category theory for signal democracy
4. Dynamic Fractal Grid with projected L-Score calculations
5. Multi-Dimensional Visualization through morphism flow portals
6. Regime-Adaptive Background showing market energy intensity
7. Balanced Signal Generation preventing directional bias
8. Professional Dashboard with institutional-grade metrics
📚 EDUCATIONAL VALUE
The LOMV serves as both a practical trading tool and an educational gateway to advanced mathematics. Traders gain exposure to:
- Pure mathematics applications in markets
- Category theory and operadic composition
- Number theory through Möbius function implementation
- Harmonic analysis via L-function calculations
- Advanced signal processing through T3 smoothing
⚖️ RESPONSIBLE USAGE
This indicator represents advanced mathematical research applied to market analysis. While the underlying mathematics are rigorously implemented, markets remain inherently unpredictable.
Key Principles:
- Use as part of comprehensive trading strategy
- Implement proper risk management at all times
- Backtest thoroughly before live implementation
- Understand that past performance does not guarantee future results
- Never risk more than you can afford to lose
The mathematics reveal deep market structure, but successful trading requires discipline, patience, and sound risk management beyond any indicator.
🔮 CONCLUSION
The Langlands-Operadic Möbius Vortex represents a quantum leap forward in technical analysis, bringing PhD-level pure mathematics to practical trading while maintaining visual elegance and usability.
From the harmonic analysis of the Langlands Program to the democratic composition of operadic theory, from the number-theoretic precision of the Möbius function to the revolutionary Order Flow Polarity Index, every component works in mathematical harmony to reveal the hidden order within market chaos.
This is more than an indicator - it's a mathematical lens that transforms how you see and understand market structure.
Trade with mathematical precision. Trade with the LOMV.
*"Mathematics is the language with which God has written the universe." - Galileo Galilei*
*In markets, as in nature, profound mathematical beauty underlies apparent chaos. The LOMV reveals this hidden order.*
— Dskyz, Trade with insight. Trade with anticipation.
Emperor RSI CandleDescription:
The Emperor RSI Candle is a real-time, non-lagging trading indicator that colors candles based on RSI (Relative Strength Index) levels. It offers instant visual feedback on market momentum, making it easy to identify trend strength, overbought/oversold zones, and potential reversals with precision.
Unlike traditional RSI indicators, which display RSI values in a separate panel, Emperor RSI Candle integrates RSI signals directly into the candles, providing a cleaner, more intuitive charting experience. Its multi-timeframe RSI box shows RSI values across different timeframes, offering confluence confirmation for better trade decisions.
🔥 Emperor RSI Candle is original because it includes a multi-timeframe RSI box that displays RSI values from:
1 min → Monthly timeframes simultaneously.
📊 How this is unique:
Traders can instantly compare RSI values across different timeframes.
This helps them spot confluence and divergences, which is not possible with standard RSI indicators.
The multi-timeframe confluence feature makes the indicator highly effective for both short-term and long-term traders.
🚀 What the script does:
Real-time candle coloring based on RSI levels.
Multi-timeframe RSI box for confluence insights.
Customizable RSI settings for adaptability.
How it benefits traders:
Instant visual feedback for momentum and reversals.
No lag signals for precise trading decisions.
Flexible customization for different trading styles.
Unique visual signals:
Green, red, parrot green, and blue candles → Clearly indicating bullish/bearish momentum and overbought/oversold zones.
Multi-timeframe RSI box → For cross-timeframe confluence.
⚡️ 🔥 UNIQUE FEATURES 🔥:
✅ Multi-Timeframe RSI Box:
Displays RSI values from 1 min to monthly timeframes, helping traders confirm confluence across different timeframes.
✅ Fully Customizable RSI Levels & Display:
Modify RSI thresholds, source, and appearance to fit your trading style.
✅ Dynamic Candle Borders for Weak Signals:
Green border → Weak bullishness (RSI between 50-60).
Red border → Weak bearishness (RSI between 40-50).
✅ Lag-Free, Real-Time Accuracy:
No repainting or delay—instant visual signals for accurate decisions.
✅ Scalable for Any Trading Style:
Perfect for both intraday scalping and positional trading.
📊 🔥 HOW IT WORKS 🔥:
The indicator dynamically colors candles based on RSI values, providing real-time visual signals:
🟢 Above 60 RSI → Green candle:
Indicates bullish momentum, signaling potential upward continuation.
🟩 Above 80 RSI → Parrot green candle:
Overbought zone → Possible reversal or profit booking.
🟥 Below 40 RSI → Red candle:
Signals bearish momentum, indicating potential downward continuation.
🔵 Below 20 RSI → Blue candle:
Oversold zone → Possible reversal opportunity.
🔲 Neutral candles:
50-60 RSI → Green border: Weak bullishness.
40-50 RSI → Red border: Weak bearishness.
📊 🔥 MULTI-TIMEFRAME RSI BOX 🔥:
The Emperor RSI Candle includes an RSI box displaying multi-timeframe RSI values from 1 min to monthly. This provides:
✅ Confluence confirmation:
Compare RSI across multiple timeframes to strengthen trade conviction.
✅ Spot divergences:
Identify hidden trends by comparing smaller and larger timeframes.
✅ Validate trade entries/exits:
Use higher timeframe RSI to confirm smaller timeframe signals
⚙️ 🔥 HOW TO USE IT 🔥:
To maximize the accuracy and clarity of Emperor RSI Candle, follow these steps:
🔧 STEP 1: Chart Settings Configuration
Go to Chart Settings → Symbols
Uncheck the following options:
Body
Borders
Wick
✅ This ensures that only the Emperor Candle colors are visible, making the signals clear and distinct.
🔧 STEP 2: Style Settings for Emperor Candle
After applying the Emperor RSI Candle:
Go to Settings → Style tab
Wick section:
Select Color 2 and Color 3 → Set Opacity to 100%.
Border section:
Select Color 2 and Color 3 → Set Opacity to 100%.
✅ This ensures the candles display with full visibility and accurate colors.
⚙️ 🔥 CUSTOMIZATION OPTIONS 🔥:
Emperor RSI Candle offers full flexibility to match your trading style:
✅ RSI Length:
Modify the period used for RSI calculation (default: 10).
✅ Top & Bottom Levels:
Adjust the overbought (default: 80) and oversold (default: 20) thresholds.
✅ Intermediate Levels:
Up Level: Default: 60 → Bullish RSI threshold.
Down Level: Default: 40 → Bearish RSI threshold.
Mid Level: Default: 50 → Neutral zone.
✅ RSI Source:
Select the price source for RSI calculation (Close, Open, High, Low).
✅ RSI Period:
Customize the RSI calculation period (default: 10).
✅ Font Size:
Adjust the RSI box font size for better visibility.
✅ Box Position:
Choose where to display the RSI box:
Top Left / Top Center / Top Right
Bottom Left / Bottom Center / Bottom Right
💡 🔥 HOW IT IMPROVES TRADING 🔥:
✅ Clear trend identification:
Instantly recognize bullish, bearish, or neutral conditions through candle colors.
✅ Precise entries and exits:
Spot overbought and oversold zones with visual clarity.
✅ Multi-timeframe confirmation:
Validate trades with RSI confluence across multiple timeframes.
✅ No lag, real-time accuracy:
Immediate visual signals for faster and more reliable trade decisions.
✅ Customizable settings:
Tailor the indicator to fit your trading strategy and preferences.
✅ Works for all trading styles:
Suitable for scalping, day trading, and swing trading.
🔥How Traders Can Use Emperor RSI Candle for Trading:
🟢 Green Candles (Above 60 RSI) → Bullish Momentum:
Indicates strong upward movement → Ideal for long entries.
Traders can hold until RSI approaches 80 for profit booking.
🟥 Red Candles (Below 40 RSI) → Bearish Momentum:
Signals strong downward movement → Ideal for short trades.
Traders can exit or book profits near RSI 20.
2. Spotting Overbought and Oversold Zones for Reversals:
🟩 Parrot Green Candles (Above 80 RSI) → Overbought Zone:
Indicates potential for reversals or profit booking.
Traders can tighten stop-losses or exit positions.
🔵 Blue Candles (Below 20 RSI) → Oversold Zone:
Signals a potential reversal opportunity.
Traders can look for buy signals with confluence confirmation.
3. Catching Weak Bullish and Bearish Trends with Border Colors:
🟢 Green Border (RSI 50-60) → Weak Bullishness:
Indicates mild upward momentum.
Traders can consider cautious long entries.
🔴 Red Border (RSI 40-50) → Weak Bearishness:
Indicates mild downward pressure.
Traders can consider cautious short entries.
4. Using the RSI Multi-Timeframe Box for Confluence:
✅ Displays RSI values from 1 min to monthly timeframes.
Usage:
Confluence confirmation:
Multiple timeframes showing bullish RSI → Strong uptrend → Reliable buy signals.
Multiple timeframes showing bearish RSI → Strong downtrend → Reliable sell signals.
Spotting divergences:
If lower timeframes are bullish but higher timeframes are bearish, it indicates a potential reversal.
5. Customization Tips for Different Trading Styles:
✅ For Scalping:
Use a smaller RSI period (9-10) for faster signals.
Check the multi-timeframe RSI box to confirm signals quickly.
✅ For Swing Trading:
Use the default RSI period (14-15) for more accurate signals.
Focus on higher timeframes (1 hr, 4 hr, daily) for stronger trend confirmation.
Triad Trade MatrixOverview
Triad Trade Matrix is an advanced multi-strategy indicator built using Pine Script v5. It is designed to simultaneously track and display key trading metrics for three distinct trading styles on a single chart:
Swing Trading (Swing Supreme):
This mode captures longer-term trends and is designed for trades that typically span several days. It uses customizable depth and deviation parameters to determine swing signals.
Day Trading (Day Blaze):
This mode focuses on intraday price movements. It generates signals that are intended to be executed within a single trading session. The parameters for depth and deviation are tuned to capture more frequent, shorter-term moves.
Scalping (Scalp Surge):
This mode is designed for very short-term trades where quick entries and exits are key. It uses more sensitive parameters to detect rapid price movements suitable for scalping strategies.
Each trading style is represented by its own merged table that displays real-time metrics. The tables update automatically as new trading signals are generated.
Key Features
Multi-Style Tracking:
Swing Supreme (Large): For swing trading; uses a purple theme.
Day Blaze (Medium): For day trading; uses an orange theme.
Scalp Surge (Small): For scalping; uses a green theme.
Real-Time Metrics:
Each table displays key trade metrics including:
Entry Price: The price at which the trade was entered.
Exit Price: The price at which the previous trade was exited.
Position Size: Calculated as the account size divided by the entry price.
Direction: Indicates whether the trade is “Up” (long) or “Down” (short).
Time: The time when the trade was executed (formatted to hours and minutes).
Wins/Losses: The cumulative number of winning and losing trades.
Current Price & PnL: The current price on the chart and the profit/loss computed relative to the entry price.
Duration: The number of bars that the trade has been open.
History Column: A merged summary column that shows the most recent trade’s details (entry, exit, and result).
Customizability:
Column Visibility: Users can toggle individual columns (Ticker, Timeframe, Entry, Exit, etc.) on or off according to their preference.
Appearance Settings: You can customize the table border width, frame color, header background, and text colors.
History Toggle: The merged history column can be enabled or disabled.
Chart Markers: There is an option to show or hide chart markers (labels and lines) that indicate trade entries and exits on the chart.
Trade History Management:
The indicator maintains a rolling history (up to three recent trades per trading style) and displays the latest summary in the merged table.
This history column provides a quick reference to recent performance.
How It Works
Signal Generation & Trade Metrics
Trade Entry/Exit Calculation:
For each trading style, the indicator uses built-in functions (such as ta.lowestbars and ta.highestbars) to analyze price movements. Based on a customizable "depth" and "deviation" parameter, it determines the point of entry for a trade.
Swing Supreme: Uses larger depth/deviation values to capture swing trends.
Day Blaze: Uses intermediate values for intraday moves.
Scalp Surge: Uses tighter parameters to pick up rapid price changes.
Metrics Update:
When a new trade signal is generated (i.e., when the trade entry price is updated), the indicator calculates:
The current PnL as the difference between the current price and the entry price (or vice versa, depending on the trade direction).
The duration as the number of bars since the trade was opened.
The position size using the formula: accountSize / entryPrice.
History Recording:
Each time a new trade is triggered (i.e., when the entry price is updated), a summary string is created (showing entry, exit, and win/loss status) and appended to the corresponding trade history array. The merged table then displays the latest summary from this history.
Table Display
Merged Table Structure:
Each trading style (Swing Supreme, Day Blaze, and Scalp Surge) is represented by a table that has 15 columns. The columns are:
Trade Type (e.g., Swing Supreme)
Ticker
Timeframe
Entry Price
Exit Price
Position Size
Direction
Time of Entry
Account Size
Wins
Losses
Current Price
Current PnL
Duration (in bars)
History (the latest trade summary)
User Customization:
Through the settings panel, users can choose which columns to display.
If a column is toggled off, its cells will remain blank, allowing traders to focus on the metrics that matter most to them.
Appearance & Themes:
The table headers and cell backgrounds are customizable via color inputs. The trading style names are color-coded:
Swing Supreme (Large): Uses a purple theme.
Day Blaze (Medium): Uses an orange theme.
Scalp Surge (Small): Uses a green theme.
How to Use the Indicator
Add the Indicator to Your Chart:
Once published, add "Triad Trade Matrix" to your TradingView chart.
Configure the Settings:
Adjust the Account Size to match your trading capital.
Use the Depth and Deviation inputs for each trading style to fine-tune the signal sensitivity.
Toggle the Chart Markers on if you want visual entry/exit markers on the chart.
Customize which columns are visible via the column visibility toggles.
Enable or disable the History Column to show the merged trade history in the table.
Adjust the appearance settings (colors, border width, etc.) to suit your chart background and preferences.
Interpret the Tables:
Swing Supreme:
This table shows metrics for swing trades.
Look for changes in entry price, PnL, and trade duration to monitor longer-term moves.
Day Blaze:
This table tracks day trading activity.It will update more frequently, reflecting intraday trends.
Scalp Surge:
This table is dedicated to scalping signals.Use it to see quick entry/exit data and rapid profit/loss changes.
The History column (if enabled) gives you a snapshot of the most recent trade (e.g., "E:123.45 X:124.00 Up Win").
Use allerts:
The indicator includes alert condition for new trade entries(both long and short)for each trading style.
Summary:
Triad Trade Matrix provides an robust,multi-dimensional view of your trading performance across swing trading, day trading, and scalping.
Best to be used whith my other indicators
True low high
Vma Ext_Adv_CustomTbl
This indicator is ideal for traders who wish to monitor multiple trading styles simultaneously, with a clear, technical, and real-time display of performance metrics.
Happy Trading!
PowerStrike Pro V3Purpose of the Script
"PowerStrike Pro V3" is a custom indicator designed to generate high-accuracy buy/sell signals by combining multiple technical analysis tools. This script is optimized for trend-following, scalping, and support/resistance strategies. It integrates popular indicators such as RSI, Supertrend, Bollinger Bands, and dynamic support/resistance levels to provide traders with reliable signals.
Components of the Script and How It Works
The script combines the following key components, each contributing to the total signal strength based on user-defined weights. Below is a detailed explanation of how each component works and how it contributes to the overall score:
1. RSI (Relative Strength Index)
How It Works:
RSI identifies overbought (above 70) and oversold (below 30) conditions in the market.
The script uses RSI values to measure the strength of the trend and generate buy/sell signals.
When RSI is in the oversold zone, it strengthens buy signals. When in the overbought zone, it strengthens sell signals.
Contribution to Total Score:
RSI's contribution is calculated based on its strength in the oversold or overbought zones.
The final contribution is weighted by the user-defined "RSI Weight" and added to the total score.
2. Support and Resistance Levels
How It Works:
The script dynamically calculates recent peaks (resistance) and valleys (support) using a user-defined lookback period.
These levels are plotted on the chart as dynamic support and resistance lines.
The proximity of the price to these levels strengthens the signals.
Contribution to Total Score:
If the price is near a support level, it increases the strength of buy signals.
If the price is near a resistance level, it increases the strength of sell signals.
The contribution is weighted by the "Support/Resistance Weight" and added to the total score.
3. Supertrend Indicator
How It Works:
Supertrend uses ATR (Average True Range) and a multiplier to determine the trend direction.
The script uses Supertrend's direction changes as a filter for buy/sell signals.
When Supertrend is in an uptrend, it strengthens buy signals. When in a downtrend, it strengthens sell signals.
Contribution to Total Score:
Supertrend's contribution is weighted by the "Supertrend Weight" and added to the total score.
4. Bollinger Bands
How It Works:
Bollinger Bands measure price volatility and identify potential support/resistance levels.
The script generates buy signals when the price crosses above the lower band and sell signals when it crosses below the upper band.
Contribution to Total Score:
A crossover above the lower band increases the strength of buy signals.
A crossover below the upper band increases the strength of sell signals.
The contribution is weighted by the "Bollinger Bands Weight" and added to the total score.
5. Order Book Data
How It Works:
The script analyzes bid/ask volumes from the order book to assess market depth.
High bid volume near support levels strengthens buy signals.
High ask volume near resistance levels strengthens sell signals.
Contribution to Total Score:
Order book data is weighted by the "Order Book Weight" and added to the total score.
Signal Types and Their Meaning
The script generates two types of signals:
Weak Signals:
Weak signals indicate the early stages of a trend or minor corrections.
These are represented by small green (buy) or red (sell) triangles on the chart.
Weak signals are suitable for low-risk trades or scalping strategies.
Strong Signals:
Strong signals indicate the continuation of a trend or significant reversal points.
These are represented by larger green (buy) or red (sell) arrows on the chart.
Strong signals are suitable for higher-risk, higher-reward trades.
Total Score Calculation
The script calculates the total buy and sell scores by combining the weighted contributions of all components. The formula for the total score is as follows:
Copy
Total Buy Score = (RSI Buy Strength * RSI Weight) + (Support Strength * Support/Resistance Weight) + (Supertrend Buy Strength * Supertrend Weight) + (Bollinger Buy Strength * Bollinger Weight) + (Order Book Buy Strength * Order Book Weight)
Total Sell Score = (RSI Sell Strength * RSI Weight) + (Resistance Strength * Support/Resistance Weight) + (Supertrend Sell Strength * Supertrend Weight) + (Bollinger Sell Strength * Bollinger Weight) + (Order Book Sell Strength * Order Book Weight)
The total score is then compared to user-defined thresholds to generate weak or strong signals. For example:
A total buy score above 80% generates a weak buy signal.
A total buy score above 85% generates a strong buy signal.
Recommended Strategies
Trend Following: Use strong signals to trade in the direction of the main trend.
Scalping: Use weak signals to capture short-term price movements.
Support/Resistance Trading: Use the dynamically plotted support and resistance levels to identify reversal points.
How to Use the Script
Weight Settings:
Adjust the weights for each component (RSI, Supertrend, Bollinger Bands, etc.) in the script settings to customize the signal strength calculation.
Signal Thresholds:
Set the thresholds for weak and strong signals (e.g., 80% for weak signals, 85% for strong signals).
Chart Visualization:
The script automatically plots buy/sell signals on the chart. Use these signals in conjunction with your trading strategy.
Unique Features of the Script
Dynamic Weighting: Each component's contribution to the total score can be customized using user-defined weights.
Integrated Support/Resistance: The script dynamically calculates and plots support/resistance levels, enhancing signal accuracy.
Order Book Analysis: The inclusion of order book data provides additional confirmation for signals.
Final Notes
While "PowerStrike Pro V3" combines multiple indicators to generate reliable signals, no indicator guarantees 100% accuracy. Always use proper risk management and combine this script with other analysis tools for the best results






















