本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © raptoralgo (original copyright notice retained)
// Modified integration and publication-review changes: DrFX
// Original MPL 2.0 terms must remain in force where applicable.
//@version=6
// ═══════════════════════════════════════════════════════════════════════════
// ◼️ ATROX BLACK EDITION - Quad Consensus ◼️
// Created by DrFX
// Premium Dark Theme Trading System
// ═══════════════════════════════════════════════════════════════════════════
indicator("Atrox Black Edition - Quad Consensus [DrFX]",
shorttitle="ATROX [DrFX]",
overlay=true,
max_bars_back=3000,
max_labels_count=500,
max_lines_count=500,
max_boxes_count=500,
precision=0,
explicit_plot_zorder=true)
// ═══════════════════════════════════════════════════════════════════════════
// 🖤 BLACK EDITION COLOR SCHEME
// ═══════════════════════════════════════════════════════════════════════════
// Primary Colors
var color BLACK_PRIMARY = #0a0a0f // Deep black (backgrounds)
var color BLACK_SECONDARY = #12121a // Soft black (panels)
var color BLACK_TERTIARY = #1a1a2e // Purple-tinted black
// Accent Colors
var color CYAN_GLOW = #00d4ff // Primary accent (ice blue)
var color PURPLE_ROYAL = #9d4edd // Secondary accent
var color SILVER_STEEL = color.rgb(157, 255, 0) // Text/borders
var color GOLD_ACCENT = #ffd700 // Achievement/TP3
// Signal Colors
var color NEON_GREEN = #00ff88 // Long signals / Profit
var color NEON_RED = #ff003c // Short signals / Loss
var color NEON_ORANGE = #ff6b00 // Warnings / Trailing
// System Colors
var color ATRONOX_COLOR = #00d4ff // Cyan
var color RAPTOR_COLOR = #9d4edd // Purple
var color SCALPER_COLOR = #ff6b00 // Orange
var color ELITE_COLOR = #ffd700 // Gold
// ═══════════════════════════════════════════════════════════════════════════
// ◼️ QUICK SETUP - CONFIGURATION PRESETS
// ═══════════════════════════════════════════════════════════════════════════
presetMode = input.string("Custom", "📋 Configuration Preset",
options=["Custom", "Conservative", "Balanced", "Aggressive", "Scalping", "🖤 Sniper Mode", "🖤 Stealth"],
group='◼️ QUICK SETUP',
tooltip='Conservative: High quality signals, wider stops\nBalanced: Standard settings\nAggressive: More signals, tighter stops\nScalping: Quick trades, small targets\n🖤 Sniper Mode: Highest quality only\n🖤 Stealth: Minimal signals, max precision', display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🖤 ATROX BLACK CONFIGURATION
// ═══════════════════════════════════════════════════════════════════════════
atroxEnabled = input.bool(true, title='✨ Enable ATROX Signals', group='🖤 ATROX SETTINGS', tooltip='Show consensus signals when multiple systems agree', display=display.data_window)
atroxWindow_input = input.int(15, title='📊 Consensus Window (Candles)', minval=3, maxval=15, group='🖤 ATROX SETTINGS', display=display.data_window)
atroxMinSystems_input = input.int(3, title='🎯 Minimum Systems Required', minval=2, maxval=4, group='🖤 ATROX SETTINGS', display=display.data_window)
minSignalStrength_input = input.float(60.0, "💪 Minimum Confluence Score (0-100)", minval=0, maxval=100, step=5, group='🖤 ATROX SETTINGS', display=display.data_window)
showIndividualSignals = input.bool(false, title='📌 Show Individual System Signals', group='🖤 ATROX SETTINGS', display=display.data_window)
// Apply preset overrides
int atroxWindow = presetMode == "Conservative" ? 3 : presetMode == "Balanced" ? 5 : presetMode == "Aggressive" ? 7 : presetMode == "Scalping" ? 4 : presetMode == "🖤 Sniper Mode" ? 3 : presetMode == "🖤 Stealth" ? 2 : atroxWindow_input
int atroxMinSystems = presetMode == "Conservative" ? 4 : presetMode == "Balanced" ? 3 : presetMode == "Scalping" ? 2 : presetMode == "🖤 Sniper Mode" ? 4 : presetMode == "🖤 Stealth" ? 4 : presetMode == "Custom" ? atroxMinSystems_input : 3
float minSignalStrength = presetMode == "Conservative" ? 70.0 : presetMode == "Balanced" ? 60.0 : presetMode == "Aggressive" ? 50.0 : presetMode == "Scalping" ? 55.0 : presetMode == "🖤 Sniper Mode" ? 85.0 : presetMode == "🖤 Stealth" ? 80.0 : minSignalStrength_input
// Advanced Filters
useVolatilityFilter = input.bool(true, "🌊 Volatility Filter", group='🖤 ATROX SETTINGS', inline='vol1', display=display.data_window)
minVolatility = input.float(0.8, "Min", group='🖤 ATROX SETTINGS', inline='vol1', display=display.data_window)
maxVolatility = input.float(2.5, "Max", group='🖤 ATROX SETTINGS', inline='vol1', display=display.data_window)
useSignalTimeout = input.bool(true, "⏱️ Signal Invalidation", group='🖤 ATROX SETTINGS', inline='timeout', display=display.data_window)
signalTimeout = input.int(10, "bars", minval=3, maxval=30, group='🖤 ATROX SETTINGS', inline='timeout', display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🎯 TARGET & RISK MANAGEMENT SYSTEM
// ═══════════════════════════════════════════════════════════════════════════
atroxTargetsEnabled = input.bool(true, title='🎯 Enable Target System', group='🎯 RISK MANAGEMENT', display=display.data_window)
atroxTargetATRLength = input.int(14, title='ATR Period', minval=1, group='🎯 RISK MANAGEMENT', display=display.data_window)
atroxTP1_Multiplier_input = input.float(2.5, title='🥉 Target 1 (ATR)', minval=0.5, step=0.1, group='🎯 RISK MANAGEMENT', display=display.data_window)
atroxTP2_Multiplier_input = input.float(5.0, title='🥈 Target 2 (ATR)', minval=1.0, step=0.1, group='🎯 RISK MANAGEMENT', display=display.data_window)
atroxTP3_Multiplier_input = input.float(12.0, title='🥇 Target 3 (ATR)', minval=2.0, step=0.5, group='🎯 RISK MANAGEMENT', display=display.data_window)
atroxSL_Multiplier_input = input.float(12.0, title='🛡️ Stop Loss (ATR)', minval=0.3, step=0.1, group='🎯 RISK MANAGEMENT', display=display.data_window)
float atroxTP1_Multiplier = presetMode == "Conservative" ? 2.0 : presetMode == "Balanced" ? 1.5 : presetMode == "Aggressive" ? 1.2 : presetMode == "Scalping" ? 0.8 : presetMode == "🖤 Sniper Mode" ? 2.5 : presetMode == "🖤 Stealth" ? 3.0 : atroxTP1_Multiplier_input
float atroxTP2_Multiplier = presetMode == "Conservative" ? 4.0 : presetMode == "Balanced" ? 3.0 : presetMode == "Aggressive" ? 2.5 : presetMode == "Scalping" ? 1.5 : presetMode == "🖤 Sniper Mode" ? 5.0 : presetMode == "🖤 Stealth" ? 6.0 : atroxTP2_Multiplier_input
float atroxTP3_Multiplier = presetMode == "Conservative" ? 6.0 : presetMode == "Balanced" ? 5.0 : presetMode == "Aggressive" ? 4.0 : presetMode == "Scalping" ? 2.5 : presetMode == "🖤 Sniper Mode" ? 8.0 : presetMode == "🖤 Stealth" ? 10.0 : atroxTP3_Multiplier_input
float atroxSL_Multiplier = presetMode == "Conservative" ? 1.5 : presetMode == "Balanced" ? 1.0 : presetMode == "Aggressive" ? 0.8 : presetMode == "Scalping" ? 0.5 : presetMode == "🖤 Sniper Mode" ? 1.2 : presetMode == "🖤 Stealth" ? 1.0 : atroxSL_Multiplier_input
if atroxTP1_Multiplier >= atroxTP2_Multiplier or atroxTP2_Multiplier >= atroxTP3_Multiplier
runtime.error("Target validation failed: TP1 must be < TP2 must be < TP3")
atroxSLEnabled = input.bool(true, "🛡️ Enable Stop Loss", group='🎯 RISK MANAGEMENT', display=display.data_window)
useTrailingStop = input.bool(false, "🔒 Enable Trailing Stop", group='🎯 RISK MANAGEMENT', display=display.data_window)
trailActivation = input.float(3.5, "Trail Activation (ATR)", minval=0.5, step=0.1, group='🎯 RISK MANAGEMENT', display=display.data_window)
trailDistance = input.float(3.0, "Trail Distance (ATR)", minval=0.3, step=0.1, group='🎯 RISK MANAGEMENT', display=display.data_window)
showTargetLines = input.bool(true, title='Show Target Lines', group='🎯 RISK MANAGEMENT', inline='visual1', display=display.data_window)
showTargetLabels = input.bool(true, title='Show Labels', group='🎯 RISK MANAGEMENT', inline='visual1', display=display.data_window)
extendTargetLines = input.bool(false, title='Extend Lines Right', group='🎯 RISK MANAGEMENT', display=display.data_window)
targetLineStyle = input.string('Dotted', title='Line Style', options=['Solid', 'Dashed', 'Dotted'], group='🎯 RISK MANAGEMENT', display=display.data_window)
targetLineWidth = input.int(1, title='Line Width', minval=1, maxval=4, group='🎯 RISK MANAGEMENT', display=display.data_window)
// BLACK EDITION TARGET COLORS
colorTP1 = input.color(color.new(#00d4ff, 20), title='TP1 (Cyan)', group='🎯 RISK MANAGEMENT', inline='colors1', display=display.data_window)
colorTP2 = input.color(color.new(#9d4edd, 20), title='TP2 (Purple)', group='🎯 RISK MANAGEMENT', inline='colors1', display=display.data_window)
colorTP3 = input.color(color.new(#ffd700, 20), title='TP3 (Gold)', group='🎯 RISK MANAGEMENT', inline='colors2', display=display.data_window)
colorEntry = input.color(color.new(#ffffff, 30), title='Entry', group='🎯 RISK MANAGEMENT', inline='colors2', display=display.data_window)
colorSL = input.color(color.new(#ff003c, 20), title='Stop Loss', group='🎯 RISK MANAGEMENT', inline='colors3', display=display.data_window)
colorTrail = input.color(color.new(#ff6b00, 30), title='Trail Stop', group='🎯 RISK MANAGEMENT', inline='colors3', display=display.data_window)
alertOnTP1 = input.bool(true, title='Alert TP1', group='🎯 RISK MANAGEMENT', inline='alerts1', display=display.data_window)
alertOnTP2 = input.bool(true, title='Alert TP2', group='🎯 RISK MANAGEMENT', inline='alerts1', display=display.data_window)
alertOnTP3 = input.bool(true, title='Alert TP3', group='🎯 RISK MANAGEMENT', inline='alerts2', display=display.data_window)
alertOnSL = input.bool(true, title='Alert SL', group='🎯 RISK MANAGEMENT', inline='alerts2', display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🧠 ATRONOX SETTINGS
// ═══════════════════════════════════════════════════════════════════════════
atronoxEnabled = input.bool(false, title='✅ Enable AtroNox System', group='🧠 ATRONOX ENGINE', display=display.data_window)
showAtronoxLongSignals = input.bool(true, title='Long Signals', group='🧠 ATRONOX ENGINE', inline='atronox1', display=display.data_window)
showAtronoxShortSignals = input.bool(true, title='Short Signals', group='🧠 ATRONOX ENGINE', inline='atronox1', display=display.data_window)
selectedFilterAtronox = input.string('No Filtering', title='Market Filter', options=['Filter with ATR', 'Filter with RSI', 'ATR or RSI', 'ATR and RSI', 'No Filtering', 'Entry Only in Flat Market (ATR or RSI)', 'Entry Only in Flat Market (ATR and RSI)'], group='🧠 ATRONOX ENGINE', display=display.data_window)
atronoxSensitivity = input.int(100, minval=1, title='Sensitivity', group='🧠 ATRONOX ENGINE', display=display.data_window)
atronoxOffset = input.float(1.5, step=0.01, minval=0.01, title='Offset', group='🧠 ATRONOX ENGINE', display=display.data_window)
rsiPeriodAtronox = input.int(7, title='RSI Period', group='🧠 ATRONOX ENGINE', display=display.data_window)
rsiUpperLimitAtronox = input.int(45, title='RSI Upper', group='🧠 ATRONOX ENGINE', inline='rsi1', display=display.data_window)
rsiLowerLimitAtronox = input.int(10, title='Lower', group='🧠 ATRONOX ENGINE', inline='rsi1', display=display.data_window)
atrLengthAtronox = input.int(5, minval=1, title='ATR Length', group='🧠 ATRONOX ENGINE', display=display.data_window)
atrMaTypeAtronox = input.string('EMA', options=['SMA', 'EMA'], title='ATR MA Type', group='🧠 ATRONOX ENGINE', inline='atr1', display=display.data_window)
atrMaLengthAtronox = input.int(5, minval=1, title='MA Length', group='🧠 ATRONOX ENGINE', inline='atr1', display=display.data_window)
showBandsAtronox = input.bool(false, title='Show Bollinger Bands', group='🧠 ATRONOX ENGINE', inline='visual1', display=display.data_window)
showTrendLineAtronox = input.bool(false, title='Show Trend Line', group='🧠 ATRONOX ENGINE', inline='visual1', display=display.data_window)
showZonesAtronox = input(false, title='Show Trading Zones', group='🧠 ATRONOX ENGINE', display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🦅 RAPTOR SETTINGS
// ═══════════════════════════════════════════════════════════════════════════
raptorEnabled = input.bool(true, title='✅ Enable RAPTOR System', group='🦅 RAPTOR ENGINE', display=display.data_window)
sensitivityRaptor = input.float(6.5, "SuperTrend Sensitivity", 0.5, 12, step=0.05, group='🦅 RAPTOR ENGINE', display=display.data_window)
showSMARaptor = input.bool(false, 'SMA Bands', inline='raptor1', group='🦅 RAPTOR ENGINE', display=display.data_window)
majRaptor = input.bool(false, 'TP Points', inline='raptor1', group='🦅 RAPTOR ENGINE', display=display.data_window)
showEMARaptor = input.bool(false, 'EMA Cloud', inline='raptor2', group='🦅 RAPTOR ENGINE', display=display.data_window)
enableReversalRaptor = input.bool(false, 'Reversal Signal', inline='raptor2', group='🦅 RAPTOR ENGINE', display=display.data_window)
show_haRaptor = input.bool(false, 'Trend Tracker', inline='raptor3', group='🦅 RAPTOR ENGINE', display=display.data_window)
enableSRRaptor = input.bool(false, 'S/R Levels', inline='raptor3', group='🦅 RAPTOR ENGINE', display=display.data_window)
Show_TBORaptor = input.bool(false, 'Show TBO', inline='raptor4', group='🦅 RAPTOR ENGINE', display=display.data_window)
Show_SuperIchiRaptor = input.bool(false, 'SuperIchi Cloud', inline='raptor4', group='🦅 RAPTOR ENGINE', display=display.data_window)
// BLACK EDITION SMA Colors
BLuERaptor = input.color(color.rgb(0, 212, 255, 0), 'Up Trend', group='🦅 RAPTOR - SMA Settings', inline='sma1', display=display.data_window)
GRayRaptor = input.color(color.rgb(157, 78, 221, 0), 'Down Trend', group='🦅 RAPTOR - SMA Settings', inline='sma1', display=display.data_window)
BFiLLRaptor = input.color(color.rgb(0, 212, 255, 60), 'Up Fill', group='🦅 RAPTOR - SMA Settings', inline='sma2', display=display.data_window)
GFiLLRaptor = input.color(color.rgb(157, 78, 221, 40), 'Down Fill', group='🦅 RAPTOR - SMA Settings', inline='sma2', display=display.data_window)
fastLenRaptor = input.int(34, 'Fast EMA Length', group='🦅 RAPTOR - EMA Cloud', minval=1, display=display.data_window)
slowLenRaptor = input.int(63, 'Slow EMA Length', group='🦅 RAPTOR - EMA Cloud', minval=1, display=display.data_window)
emaFastColorRaptor = input.color(#00d4ff, 'Fast EMA Color', group='🦅 RAPTOR - EMA Cloud', display=display.data_window)
emaSlowColorRaptor = input.color(#9d4edd, 'Slow EMA Color', group='🦅 RAPTOR - EMA Cloud', display=display.data_window)
custom_tboRaptor = input.bool(false, "Enable Custom Periods", group="🦅 RAPTOR - TBO Settings", display=display.data_window)
tbo_fastRaptor = input.int(20, "TBO Fast EMA", 1, group="🦅 RAPTOR - TBO Settings", display=display.data_window)
tbo_mediumRaptor = input.int(40, "TBO Medium EMA", 2, group="🦅 RAPTOR - TBO Settings", display=display.data_window)
tbo_medfastRaptor = input.int(50, "TBO Med-Fast SMA", 3, group="🦅 RAPTOR - TBO Settings", display=display.data_window)
tbo_slowRaptor = input.int(150, "TBO Slow SMA", 4, group="🦅 RAPTOR - TBO Settings", display=display.data_window)
use_rsiRaptor = input.bool(false, "Enable RSI Filter", group="🦅 RAPTOR - TBO RSI", display=display.data_window)
short_rsi_levelRaptor = input.int(70, "Short RSI Level", 1, 100, group="🦅 RAPTOR - TBO RSI", display=display.data_window)
short_comparisonRaptor = input.string("Greater Than", "Short Condition", ["Greater Than", "Less Than"], group="🦅 RAPTOR - TBO RSI", display=display.data_window)
long_rsi_levelRaptor = input.int(30, "Long RSI Level", 1, 100, group="🦅 RAPTOR - TBO RSI", display=display.data_window)
long_comparisonRaptor = input.string("Less Than", "Long Condition", ["Greater Than", "Less Than"], group="🦅 RAPTOR - TBO RSI", display=display.data_window)
rsi_periodRaptor = input.int(14, "RSI Period", 1, group="🦅 RAPTOR - TBO RSI", display=display.data_window)
reversal_sensitivityRaptor = input.int(14, title="Reversal Sensitivity", minval=1, group="🦅 RAPTOR - Reversal", display=display.data_window)
reversal_down_levelRaptor = input.int(75, 'Reversal Down Level', group='🦅 RAPTOR - Reversal', display=display.data_window)
reversal_up_levelRaptor = input.int(25, 'Reversal Up Level', group='🦅 RAPTOR - Reversal', display=display.data_window)
sr_strengthRaptor = input.int(4, "S/R Strength", 1, group="🦅 RAPTOR - S/R", display=display.data_window)
line_style_srRaptor = input.string("Solid", "Line Style", ["Solid", "Dotted", "Dashed"], group="🦅 RAPTOR - S/R", display=display.data_window)
use_zones_srRaptor = input.bool(true, "Show S/R Zones", group="🦅 RAPTOR - S/R", display=display.data_window)
macd_fastRaptor = input.int(12, "MACD Fast Length", group="🦅 RAPTOR - Candle Color", display=display.data_window)
macd_slowRaptor = input.int(26, "MACD Slow Length", group="🦅 RAPTOR - Candle Color", display=display.data_window)
macd_sourceRaptor = input.source(close, "MACD Source", group="🦅 RAPTOR - Candle Color", display=display.data_window)
macd_signalRaptor = input.int(9, "Signal Smoothing", 1, 50, group="🦅 RAPTOR - Candle Color", display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🎯 SCALPER SETTINGS
// ═══════════════════════════════════════════════════════════════════════════
scalperEnabled = input.bool(true, title='✅ Enable Scalper System', group='🎯 SCALPER ENGINE', display=display.data_window)
nbuysellScalper = input.bool(true, 'Show Signals', group='🎯 SCALPER ENGINE', display=display.data_window)
sidewaysThresholdScalper = input.int(15, 'ADX Sideways Threshold', minval=2, group='🎯 SCALPER ENGINE', display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🏆 ELITE ALGO SETTINGS
// ═══════════════════════════════════════════════════════════════════════════
eliteEnabled = input.bool(true, title='✅ Enable Elite Algo System', group='🏆 ELITE ENGINE', display=display.data_window)
rng_src = input(defval=close, title='Swing Source', group='🏆 ELITE ENGINE', display=display.data_window)
rng_per = input.int(defval=200, minval=1, title='Swing Period', group='🏆 ELITE ENGINE', display=display.data_window)
rng_qty = input.float(defval=7.5, minval=0.0000001, title='Swing Multiplier', group='🏆 ELITE ENGINE', display=display.data_window)
use_barcolor_elite = input(defval=false, title='Bar Colors On/Off', group='🏆 ELITE ENGINE', display=display.data_window)
showEliteFilter = input.bool(false, title='Show Range Filter Line', group='🏆 ELITE ENGINE', display=display.data_window)
candleColorMode = input.string('Scalper Trend', 'Candle Coloring', options=['None', 'Raptor MACD', 'Scalper Trend', 'Elite Range'], group='◼️ QUICK SETUP', display=display.data_window)
obshow = input.bool(false, "Show Order Blocks", group='🏆 ELITE - Order Blocks', display=display.data_window)
oblast = input.int(3, "Last N OBs", 0, 50, 1, group='🏆 ELITE - Order Blocks', display=display.data_window)
obupcs = input.color(color.new(#00ff88, 90), "Bullish OB", inline='ob1', group='🏆 ELITE - Order Blocks', display=display.data_window)
obdncs = input.color(color.new(#ff003c, 90), "Bearish OB", inline='ob1', group='🏆 ELITE - Order Blocks', display=display.data_window)
obshowactivity = input.bool(false, "Show Buy/Sell Activity", group='🏆 ELITE - Order Blocks', display=display.data_window)
obactup = input.color(color.new(#00ff88, 50), "Buy", inline='ob2', group='🏆 ELITE - Order Blocks', display=display.data_window)
obactdn = input.color(color.new(#ff003c, 50), "Sell", inline='ob2', group='🏆 ELITE - Order Blocks', display=display.data_window)
obmode = input.string("Length", "Construction", ["Length", "Full"], group='🏆 ELITE - Order Blocks', display=display.data_window)
len_ob = input.int(5, "Length", 1, 20, 1, group='🏆 ELITE - Order Blocks', display=display.data_window)
obmiti = input.string("Close", "Mitigation Method", ["Close", "Wick", "Avg"], group='🏆 ELITE - Order Blocks', display=display.data_window)
obtxt = input.string("Normal", "Metric Size", ["Tiny", "Small", "Normal", "Large", "Huge"], group='🏆 ELITE - Order Blocks', display=display.data_window)
showmetric_ob = input.bool(false, "Show Metrics", group='🏆 ELITE - Order Blocks', display=display.data_window)
showline_ob = input.bool(false, "Show Mid-Line", group='🏆 ELITE - Order Blocks', display=display.data_window)
overlap_ob = input.bool(true, "Hide Overlap", group='🏆 ELITE - Order Blocks', display=display.data_window)
show_current_sr = input.bool(false, title="Show Current TF S/R", group="🏆 ELITE - S/R", display=display.data_window)
swing_length_sr = input.int(10, title='Swing Length', group='🏆 ELITE - S/R', minval=1, maxval=50, display=display.data_window)
history_of_demand_to_keep = input.int(20, title='Lookback', minval=5, maxval=50, group="🏆 ELITE - S/R", display=display.data_window)
box_width_sr = input.float(10, title='S/R Range', group='🏆 ELITE - S/R', minval=1, maxval=10, step=0.5, display=display.data_window)
supply_color_sr = input.color(#ff003c8a, title='Support Zone', group='🏆 ELITE - S/R', inline='sr1', display=display.data_window)
supply_outline_color_sr = input.color(#ff003c8a, title='BoS', group='🏆 ELITE - S/R', inline='sr1', display=display.data_window)
demand_color_sr = input.color(#00d4ff8a, title='Resistance Zone', group='🏆 ELITE - S/R', inline='sr2', display=display.data_window)
demand_outline_color_sr = input.color(#00d4ff8a, title='BoR', group='🏆 ELITE - S/R', inline='sr2', display=display.data_window)
poi_label_color_sr = input.color(#c0c0c0, title='S/R Zone Label', group='🏆 ELITE - S/R', display=display.data_window)
// ═══════════════════════════════════════════════════════════════════════════
// 🛠️ HELPER FUNCTIONS
// ═══════════════════════════════════════════════════════════════════════════
getLineStyle() =>
targetLineStyle == 'Solid' ? line.style_solid : targetLineStyle == 'Dashed' ? line.style_dashed : line.style_dotted
createTargetLine(level, lineColor) =>
line.new(bar_index, level, bar_index + 1, level, xloc=xloc.bar_index, extend=extendTargetLines ? extend.right : extend.none, color=lineColor, style=getLineStyle(), width=targetLineWidth)
createTargetLabel(level, labelText, labelColor, txtColor = color.black) =>
label.new(bar_index, level, text=labelText, style=label.style_label_right, color=labelColor, textcolor=txtColor, size=size.small)
calcSignalStrength(systemCount, atrRatio, rsiValue, trendValue, tradeDir) =>
float strength = 0.0
strength += (systemCount / 4.0) * 40
strength += atrRatio > 1.2 ? 20 : atrRatio > 1.0 ? 15 : atrRatio > 0.8 ? 10 : 0
if rsiValue > 30 and rsiValue < 70
strength += 20
else if rsiValue > 20 and rsiValue < 80
strength += 10
else if rsiValue > 10 and rsiValue < 90
strength += 5
strength += trendValue == tradeDir ? 20 : 0
strength
signalInWindow(signal, window) =>
var int lastSignalBar = -999
if signal
lastSignalBar := bar_index
barsSince = bar_index - lastSignalBar
barsSince <= window and barsSince >= 0
// ═══════════════════════════════════════════════════════════════════════════
// 🧠 ATRONOX CALCULATIONS
// ═══════════════════════════════════════════════════════════════════════════
rsiValueAtronox = ta.rsi(close, rsiPeriodAtronox)
atrValueAtronox = ta.atr(atrLengthAtronox)
atrMaAtronox = atrMaTypeAtronox == 'EMA' ? ta.ema(atrValueAtronox, atrMaLengthAtronox) : ta.sma(atrValueAtronox, atrMaLengthAtronox)
bbBasisAtronox = ta.sma(close, atronoxSensitivity)
bbDevAtronox = ta.stdev(close, atronoxSensitivity) * atronoxOffset
bbUpperAtronox = bbBasisAtronox + bbDevAtronox
bbLowerAtronox = bbBasisAtronox - bbDevAtronox
midPointAtronox = (close + open) / 2
isBullishBreakoutAtronox = close > bbUpperAtronox and midPointAtronox > bbUpperAtronox
isBearishBreakoutAtronox = close < bbLowerAtronox and midPointAtronox < bbLowerAtronox
isFlatAtronox = close < bbUpperAtronox and close > bbLowerAtronox
isAtrFilteredAtronox = atrValueAtronox >= atrMaAtronox
isRsiFilteredAtronox = rsiValueAtronox > rsiUpperLimitAtronox or rsiValueAtronox < rsiLowerLimitAtronox
isAtrOrRsiAtronox = isAtrFilteredAtronox or isRsiFilteredAtronox
isAtrAndRsiAtronox = isAtrFilteredAtronox and isRsiFilteredAtronox
isFlatByAtrAtronox = atrValueAtronox <= atrMaAtronox
isFlatByRsiAtronox = rsiValueAtronox < rsiUpperLimitAtronox and rsiValueAtronox > rsiLowerLimitAtronox
isFlatAtrOrRsiAtronox = isFlatByAtrAtronox or isFlatByRsiAtronox
isFlatAtrAndRsiAtronox = isFlatByAtrAtronox and isFlatByRsiAtronox
filterConditionAtronox = selectedFilterAtronox == 'Filter with ATR' ? isAtrFilteredAtronox : selectedFilterAtronox == 'Filter with RSI' ? isRsiFilteredAtronox : selectedFilterAtronox == 'ATR or RSI' ? isAtrOrRsiAtronox : selectedFilterAtronox == 'ATR and RSI' ? isAtrAndRsiAtronox : selectedFilterAtronox == 'No Filtering' ? true : selectedFilterAtronox == 'Entry Only in Flat Market (ATR or RSI)' ? isFlatAtrOrRsiAtronox : selectedFilterAtronox == 'Entry Only in Flat Market (ATR and RSI)' ? isFlatAtrAndRsiAtronox : true
var float atronoxTrendLine = na
var int atronoxTrend = 0
var bool atronoxLongSignal = false
var bool atronoxShortSignal = false
bbSignalAtronox = close > bbUpperAtronox ? 1 : close < bbLowerAtronox ? -1 : 0
if bbSignalAtronox == 1
atronoxTrendLine := low
if na(atronoxTrendLine[1]) or atronoxTrendLine < atronoxTrendLine[1]
atronoxTrendLine := atronoxTrendLine[1]
else if bbSignalAtronox == -1
atronoxTrendLine := high
if na(atronoxTrendLine[1]) or atronoxTrendLine > atronoxTrendLine[1]
atronoxTrendLine := atronoxTrendLine[1]
else
atronoxTrendLine := nz(atronoxTrendLine[1], close)
if na(atronoxTrend[1])
atronoxTrend := 0
else if atronoxTrendLine > atronoxTrendLine[1]
atronoxTrend := 1
else if atronoxTrendLine < atronoxTrendLine[1]
atronoxTrend := -1
else
atronoxTrend := atronoxTrend[1]
atronoxLongSignal := atronoxTrend[1] == -1 and atronoxTrend == 1
atronoxShortSignal := atronoxTrend[1] == 1 and atronoxTrend == -1
longSignalAtronox = atronoxLongSignal and showAtronoxLongSignals and filterConditionAtronox and atronoxEnabled
shortSignalAtronox = atronoxShortSignal and showAtronoxShortSignals and filterConditionAtronox and atronoxEnabled
// ═══════════════════════════════════════════════════════════════════════════
// 🦅 RAPTOR CALCULATIONS
// ═══════════════════════════════════════════════════════════════════════════
calc_supertrendRaptor(_price, _factor, _period) =>
atr_value = ta.atr(_period)
upper_threshold = _price + (_factor * atr_value)
lower_threshold = _price - (_factor * atr_value)
prev_lower = nz(lower_threshold[1])
prev_upper = nz(upper_threshold[1])
lower_threshold := (lower_threshold > prev_lower) or (close[1] < prev_lower) ? lower_threshold : prev_lower
upper_threshold := (upper_threshold < prev_upper) or (close[1] > prev_upper) ? upper_threshold : prev_upper
int trend_dir = na
float final_level = na
prev_final = final_level[1]
if na(atr_value[1])
trend_dir := 1
else if prev_final == prev_upper
trend_dir := close > upper_threshold ? -1 : 1
else
trend_dir := close < lower_threshold ? 1 : -1
final_level := trend_dir == -1 ? lower_threshold : upper_threshold
[final_level, trend_dir]
ocAvgRaptor = (open + close) / 2
sma_arrayRaptor = array.new_float(16)
for i = 0 to 15
array.set(sma_arrayRaptor, i, ta.sma(close, 5 + i))
sma9Raptor = array.get(sma_arrayRaptor, 4)
[supertrendRaptor, directionRaptor] = calc_supertrendRaptor(close, sensitivityRaptor, 11)
greenRaptor = #00ff88
redRaptor = #ff003c
price_above_stRaptor = close > supertrendRaptor
price_below_stRaptor = close < supertrendRaptor
price_above_smaRaptor = close >= sma9Raptor
price_below_smaRaptor = close <= sma9Raptor
was_below_stRaptor = close[1] <= supertrendRaptor[1]
was_above_stRaptor = close[1] >= supertrendRaptor[1]
bullish_crossRaptor = price_above_stRaptor and was_below_stRaptor and price_above_smaRaptor
bearish_crossRaptor = price_below_stRaptor and was_above_stRaptor and price_below_smaRaptor
longSignalRaptor = bullish_crossRaptor and raptorEnabled
shortSignalRaptor = bearish_crossRaptor and raptorEnabled
// TBO System
fast_tbo_maRaptor = ta.ema(close, custom_tboRaptor ? tbo_fastRaptor : 20)
medium_tbo_maRaptor = ta.ema(close, custom_tboRaptor ? tbo_mediumRaptor : 40)
rsi_valueRaptor = ta.rsi(close, rsi_periodRaptor)
rsi_short_okRaptor = not use_rsiRaptor ? true : (short_comparisonRaptor == "Greater Than" ? rsi_valueRaptor > short_rsi_levelRaptor : rsi_valueRaptor < short_rsi_levelRaptor)
rsi_long_okRaptor = not use_rsiRaptor ? true : (long_comparisonRaptor == "Less Than" ? rsi_valueRaptor < long_rsi_levelRaptor : rsi_valueRaptor > long_rsi_levelRaptor)
fast_above_mediumRaptor = fast_tbo_maRaptor > medium_tbo_maRaptor
fast_below_mediumRaptor = fast_tbo_maRaptor < medium_tbo_maRaptor
was_fast_belowRaptor = fast_tbo_maRaptor[1] <= medium_tbo_maRaptor[1]
was_fast_aboveRaptor = fast_tbo_maRaptor[1] >= medium_tbo_maRaptor[1]
tbo_long_crossRaptor = fast_above_mediumRaptor and was_fast_belowRaptor
tbo_short_crossRaptor = fast_below_mediumRaptor and was_fast_aboveRaptor
tbo_long_signalRaptor = tbo_long_crossRaptor and rsi_long_okRaptor
tbo_short_signalRaptor = tbo_short_crossRaptor and rsi_short_okRaptor
greennRaptor = #00ff88
pinkRaptor = #9d4edd
// EMA Cloud
srcRaptor = close
s180Raptor = ta.sma(ta.sma(srcRaptor, 200), 100)
s200Raptor = ta.sma(ta.sma(srcRaptor, 200), 70)
m180Raptor = true
a200Raptor = true
emaFastRaptor = ta.ema(close, fastLenRaptor)
emaSlowRaptor = ta.ema(close, slowLenRaptor)
midRaptor = (emaFastRaptor + emaSlowRaptor) / 2
cloudColorRaptor = midRaptor > midRaptor[1] ? color.new(#00ff88, 80) : midRaptor < midRaptor[1] ? color.new(#ff003c, 80) : color.new(#4a4a5a, 80)
// Reversal Signals
price_gainsRaptor = math.max(ta.change(close), 0)
price_lossesRaptor = -math.min(ta.change(close), 0)
avg_gainsRaptor = ta.rma(price_gainsRaptor, reversal_sensitivityRaptor)
avg_lossesRaptor = ta.rma(price_lossesRaptor, reversal_sensitivityRaptor)
rsi_sourceRaptor = avg_lossesRaptor == 0 ? 100 : avg_gainsRaptor == 0 ? 0 : 100 - (100 / (1 + avg_gainsRaptor / avg_lossesRaptor))
was_above_obRaptor = rsi_sourceRaptor[1] >= reversal_down_levelRaptor
is_below_obRaptor = rsi_sourceRaptor < reversal_down_levelRaptor
reversal_downRaptor = was_above_obRaptor and is_below_obRaptor and enableReversalRaptor
was_below_osRaptor = rsi_sourceRaptor[1] <= reversal_up_levelRaptor
is_above_osRaptor = rsi_sourceRaptor > reversal_up_levelRaptor
reversal_upRaptor = was_below_osRaptor and is_above_osRaptor and enableReversalRaptor
// MACD Candle Colors - BLACK EDITION
[macd_lineRaptor, signal_lineRaptor, histogramRaptor] = ta.macd(macd_sourceRaptor, macd_fastRaptor, macd_slowRaptor, macd_signalRaptor)
color_green_highRaptor = #00ff88
color_green_midRaptor = #00b86b
color_red_highRaptor = #ff003c
color_red_midRaptor = #cc0030
color_neutralRaptor = #4a4a5a
var bar_colorRaptor = color_neutralRaptor
hist_positiveRaptor = histogramRaptor > 0
hist_negativeRaptor = histogramRaptor < 0
hist_increasingRaptor = histogramRaptor > histogramRaptor[1]
hist_decreasingRaptor = histogramRaptor < histogramRaptor[1]
macd_positiveRaptor = macd_lineRaptor > 0
macd_negativeRaptor = macd_lineRaptor < 0
if hist_positiveRaptor and hist_increasingRaptor and histogramRaptor[1] > 0
bar_colorRaptor := color_green_midRaptor
else if hist_negativeRaptor and hist_decreasingRaptor and histogramRaptor[1] < 0
bar_colorRaptor := color_red_midRaptor
else if hist_positiveRaptor
bar_colorRaptor := color_neutralRaptor
else if hist_negativeRaptor
bar_colorRaptor := color_neutralRaptor
if macd_positiveRaptor and hist_positiveRaptor
bar_colorRaptor := color_green_midRaptor
if hist_increasingRaptor and macd_lineRaptor[1] > 0 and histogramRaptor[1] > 0
bar_colorRaptor := color_green_midRaptor
if histogramRaptor > histogramRaptor[2] and macd_lineRaptor[2] > 0 and histogramRaptor[2] > 0
bar_colorRaptor := color_green_highRaptor
if macd_negativeRaptor and hist_negativeRaptor
bar_colorRaptor := color_red_midRaptor
if hist_decreasingRaptor and macd_lineRaptor[1] < 0 and histogramRaptor[1] < 0
bar_colorRaptor := color_red_midRaptor
if histogramRaptor < histogramRaptor[2] and macd_lineRaptor[2] < 0 and histogramRaptor[2] < 0
bar_colorRaptor := color_red_highRaptor
// ═══════════════════════════════════════════════════════════════════════════
// 🎯 SCALPER CALCULATIONS
// ═══════════════════════════════════════════════════════════════════════════
supertrend_scalper(_src, factor, atrLen) =>
atr = ta.atr(atrLen)
upperBand = _src + factor * atr
lowerBand = _src - factor * atr
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
var int direction = na
var float superTrend = na
prevSuperTrend = nz(superTrend[1])
if na(atr[1])
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
[superTrend, direction]
var float nsensitivityScalper = 1
[supertrendScalper, directionScalper] = supertrend_scalper(close, nsensitivityScalper * 7, 10)
bullScalper = ta.crossover(close, supertrendScalper)
bearScalper = ta.crossunder(close, supertrendScalper)
longSignalScalper = bullScalper and nbuysellScalper and scalperEnabled
shortSignalScalper = bearScalper and nbuysellScalper and scalperEnabled
// ADX for Scalper
adxlenScalper = 15
dilenScalper = 15
dirmov_scalper(len) =>
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : up > down and up > 0 ? up : 0
minusDM = na(down) ? na : down > up and down > 0 ? down : 0
truerange = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
[plus, minus]
adx_scalper(dilen, adxlen) =>
[plus, minus] = dirmov_scalper(dilen)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
adx
sigScalper = adx_scalper(dilenScalper, adxlenScalper)
bool isSidewaysScalper = sigScalper < sidewaysThresholdScalper
// ═══════════════════════════════════════════════════════════════════════════
// 🏆 ELITE ALGO CALCULATIONS
// ═══════════════════════════════════════════════════════════════════════════
rng_size(x, qty, n) =>
wper = n * 2 - 1
avrng = ta.ema(math.abs(x - x[1]), n)
AC = ta.ema(avrng, wper) * qty
AC
rng_filt(x, rng_, n) =>
r = rng_
var rfilt = array.new_float(2, x)
array.set(rfilt, 1, array.get(rfilt, 0))
if x - r > array.get(rfilt, 1)
array.set(rfilt, 0, x - r)
if x + r < array.get(rfilt, 1)
array.set(rfilt, 0, x + r)
rng_filt1 = array.get(rfilt, 0)
hi_band = rng_filt1 + r
lo_band = rng_filt1 - r
[hi_band, lo_band, rng_filt1]
[h_band_elite, l_band_elite, filt_elite] = rng_filt(rng_src, rng_size(rng_src, rng_qty, rng_per), rng_per)
var fdir_elite = 0.0
fdir_elite := filt_elite > filt_elite[1] ? 1 : filt_elite < filt_elite[1] ? -1 : fdir_elite
upward_elite = fdir_elite == 1
downward_elite = fdir_elite == -1
longCond_elite = rng_src > filt_elite and rng_src > rng_src[1] and upward_elite or rng_src > filt_elite and rng_src < rng_src[1] and upward_elite
shortCond_elite = rng_src < filt_elite and rng_src < rng_src[1] and downward_elite or rng_src < filt_elite and rng_src > rng_src[1] and downward_elite
CondIni_elite = 0
CondIni_elite := longCond_elite ? 1 : shortCond_elite ? -1 : CondIni_elite[1]
longCondition_elite = longCond_elite and CondIni_elite[1] == -1
shortCondition_elite = shortCond_elite and CondIni_elite[1] == 1
filt_color_elite = upward_elite ? #00ff88 : downward_elite ? #ff003c : #4a4a5a
bar_color_elite = upward_elite and rng_src > filt_elite ? #00ff88 : downward_elite and rng_src < filt_elite ? #ff003c : #00b86b
longSignalElite = longCondition_elite and eliteEnabled
shortSignalElite = shortCondition_elite and eliteEnabled
// ═══════════════════════════════════════════════════════════════════════════
// 🖤 ATROX BLACK CONSENSUS LOGIC
// ═══════════════════════════════════════════════════════════════════════════
atronoxLongInWindow = signalInWindow(longSignalAtronox, atroxWindow)
raptorLongInWindow = signalInWindow(longSignalRaptor, atroxWindow)
scalperLongInWindow = signalInWindow(longSignalScalper, atroxWindow)
eliteLongInWindow = signalInWindow(longSignalElite, atroxWindow)
atronoxShortInWindow = signalInWindow(shortSignalAtronox, atroxWindow)
raptorShortInWindow = signalInWindow(shortSignalRaptor, atroxWindow)
scalperShortInWindow = signalInWindow(shortSignalScalper, atroxWindow)
eliteShortInWindow = signalInWindow(shortSignalElite, atroxWindow)
longSystemCount = (atronoxLongInWindow ? 1 : 0) + (raptorLongInWindow ? 1 : 0) + (scalperLongInWindow ? 1 : 0) + (eliteLongInWindow ? 1 : 0)
shortSystemCount = (atronoxShortInWindow ? 1 : 0) + (raptorShortInWindow ? 1 : 0) + (scalperShortInWindow ? 1 : 0) + (eliteShortInWindow ? 1 : 0)
volatilityRatio = atrMaAtronox > 0 ? atrValueAtronox / atrMaAtronox : 1.0
volatilityOK = not useVolatilityFilter or (volatilityRatio >= minVolatility and volatilityRatio <= maxVolatility)
longSignalStrength = calcSignalStrength(longSystemCount, volatilityRatio, rsiValueAtronox, atronoxTrend, 1)
shortSignalStrength = calcSignalStrength(shortSystemCount, volatilityRatio, rsiValueAtronox, atronoxTrend, -1)
atroxLongConsensus = longSystemCount >= atroxMinSystems and longSignalStrength >= minSignalStrength and volatilityOK
atroxShortConsensus = shortSystemCount >= atroxMinSystems and shortSignalStrength >= minSignalStrength and volatilityOK
var int lastAtronLongBar = -999
var int lastAtronShortBar = -999
// Confirm only at chart-bar close. Resolve contradictory windows deterministically.
// Equal count and equal score produces no consensus signal for that candle.
longDominates = not atroxShortConsensus or longSystemCount > shortSystemCount or (longSystemCount == shortSystemCount and longSignalStrength > shortSignalStrength)
shortDominates = not atroxLongConsensus or shortSystemCount > longSystemCount or (shortSystemCount == longSystemCount and shortSignalStrength > longSignalStrength)
atroxLongSignal = barstate.isconfirmed and atroxLongConsensus and longDominates and (bar_index - lastAtronLongBar) > atroxWindow and atroxEnabled
atroxShortSignal = barstate.isconfirmed and atroxShortConsensus and shortDominates and (bar_index - lastAtronShortBar) > atroxWindow and atroxEnabled
if atroxLongSignal
lastAtronLongBar := bar_index
if atroxShortSignal
lastAtronShortBar := bar_index
// ═══════════════════════════════════════════════════════════════════════════
// 🎯 TARGET & STOP LOSS SYSTEM
// ═══════════════════════════════════════════════════════════════════════════
atroxATR = ta.atr(atroxTargetATRLength)
var float atroxEntryPrice = na
var int atroxDirection = 0
var int atroxEntryBar = na
var float atroxTP1_Level = na
var float atroxTP2_Level = na
var float atroxTP3_Level = na
var float atroxSL_Level = na
var float atroxTrailingStop = na
var bool atroxTrailActive = false
var line atroxEntryLine = na
var line atroxTP1_Line = na
var line atroxTP2_Line = na
var line atroxTP3_Line = na
var line atroxSL_Line = na
var line atroxTrail_Line = na
var label atroxEntryLabel = na
var label atroxTP1_Label = na
var label atroxTP2_Label = na
var label atroxTP3_Label = na
var label atroxSL_Label = na
var bool atroxTP1_Hit = false
var bool atroxTP2_Hit = false
var bool atroxTP3_Hit = false
var bool atroxSL_Hit = false
var int totalSignals = 0
var int winningTrades = 0
var int losingTrades = 0
bool tp1HitThisBar = false
bool tp2HitThisBar = false
bool tp3HitThisBar = false
bool slHitThisBar = false
checkSignalInvalidation() =>
if useSignalTimeout and not na(atroxEntryPrice) and bar_index > atroxEntryBar
if atroxDirection == 1 and atroxShortConsensus and (bar_index - lastAtronLongBar) < signalTimeout
label.new(bar_index, high, "⚠️ INVALIDATED", color=color.new(#ff6b00, 0), style=label.style_label_down, textcolor=color.white, size=size.small)
true
else if atroxDirection == -1 and atroxLongConsensus and (bar_index - lastAtronShortBar) < signalTimeout
label.new(bar_index, low, "⚠️ INVALIDATED", color=color.new(#ff6b00, 0), style=label.style_label_up, textcolor=color.white, size=size.small)
true
else
false
else
false
// LONG SIGNAL ENTRY
if atroxLongSignal and atroxTargetsEnabled
line.delete(atroxEntryLine)
line.delete(atroxTP1_Line)
line.delete(atroxTP2_Line)
line.delete(atroxTP3_Line)
line.delete(atroxSL_Line)
line.delete(atroxTrail_Line)
label.delete(atroxEntryLabel)
label.delete(atroxTP1_Label)
label.delete(atroxTP2_Label)
label.delete(atroxTP3_Label)
label.delete(atroxSL_Label)
atroxEntryPrice := close
atroxDirection := 1
atroxEntryBar := bar_index
atroxTP1_Level := atroxEntryPrice + (atroxATR * atroxTP1_Multiplier)
atroxTP2_Level := atroxEntryPrice + (atroxATR * atroxTP2_Multiplier)
atroxTP3_Level := atroxEntryPrice + (atroxATR * atroxTP3_Multiplier)
atroxSL_Level := atroxEntryPrice - (atroxATR * atroxSL_Multiplier)
atroxTP1_Hit := false
atroxTP2_Hit := false
atroxTP3_Hit := false
atroxSL_Hit := false
atroxTrailActive := false
atroxTrailingStop := na
totalSignals += 1
if showTargetLines
atroxEntryLine := createTargetLine(atroxEntryPrice, colorEntry)
atroxTP1_Line := createTargetLine(atroxTP1_Level, colorTP1)
atroxTP2_Line := createTargetLine(atroxTP2_Level, colorTP2)
atroxTP3_Line := createTargetLine(atroxTP3_Level, colorTP3)
if atroxSLEnabled
atroxSL_Line := createTargetLine(atroxSL_Level, colorSL)
if showTargetLabels
atroxEntryLabel := createTargetLabel(atroxEntryPrice, '◼️ ENTRY: ' + str.tostring(atroxEntryPrice, format.mintick), colorEntry, color.black)
atroxTP1_Label := createTargetLabel(atroxTP1_Level, '◼️ TP1: ' + str.tostring(atroxTP1_Level, format.mintick), colorTP1, color.black)
atroxTP2_Label := createTargetLabel(atroxTP2_Level, '◼️ TP2: ' + str.tostring(atroxTP2_Level, format.mintick), colorTP2, color.white)
atroxTP3_Label := createTargetLabel(atroxTP3_Level, '🏆 TP3: ' + str.tostring(atroxTP3_Level, format.mintick), colorTP3, color.black)
if atroxSLEnabled
atroxSL_Label := createTargetLabel(atroxSL_Level, '◼️ STOP: ' + str.tostring(atroxSL_Level, format.mintick), colorSL, color.white)
// SHORT SIGNAL ENTRY
if atroxShortSignal and atroxTargetsEnabled
line.delete(atroxEntryLine)
line.delete(atroxTP1_Line)
line.delete(atroxTP2_Line)
line.delete(atroxTP3_Line)
line.delete(atroxSL_Line)
line.delete(atroxTrail_Line)
label.delete(atroxEntryLabel)
label.delete(atroxTP1_Label)
label.delete(atroxTP2_Label)
label.delete(atroxTP3_Label)
label.delete(atroxSL_Label)
atroxEntryPrice := close
atroxDirection := -1
atroxEntryBar := bar_index
atroxTP1_Level := atroxEntryPrice - (atroxATR * atroxTP1_Multiplier)
atroxTP2_Level := atroxEntryPrice - (atroxATR * atroxTP2_Multiplier)
atroxTP3_Level := atroxEntryPrice - (atroxATR * atroxTP3_Multiplier)
atroxSL_Level := atroxEntryPrice + (atroxATR * atroxSL_Multiplier)
atroxTP1_Hit := false
atroxTP2_Hit := false
atroxTP3_Hit := false
atroxSL_Hit := false
atroxTrailActive := false
atroxTrailingStop := na
totalSignals += 1
if showTargetLines
atroxEntryLine := createTargetLine(atroxEntryPrice, colorEntry)
atroxTP1_Line := createTargetLine(atroxTP1_Level, colorTP1)
atroxTP2_Line := createTargetLine(atroxTP2_Level, colorTP2)
atroxTP3_Line := createTargetLine(atroxTP3_Level, colorTP3)
if atroxSLEnabled
atroxSL_Line := createTargetLine(atroxSL_Level, colorSL)
if showTargetLabels
atroxEntryLabel := createTargetLabel(atroxEntryPrice, '◼️ ENTRY: ' + str.tostring(atroxEntryPrice, format.mintick), colorEntry, color.black)
atroxTP1_Label := createTargetLabel(atroxTP1_Level, '◼️ TP1: ' + str.tostring(atroxTP1_Level, format.mintick), colorTP1, color.black)
atroxTP2_Label := createTargetLabel(atroxTP2_Level, '◼️ TP2: ' + str.tostring(atroxTP2_Level, format.mintick), colorTP2, color.white)
atroxTP3_Label := createTargetLabel(atroxTP3_Level, '🏆 TP3: ' + str.tostring(atroxTP3_Level, format.mintick), colorTP3, color.black)
if atroxSLEnabled
atroxSL_Label := createTargetLabel(atroxSL_Level, '◼️ STOP: ' + str.tostring(atroxSL_Level, format.mintick), colorSL, color.white)
if barstate.isconfirmed and checkSignalInvalidation()
if atroxTP1_Hit
winningTrades += 1
else
losingTrades += 1
atroxEntryPrice := na
atroxDirection := 0
atroxEntryBar := na
atroxTrailActive := false
// TARGET HIT CHECKING
if barstate.isconfirmed and not na(atroxEntryPrice) and atroxTargetsEnabled and not atroxSL_Hit and bar_index > atroxEntryBar
if atroxDirection == 1
if atroxSLEnabled and low <= atroxSL_Level
atroxSL_Hit := true
slHitThisBar := true
losingTrades += 1
if showTargetLabels
label.new(bar_index, atroxSL_Level, text='◼️ STOPPED', style=label.style_label_up, color=color.new(colorSL, 0), textcolor=color.white, size=size.normal)
atroxEntryPrice := na
atroxDirection := 0
atroxTrailActive := false
else if atroxSLEnabled and useTrailingStop
// Test only the previously committed trail: intrabar high/low order is unknown.
if atroxTrailActive and low <= atroxTrailingStop
if atroxTP1_Hit
winningTrades += 1
else
losingTrades += 1
if showTargetLabels
label.new(bar_index, atroxTrailingStop, text='🔒 TRAILED', style=label.style_label_up, color=color.new(colorTrail, 0), textcolor=color.white, size=size.small)
atroxEntryPrice := na
atroxDirection := 0
atroxTrailActive := false
else
if not atroxTrailActive and high >= atroxEntryPrice + (atroxATR * trailActivation)
atroxTrailActive := true
atroxTrailingStop := high - (atroxATR * trailDistance)
else if atroxTrailActive
atroxTrailingStop := math.max(atroxTrailingStop, high - (atroxATR * trailDistance))
if not na(atroxEntryPrice) and not atroxTP1_Hit and high >= atroxTP1_Level and not atroxSL_Hit
atroxTP1_Hit := true
tp1HitThisBar := true
if showTargetLabels
label.new(bar_index, atroxTP1_Level, text='◼️ TP1 ✓', style=label.style_label_down, color=color.new(colorTP1, 0), textcolor=color.black, size=size.small)
if not na(atroxEntryPrice) and not atroxTP2_Hit and high >= atroxTP2_Level and not atroxSL_Hit
atroxTP2_Hit := true
tp2HitThisBar := true
if showTargetLabels
label.new(bar_index, atroxTP2_Level, text='◼️ TP2 ✓', style=label.style_label_down, color=color.new(colorTP2, 0), textcolor=color.white, size=size.small)
if not na(atroxEntryPrice) and not atroxTP3_Hit and high >= atroxTP3_Level and not atroxSL_Hit
atroxTP3_Hit := true
tp3HitThisBar := true
winningTrades += 1
if showTargetLabels
label.new(bar_index, atroxTP3_Level, text='🏆 TP3!', style=label.style_label_down, color=color.new(colorTP3, 0), textcolor=color.black, size=size.normal)
atroxEntryPrice := na
atroxDirection := 0
atroxTrailActive := false
else if atroxDirection == -1
if atroxSLEnabled and high >= atroxSL_Level
atroxSL_Hit := true
slHitThisBar := true
losingTrades += 1
if showTargetLabels
label.new(bar_index, atroxSL_Level, text='◼️ STOPPED', style=label.style_label_down, color=color.new(colorSL, 0), textcolor=color.white, size=size.normal)
atroxEntryPrice := na
atroxDirection := 0
atroxTrailActive := false
else if atroxSLEnabled and useTrailingStop
// Test only the previously committed trail: intrabar high/low order is unknown.
if atroxTrailActive and high >= atroxTrailingStop
if atroxTP1_Hit
winningTrades += 1
else
losingTrades += 1
if showTargetLabels
label.new(bar_index, atroxTrailingStop, text='🔒 TRAILED', style=label.style_label_down, color=color.new(colorTrail, 0), textcolor=color.white, size=size.small)
atroxEntryPrice := na
atroxDirection := 0
atroxTrailActive := false
else
if not atroxTrailActive and low <= atroxEntryPrice - (atroxATR * trailActivation)
atroxTrailActive := true
atroxTrailingStop := low + (atroxATR * trailDistance)
else if atroxTrailActive
atroxTrailingStop := math.min(atroxTrailingStop, low + (atroxATR * trailDistance))
if not na(atroxEntryPrice) and not atroxTP1_Hit and low <= atroxTP1_Level and not atroxSL_Hit
atroxTP1_Hit := true
tp1HitThisBar := true
if showTargetLabels
label.new(bar_index, atroxTP1_Level, text='◼️ TP1 ✓', style=label.style_label_up, color=color.new(colorTP1, 0), textcolor=color.black, size=size.small)
if not na(atroxEntryPrice) and not atroxTP2_Hit and low <= atroxTP2_Level and not atroxSL_Hit
atroxTP2_Hit := true
tp2HitThisBar := true
if showTargetLabels
label.new(bar_index, atroxTP2_Level, text='◼️ TP2 ✓', style=label.style_label_up, color=color.new(colorTP2, 0), textcolor=color.white, size=size.small)
if not na(atroxEntryPrice) and not atroxTP3_Hit and low <= atroxTP3_Level and not atroxSL_Hit
atroxTP3_Hit := true
tp3HitThisBar := true
winningTrades += 1
if showTargetLabels
label.new(bar_index, atroxTP3_Level, text='🏆 TP3!', style=label.style_label_up, color=color.new(colorTP3, 0), textcolor=color.black, size=size.normal)
atroxEntryPrice := na
atroxDirection := 0
atroxTrailActive := false
// Extend target lines
if not na(atroxEntryPrice) and showTargetLines
line.set_x2(atroxEntryLine, bar_index + 1)
if not atroxTP1_Hit
line.set_x2(atroxTP1_Line, bar_index + 1)
if not atroxTP2_Hit
line.set_x2(atroxTP2_Line, bar_index + 1)
if not atroxTP3_Hit
line.set_x2(atroxTP3_Line, bar_index + 1)
if atroxSLEnabled and not atroxSL_Hit
line.set_x2(atroxSL_Line, bar_index + 1)
if atroxSLEnabled and atroxTrailActive and not na(atroxTrailingStop)
line.delete(atroxTrail_Line)
atroxTrail_Line := line.new(bar_index - 1, atroxTrailingStop, bar_index + 1, atroxTrailingStop, xloc=xloc.bar_index, extend=extendTargetLines ? extend.right : extend.none, color=colorTrail, style=line.style_solid, width=targetLineWidth + 1)
// ═══════════════════════════════════════════════════════════════════════════
// 🎨 VISUALIZATIONS - BLACK EDITION
// ═══════════════════════════════════════════════════════════════════════════
// AtroNox Bollinger Bands
bandTransparencyAtronox = showBandsAtronox ? 70 : 100
upperBandAtronox = plot(bbUpperAtronox, "BB Upper", color=color.new(CYAN_GLOW, bandTransparencyAtronox))
basisLineAtronox = plot(bbBasisAtronox, "BB Basis", color=color.new(SILVER_STEEL, bandTransparencyAtronox))
lowerBandAtronox = plot(bbLowerAtronox, "BB Lower", color=color.new(NEON_RED, bandTransparencyAtronox))
fill(upperBandAtronox, lowerBandAtronox, color=color.new(isBullishBreakoutAtronox ? NEON_GREEN : isBearishBreakoutAtronox ? NEON_RED : SILVER_STEEL, bandTransparencyAtronox + 10))
trendLineColorAtronox = atronoxTrend == 1 ? color.new(NEON_GREEN, 0) : color.new(NEON_RED, 0)
plot(showTrendLineAtronox ? atronoxTrendLine : na, "AtroNox Trend", color=trendLineColorAtronox, linewidth=3)
// Individual System Signals - BLACK EDITION
plotshape(showIndividualSignals and longSignalAtronox, style=shape.triangleup, location=location.belowbar, color=ATRONOX_COLOR, size=size.tiny, text='🧠', textcolor=color.white, title='AtroNox Long')
plotshape(showIndividualSignals and shortSignalAtronox, style=shape.triangledown, location=location.abovebar, color=ATRONOX_COLOR, size=size.tiny, text='🧠', textcolor=color.white, title='AtroNox Short')
var int zoneStateAtronox = 0
zoneStateAtronox := longSignalAtronox ? 1 : shortSignalAtronox ? -1 : nz(zoneStateAtronox[1])
bgcolor(showZonesAtronox ? zoneStateAtronox == 1 ? color.new(NEON_GREEN, 95) : zoneStateAtronox == -1 ? color.new(NEON_RED, 95) : na : na)
// RAPTOR Signals
atr_multiplierRaptor = ta.atr(30) * 2
label_low_posRaptor = low - atr_multiplierRaptor
label_high_posRaptor = high + atr_multiplierRaptor
if showIndividualSignals and longSignalRaptor
label.new(bar_index, label_low_posRaptor, "🦅", xloc.bar_index, yloc.price, color.new(RAPTOR_COLOR, 0), label.style_label_up, color.white, size.small)
if showIndividualSignals and shortSignalRaptor
label.new(bar_index, label_high_posRaptor, "🦅", xloc.bar_index, yloc.price, color.new(RAPTOR_COLOR, 0), label.style_label_down, color.white, size.small)
plotshape(Show_TBORaptor and tbo_long_signalRaptor, "TBO Long", shape.triangleup, location.belowbar, greennRaptor, size=size.tiny)
plotshape(Show_TBORaptor and tbo_short_signalRaptor, "TBO Short", shape.triangledown, location.abovebar, pinkRaptor, size=size.tiny)
// EMA Cloud
pFastRaptor = plot(showEMARaptor ? emaFastRaptor : na, title="Fast EMA", color=emaFastColorRaptor)
pSlowRaptor = plot(showEMARaptor ? emaSlowRaptor : na, title="Slow EMA", color=emaSlowColorRaptor)
fill(pFastRaptor, pSlowRaptor, color=showEMARaptor ? cloudColorRaptor : na, title="EMA Cloud")
plotshape(reversal_upRaptor, 'Reversal Up', shape.labelup, location.belowbar, color.new(CYAN_GLOW, 65), text='⬆️', size=size.small, textcolor=color.white)
plotshape(reversal_downRaptor, 'Reversal Down', shape.labeldown, location.abovebar, color.new(NEON_RED, 65), text='⬇️', size=size.small, textcolor=color.white)
// Candle color is rendered once in the unified coloring selector below.
// Scalper Signals
y1Scalper = low - (ta.atr(30) * 2)
y2Scalper = high + (ta.atr(30) * 2)
if showIndividualSignals and longSignalScalper
label.new(bar_index, y1Scalper, "🎯", xloc.bar_index, yloc.price, color.new(SCALPER_COLOR, 0), label.style_label_up, color.white, size.small)
if showIndividualSignals and shortSignalScalper
label.new(bar_index, y2Scalper, "🎯", xloc.bar_index, yloc.price, color.new(SCALPER_COLOR, 0), label.style_label_down, color.white, size.small)
bColorScalper = isSidewaysScalper ? #9d4edd : na
// Scalper candle colors are rendered in the unified coloring selector below.
// Elite Filter
filt_plot_elite = plot(showEliteFilter ? filt_elite : na, color=color.new(filt_color_elite, 67), linewidth=3, title='Elite Filter')
h_band_plot_elite = plot(showEliteFilter ? h_band_elite : na, color=color.new(NEON_GREEN, 100), title='Elite High Band')
l_band_plot_elite = plot(showEliteFilter ? l_band_elite : na, color=color.new(NEON_RED, 100), title='Elite Low Band')
fill(h_band_plot_elite, filt_plot_elite, showEliteFilter ? color.new(NEON_GREEN, 90) : na, title='Elite High Fill')
fill(l_band_plot_elite, filt_plot_elite, showEliteFilter ? color.new(NEON_RED, 90) : na, title='Elite Low Fill')
barcolor(candleColorMode == 'Raptor MACD' ? bar_colorRaptor : candleColorMode == 'Scalper Trend' ? (isSidewaysScalper ? PURPLE_ROYAL : close > supertrendScalper ? NEON_GREEN : NEON_RED) : candleColorMode == 'Elite Range' ? bar_color_elite : na, title='ATROX Candle Color')
if showIndividualSignals and longSignalElite
label.new(bar_index, low - (ta.atr(30) * 2.5), "🏆", xloc.bar_index, yloc.price, color.new(ELITE_COLOR, 0), label.style_label_up, color.black, size.small)
if showIndividualSignals and shortSignalElite
label.new(bar_index, high + (ta.atr(30) * 2.5), "🏆", xloc.bar_index, yloc.price, color.new(ELITE_COLOR, 0), label.style_label_down, color.black, size.small)
// ═══════════════════════════════════════════════════════════════════════════
// 🖤 ATROX BLACK SIGNAL LABELS
// ═══════════════════════════════════════════════════════════════════════════
if atroxLongSignal
label.new(bar_index, low - (ta.atr(30) * 3),
text="◼️━━━━━━━━━━━◼️\n🖤 ATROX BLACK 🖤\n⚡ LONG ⚡\n━━━━━━━━━━━━\n" + str.tostring(longSystemCount) + "/4 Systems\n" + str.tostring(longSignalStrength, '#') + "/100 Score\n◼️━━━━━━━━━━━◼️",
xloc=xloc.bar_index, yloc=yloc.price, color=color.new(NEON_GREEN, 0), style=label.style_label_up, textcolor=color.black, size=size.tiny,
tooltip="ATROX BLACK EDITION - Long Signal\nSystems: " + str.tostring(longSystemCount) + "/4\nStrength: " + str.tostring(longSignalStrength, '#.#') + "/100")
if atroxShortSignal
label.new(bar_index, high + (ta.atr(30) * 3),
text="◼️━━━━━━━━━━━◼️\n🖤 ATROX BLACK 🖤\n🔻 SHORT 🔻\n━━━━━━━━━━━━\n" + str.tostring(shortSystemCount) + "/4 Systems\n" + str.tostring(shortSignalStrength, '#') + "/100 Score\n◼️━━━━━━━━━━━◼️",
xloc=xloc.bar_index, yloc=yloc.price, color=color.new(NEON_RED, 0), style=label.style_label_down, textcolor=color.white, size=size.tiny,
tooltip="ATROX BLACK EDITION - Short Signal\nSystems: " + str.tostring(shortSystemCount) + "/4\nStrength: " + str.tostring(shortSignalStrength, '#.#') + "/100")
// ═══════════════════════════════════════════════════════════════════════════
// 📲 BLACK EDITION DASHBOARD
// ═══════════════════════════════════════════════════════════════════════════
dashboardEnabled = input(true, '📲 Show Dashboard', group='📲 DASHBOARD', display=display.data_window)
dashboardLocation = input.string("Top Right", "Position", options=["Top Right", "Top Left", "Bottom Right", "Bottom Left"], group='📲 DASHBOARD', display=display.data_window)
dashboardMode = input.string("Normal", "Display Mode", options=["Compact", "Normal"], group='📲 DASHBOARD', display=display.data_window)
dashboardSize = input.string("Small", "Dashboard Size", options=["Small", "Normal", "Large"], group='📲 DASHBOARD', display=display.data_window)
dashboardTransparency = input.int(5, "Background Opacity", minval=0, maxval=100, group='📲 DASHBOARD', display=display.data_window)
// Dashboard Colors
var color DASH_BG = color.new(#0a0a0f, 5)
var color DASH_BORDER = color.new(#00d4ff, 40)
var color DASH_HEADER_BG = color.new(#12121a, 0)
var color DASH_TEXT = color.new(#c0c0c0, 0)
var color DASH_PROFIT = color.new(#00ff88, 0)
var color DASH_LOSS = color.new(#ff003c, 0)
var color DASH_NEUTRAL = color.new(#4a4a5a, 0)
var color DASH_DIVIDER = color.new(#00d4ff, 70)
bool isCompact = dashboardMode == "Compact"
string txtSizeHeader = dashboardSize == "Small" ? size.normal : dashboardSize == "Normal" ? size.large : size.huge
string txtSizeNormal = dashboardSize == "Small" ? size.small : dashboardSize == "Normal" ? size.normal : size.large
string txtSizeLabel = dashboardSize == "Small" ? size.small : dashboardSize == "Normal" ? size.normal : size.large
string atroxStatusDisplay = atroxLongConsensus ? (isCompact ? "🟢 LONG" : "🟢 LONG READY") : atroxShortConsensus ? (isCompact ? "🔴 SHORT" : "🔴 SHORT READY") : (isCompact ? "⚫ WAIT" : "⚫ NO CONSENSUS")
color atroxStatusCol = atroxLongConsensus ? DASH_PROFIT : atroxShortConsensus ? DASH_LOSS : DASH_NEUTRAL
float strengthValue = atroxLongConsensus ? longSignalStrength : atroxShortConsensus ? shortSignalStrength : 0
color strengthCol = strengthValue >= 80 ? DASH_PROFIT : strengthValue >= 60 ? NEON_ORANGE : DASH_LOSS
string strengthDisplay = str.tostring(strengthValue, "#") + "/100"
string longSystemsDisplay = str.tostring(longSystemCount) + "/4"
string shortSystemsDisplay = str.tostring(shortSystemCount) + "/4"
color longSystemsCol = longSystemCount >= atroxMinSystems ? DASH_PROFIT : DASH_NEUTRAL
color shortSystemsCol = shortSystemCount >= atroxMinSystems ? DASH_LOSS : DASH_NEUTRAL
string atronoxStatusDisplay = atronoxLongInWindow ? "🟢" : atronoxShortInWindow ? "🔴" : "⚫"
color atronoxStatusCol = atronoxLongInWindow ? DASH_PROFIT : atronoxShortInWindow ? DASH_LOSS : DASH_NEUTRAL
string raptorStatusDisplay = raptorLongInWindow ? "🟢" : raptorShortInWindow ? "🔴" : "⚫"
color raptorStatusCol = raptorLongInWindow ? DASH_PROFIT : raptorShortInWindow ? DASH_LOSS : DASH_NEUTRAL
string scalperStatusDisplay = scalperLongInWindow ? "🟢" : scalperShortInWindow ? "🔴" : "⚫"
color scalperStatusCol = scalperLongInWindow ? DASH_PROFIT : scalperShortInWindow ? DASH_LOSS : DASH_NEUTRAL
string eliteStatusDisplay = eliteLongInWindow ? "🟢" : eliteShortInWindow ? "🔴" : "⚫"
color eliteStatusCol = eliteLongInWindow ? DASH_PROFIT : eliteShortInWindow ? DASH_LOSS : DASH_NEUTRAL
string positionDisplay = atroxDirection == 1 ? "🟢 LONG" : "🔴 SHORT"
color positionCol = atroxDirection == 1 ? DASH_PROFIT : DASH_LOSS
string tp1Display = atroxTP1_Hit ? "✅" : str.tostring(atroxTP1_Level, "#.####")
color tp1Col = atroxTP1_Hit ? DASH_PROFIT : DASH_TEXT
string tp2Display = atroxTP2_Hit ? "✅" : str.tostring(atroxTP2_Level, "#.####")
color tp2Col = atroxTP2_Hit ? DASH_PROFIT : DASH_TEXT
string tp3Display = atroxTP3_Hit ? "🏆" : str.tostring(atroxTP3_Level, "#.####")
color tp3Col = atroxTP3_Hit ? GOLD_ACCENT : DASH_TEXT
string marketStateDisplay = isBullishBreakoutAtronox ? "📈 BULL" : isBearishBreakoutAtronox ? "📉 BEAR" : "📊 RANGE"
color marketStateCol = isBullishBreakoutAtronox ? DASH_PROFIT : isBearishBreakoutAtronox ? DASH_LOSS : NEON_ORANGE
string volStatusDisplay = volatilityOK ? "✅ OK" : "⚠️"
color volStatusCol = volatilityOK ? DASH_PROFIT : NEON_ORANGE
if dashboardEnabled and barstate.islast
var tblPos = dashboardLocation == "Top Right" ? position.top_right : dashboardLocation == "Top Left" ? position.top_left : dashboardLocation == "Bottom Right" ? position.bottom_right : position.bottom_left
var table dash = table.new(tblPos, 2, 24, bgcolor=color.new(#0a0a0f, dashboardTransparency), border_width=1, border_color=DASH_BORDER)
// Header
table.cell(dash, 0, 0, "◼️ ATROX", bgcolor=DASH_HEADER_BG, text_color=CYAN_GLOW, text_size=txtSizeHeader)
table.cell(dash, 1, 0, "BLACK EDITION", bgcolor=DASH_HEADER_BG, text_color=PURPLE_ROYAL, text_size=txtSizeHeader)
var int r = 1
r := 1
table.cell(dash, 0, r, "💎 STATUS", text_color=DASH_TEXT, text_size=txtSizeNormal, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, atroxStatusDisplay, text_color=atroxStatusCol, text_size=txtSizeNormal, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "⚡ Score", text_color=DASH_TEXT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, strengthDisplay, text_color=strengthCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🔗 Long", text_color=DASH_TEXT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, longSystemsDisplay, text_color=longSystemsCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🔗 Short", text_color=DASH_TEXT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, shortSystemsDisplay, text_color=shortSystemsCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
if not isCompact
table.cell(dash, 0, r, "─────────", text_color=DASH_DIVIDER, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, "─────────", text_color=DASH_DIVIDER, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🧠 AtroNox", text_color=ATRONOX_COLOR, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, atronoxStatusDisplay, text_color=atronoxStatusCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🦅 RAPTOR", text_color=RAPTOR_COLOR, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, raptorStatusDisplay, text_color=raptorStatusCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🎯 Scalper", text_color=SCALPER_COLOR, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, scalperStatusDisplay, text_color=scalperStatusCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🏆 Elite", text_color=ELITE_COLOR, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, eliteStatusDisplay, text_color=eliteStatusCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
if atroxTargetsEnabled and not na(atroxEntryPrice)
if not isCompact
table.cell(dash, 0, r, "─────────", text_color=DASH_DIVIDER, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, "─────────", text_color=DASH_DIVIDER, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "📍 Position", text_color=DASH_TEXT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, positionDisplay, text_color=positionCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "◼️ TP1", text_color=CYAN_GLOW, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, tp1Display, text_color=tp1Col, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "◼️ TP2", text_color=PURPLE_ROYAL, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, tp2Display, text_color=tp2Col, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🏆 TP3", text_color=GOLD_ACCENT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, tp3Display, text_color=tp3Col, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
if not isCompact
table.cell(dash, 0, r, "─────────", text_color=DASH_DIVIDER, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, "─────────", text_color=DASH_DIVIDER, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "📈 Market", text_color=DASH_TEXT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, marketStateDisplay, text_color=marketStateCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
table.cell(dash, 0, r, "🌊 Vol", text_color=DASH_TEXT, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
table.cell(dash, 1, r, volStatusDisplay, text_color=volStatusCol, text_size=txtSizeLabel, bgcolor=color.new(#0a0a0f, dashboardTransparency))
r += 1
// ═══════════════════════════════════════════════════════════════════════════
// 🔔 BLACK EDITION ALERTS
// ═══════════════════════════════════════════════════════════════════════════
alertEnabled = input.bool(true, title='🔔 Enable Alerts', group='🔔 ALERTS', display=display.data_window)
alertIndividualSystems = input.bool(false, title='Alert Individual Systems', group='🔔 ALERTS', display=display.data_window)
makeAtroxAlert(bool isLong) =>
string direction = isLong ? "LONG" : "SHORT"
int consensusCount = isLong ? longSystemCount : shortSystemCount
float score = isLong ? longSignalStrength : shortSignalStrength
string msg = "ATROX BLACK EDITION | " + direction + "\nSymbol: " + syminfo.ticker + " | TF: " + timeframe.period + "\nSignal close: " + str.tostring(close, format.mintick)
msg += "\nConsensus: " + str.tostring(consensusCount) + "/4\nTechnical score: " + str.tostring(score, '#') + "/100"
if atroxTargetsEnabled and not na(atroxEntryPrice)
msg += "\nReference entry: " + str.tostring(atroxEntryPrice, format.mintick)
msg += "\nTP1: " + str.tostring(atroxTP1_Level, format.mintick) + " | TP2: " + str.tostring(atroxTP2_Level, format.mintick) + " | TP3: " + str.tostring(atroxTP3_Level, format.mintick)
if atroxSLEnabled
float risk = math.abs(atroxEntryPrice - atroxSL_Level)
float reward = math.abs(atroxTP3_Level - atroxEntryPrice)
msg += "\nStop: " + str.tostring(atroxSL_Level, format.mintick)
msg += risk > 0 ? " | TP3 R:R 1:" + str.tostring(reward / risk, '#.##') : " | R:R unavailable"
else
msg += "\nStop: disabled | R:R unavailable"
else
msg += "\nTarget reference levels: disabled"
msg += "\nIndicator signal only. No order has been executed."
msg
if atroxLongSignal and alertEnabled
alert(makeAtroxAlert(true), alert.freq_once_per_bar_close)
if atroxShortSignal and alertEnabled
alert(makeAtroxAlert(false), alert.freq_once_per_bar_close)
if barstate.isconfirmed and tp1HitThisBar and alertOnTP1 and alertEnabled
alert("◼️ TP1 HIT! [ATROX BLACK]\nSymbol: " + syminfo.ticker + "\nPrice: " + str.tostring(close, format.mintick) + "\nReference target touched (not a broker fill).", alert.freq_all)
if barstate.isconfirmed and tp2HitThisBar and alertOnTP2 and alertEnabled
alert("◼️ TP2 HIT! [ATROX BLACK]\nSymbol: " + syminfo.ticker + "\nPrice: " + str.tostring(close, format.mintick) + "\nReference target touched (not a broker fill).", alert.freq_all)
if barstate.isconfirmed and tp3HitThisBar and alertOnTP3 and alertEnabled
alert("🏆 TP3 ACHIEVED! [ATROX BLACK]\nSymbol: " + syminfo.ticker + "\nPrice: " + str.tostring(close, format.mintick) + "\nReference target touched (not a broker fill).", alert.freq_all)
if barstate.isconfirmed and slHitThisBar and alertOnSL and alertEnabled and atroxSLEnabled
alert("◼️ STOP LOSS [ATROX BLACK]\nSymbol: " + syminfo.ticker + "\nPrice: " + str.tostring(close, format.mintick) + "\nReference stop touched (not a broker fill).", alert.freq_all)
if longSignalAtronox and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🧠 ATRONOX LONG [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if shortSignalAtronox and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🧠 ATRONOX SHORT [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if longSignalRaptor and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🦅 RAPTOR LONG [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if shortSignalRaptor and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🦅 RAPTOR SHORT [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if longSignalScalper and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🎯 SCALPER LONG [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if shortSignalScalper and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🎯 SCALPER SHORT [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if longSignalElite and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🏆 ELITE LONG [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
if shortSignalElite and alertIndividualSystems and alertEnabled and barstate.isconfirmed
alert("🏆 ELITE SHORT [BLACK]\n" + syminfo.ticker + " @ " + str.tostring(close, format.mintick), alert.freq_all)
// ═══════════════════════════════════════════════════════════════════════════
// 📝 END OF ATROX BLACK EDITION [DrFX]
// ═══════════════════════════════════════════════════════════════════════════