JMR vwap inside barThis indicator will add vwap and according to your chart time frame and also will mark inside bar candles.
Candlestick analysis
Breakout Detector (5-min)//@version=5
indicator("Breakout Detector (5-min)", overlay=true)
// Define breakout range
length = input.int(20, minval=1, title="Lookback Period")
bullColor = color.green
bearColor = color.red
// Calculate highest high and lowest low of lookback period
highestHigh = ta.highest(high, length)
lowestLow = ta.lowest(low, length)
// Detect breakout
bullBreakout = close > highestHigh
bearBreakout = close < lowestLow
// Plot breakout signals
plotshape(bullBreakout, title="Bullish Breakout", location=location.abovebar, color=bullColor, style=shape.triangleup, size=size.small)
plotshape(bearBreakout, title="Bearish Breakout", location=location.belowbar, color=bearColor, style=shape.triangledown, size=size.small)
// Optional: Background color for breakout bars
bgcolor(bullBreakout ? color.new(bullColor, 85) : na)
bgcolor(bearBreakout ? color.new(bearColor, 85) : na)
Live Candle ±10 Points (Last 2 Bars Only)Autocalculates 10 points plus or minus on the previous 2 candles. Simple for quick reference on break even points or TP/SL areas if you're working on a fixed point strategy.
Descending Candle Strategy//@version=5
indicator("Descending Candle Strategy", overlay=true)
// الشموع المرجعية
candle_A_close = close
candle_A_open = open
candle_B_close = close
candle_B_open = open
// الشروط المفترضة من الملف:
descending_condition = candle_A_close < candle_A_open and candle_A_close < candle_B_close
// فتح صفقة بيع إذا تحقق الشرط
enterShort = descending_condition
// مستوى وقف الخسارة - مثلاً أعلى شمعة B
stopLoss = high
// رسم إشارات البيع
plotshape(enterShort, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")
// رسم وقف الخسارة على الشارت
plot(enterShort ? stopLoss : na, title="Stop Loss", style=plot.style_line, color=color.orange)
Marwatian TraderHello! I’m Muhammad Nauman Khan, the developer behind this binary‑trading indicator. Below is a detailed description of its purpose, underlying methodology and key features:
1. Overview
This indicator is designed specifically for Fixed‑Time Binary Trading. By analyzing incoming price data in real time, it generates a prediction—“Up” or “Down”—for the very next candle. You can apply it to any timeframe (from 1 min to 30 min), or focus on whichever timeframe yields the highest accuracy for your strategy.
2. Core Prediction Engine
To forecast the next candle’s direction, we combine multiple analytical “tools” into a unified confidence model.
3. Risk Warning
No indicator can guarantee 100 % accuracy. Always combine signals with sound money‑management rules—risk only a small percentage of your capital per trade, and never trade more than you can afford to lose.
Smart Lines//@version=6
indicator('Smart Lines', overlay = true)
// Variables to track line objects and colors
var line verticalLine = na
var line horizontalLineLow = na
var line horizontalLineHigh = na
var color lineColor = na
// Determine line color based on price change
if close > close
lineColor := color.green
lineColor
else if close < close
lineColor := color.red
lineColor
else
lineColor := color.gray
lineColor
// Draw vertical line at current bar's open
if bar_index != bar_index
line.delete(verticalLine)
verticalLine := line.new(bar_index, low, bar_index, high, color = lineColor, width = 2)
// Draw horizontal line at previous bar's low
if bar_index != bar_index
line.delete(horizontalLineLow)
horizontalLineLow := line.new(bar_index , low , bar_index, low , color = lineColor, width = 2, extend = extend.right)
// Draw horizontal line at previous bar's high
if bar_index != bar_index
line.delete(horizontalLineHigh)
horizontalLineHigh := line.new(bar_index , high , bar_index, high , color = lineColor, width = 2, extend = extend.right)
TrendShield Pro | DinkanWorldTrendShield Pro is a powerful price action tool that combines momentum-based trend detection with an ATR-powered trailing stop system. Built using EMA and ATR logic, this indicator helps traders identify real trends, manage dynamic stop-loss levels, and react faster to momentum shifts — all with visual clarity.
🔍 Key Features:
✅ Momentum + Price Action Based Trend Detection
✅ Dynamic ATR Trailing Stop Line
✅ Real-Time Reversal Arrows and Diamond Alerts
✅ Optimized CandleTrack color theme (Green = Demand, Red = Supply)
✅ Fully customizable inputs
🧠 Why Use It?
Capture trends early with momentum-driven logic
Use trailing stops for exit strategy or re-entry zones
Stay on the right side of the market with visual confirmation
⚙️ Inputs:
EMA Period (for directional bias)
ATR Period (for volatility-based trailing stops)
Factor (stop distance control)
⚠️ Disclaimer:
This indicator is for educational and informational purposes only and should not be considered financial advice. Trading involves risk, and past performance does not guarantee future results. Always do your own research and consult with a licensed financial advisor before making any trading decisions. The creator of this script is not responsible for any financial losses incurred through the use of this tool.
CandleTrack Pro | Pure Price Action Trend Detection CandleTrack Pro | Pure Price Action Trend Detection with Smart Candle Coloring
📝 Description:
CandleTrack Pro is a clean, lightweight trend-detection tool that uses only candle structure and ATR-based logic to determine market direction — no indicators, no overlays, just pure price action.
🔍 Features:
✅ Smart Candle-Based Trend Detection
Uses dynamic ATR thresholds to identify trend shifts with precision.
✅ Doji Protection Logic
Automatically filters indecision candles to avoid whipsaws and false signals.
✅ Dynamic Bull/Bear Color Coding
Bullish candles are colored green, bearish candles are colored red — see the trend instantly.
✅ No Noise, No Lag
No moving averages, no smoothing — just real-time decision-making power based on price itself.
📈 Ideal For:
Price action purists
Scalpers and intraday traders
Swing traders looking for clear visual bias
─────────────────────────────────────────────────────────────
Disclaimer:
This indicator is provided for educational and informational purposes only and should not be considered as financial or investment advice. The tool is designed to assist with technical analysis, but it does not guarantee any specific results or outcomes. All trading and investment decisions are made at your own risk. Past performance is not indicative of future results. Always do your own research and consult with a qualified financial advisor before making any trading decisions. The author accepts no liability for any losses or damages resulting from the use of this script. By using this indicator, you acknowledge and accept these terms.
───────────────────────────────────────────────────
BskLAB - Price Target 🧠 BskLAB – Price Target™ | Structure-Based Fibonacci Extension Mapping Tool
BskLAB – Price Target™ is a structural analysis tool designed to automate the plotting of Fibonacci extension zones based on real-time shifts in market structure. Using a custom midpoint-based projection method, this indicator helps traders visualize potential target zones without relying on manual drawing or subjective analysis.
It is built to work seamlessly with the BskLAB suite of tools, acting as the zone-defining layer within a broader confluence-based trading workflow.
🔍 Concept & Logic Overview
Unlike traditional Fibonacci tools that require manual high-low selection, this indicator uses an automated projection system tied directly to price structure shifts, such as Break of Structure (BoS) and Change of Character (CHoCH).
Core Workflow:
1.Structure Detection
Automatically identifies BoS and CHoCH patterns based on recent price action, marking significant directional shifts.
2.Swing Point Identification
Once a shift is detected, the indicator finds the nearest swing high and swing low surrounding the event.
3.Midpoint Calculation (Custom Logic)
Instead of projecting from full range, the system calculates a 50% midpoint between swing points. This serves as an anchor for cleaner, more balanced projections.
4.Extension Projection
From the midpoint, the script draws Fibonacci extensions (e.g., 1.2, 1.7, 2.8, 3.5) in the direction of the structure break.
5.Zone Mapping
These levels are displayed as shaded zones — which can serve as areas of interest for potential reactions, target regions, or contextual zones for further analysis.
6.Chart Customization Options
Users can toggle price labels, show/hide BoS or CHoCH selectively, and adjust display settings to maintain chart clarity.
⚠ Fibonacci levels are used here as visual structure-based zones, not fixed price targets or predictive tools. They are intended to support discretionary decision-making.
🧠 Integration in a Structured Workflow
While Price Target™ defines key areas, it is not designed to provide trade signals on its own. For optimal use, it works best when paired with confirmation tools from the BskLAB ecosystem.
Suggested Workflow Example:
Step 1: Observe when price reaches or enters a target extension zone
Step 2: Check for confirmation via momentum or structure (e.g., with Signal Assistant™)
Step 3: Validate volume behavior (e.g., with Money Flow X™)
Step 4: If confluence is present, define entry, stop-loss (outside the zone), and TP (based on structure or zone progression)
This multi-layered approach supports higher-quality discretionary analysis without relying solely on any one signal.
⚙️ Core Features Summary
• ✅ Automated BoS and CHoCH detection
• ✅ Custom midpoint-based Fibonacci projection logic
• ✅ Adjustable zone visibility and label toggles
• ✅ Clean layout designed for integration with other BskLAB tools
• ✅ Extension levels that scale with market structure and volatility
🔗 Intended Use Cases
Price Target™ is best used as a zone definition tool — helping traders highlight areas where price may react based on structural shifts. When combined with:
Signal Assistant™ for structure- and trend-based entry logic
Money Flow X™ for volume and momentum confirmation
…the tools together form a three-step confirmation system:
Zone ➜ Signal ➜ Volume
This layered system supports cleaner entries and greater contextual confidence for discretionary traders.
📍 RISK DISCLAIMER
Trading involves significant risk and is not suitable for everyone. All tools, scripts, and educational materials provided by BSKLab are for informational and educational purposes only. We do not offer financial advice.
Past performance does not guarantee future results. Always trade responsibly.
📍 CONCLUSION
At BSKLab, we believe consistent trading success doesn’t come from indicators alone — it comes from the trader’s ability to apply tools with context, discipline, and awareness. Indicators are only as powerful as the hands that use them.
The BSKLab Signal System isn’t designed to provide “magic signals,” but to empower traders with an adaptive, structured, and intelligent approach to identifying real opportunities while filtering out the noise.
Whether you’re a beginner or an experienced trader, our tools are designed to support real-world decisions — not just theory.
➡️ Request access below to join the BSKLab system and unlock the full suite of smart trading tools.
Highlight Candles Between Times (with Timezone Offset)Indicator to highlight specific candles in order to clearly show ORB breakout candles etc
NY Liquidity Reversal - Debug Mode70 percent 1 rate strategy, no red folder news, trades from only 730 to noon, 20 EMA plus voluntarily breakout, 1 and one entry per direction per session per asset
FOMC Strategy XAU/USD (by Mestre dos Traders)🔰 XAUUSD - Advanced Strategy Indicator (by Mestre dos Traders 2025)
This exclusive indicator was designed for strategic trading on gold (XAU/USD), especially during high-impact economic events (like FOMC) and key support/resistance zones. It combines two powerful tools in a single script, offering traders a complete, visual, analytical, and actionable interface for precise decision-making.
🧠 Combined Functionalities:
📌 1. Smart Support and Resistance Breakout Strategy
Visual marking of manual support and resistance zones, with customizable extension.
Breakout signals (buy/sell) triggered by realistic technical criteria (e.g., 50% candle body crossing).
Smart cooldown system to avoid repeated signals in short sequences.
Highlighting of fake breakouts using background colours on the chart.
Dashboard displaying trend direction, success rate, and loss risk.
🎯 2. Strategic Trade Planning for Economic Events (e.g. FOMC)
Manual input for the date and time of economic events (e.g., FOMC, NFP, CPI).
Configurable Pre-News (entry), TP1, TP2, and SL zones for both buy and sell setups.
Fully customizable line extensions (candles before/after the event).
Automatic labels and lines appear only at the event candle, maintaining clarity.
Informative table showing the line extension settings for each zone.
⚙️ Additional Options & Controls
Option to use either manual entry, TP, SL or values based on trend direction.
Alerts for buy/sell entries and when price touches key zones.
Optional display of entry, TP, and SL labels directly on the chart.
High flexibility to suit various strategies and trader profiles.
🟡 Compatible Instrument:
✔️ XAU/USD (Gold) – especially effective on short- and medium-term charts.
🧭 Purpose of the Indicator:
To help traders position themselves with clarity, anticipation, and confidence during major economic releases and around critical technical zones. Perfect for both technical breakouts and scheduled news trading.
📣 Credits:
Developed by Mestre dos Traders – 2025
💬 Feedback, suggestions, and improvements are welcome!
Contacts:
TG.: @mestredostradersoficial
TG Support: @suportedomestretraders
Tiktok Channel: @Mestredostraders
Whatsapp Sales: +55 61 991371216
Dynamic SL/TP Helper (Symbol-Aware)This script will draw lines above and below the current candle that are equal in range (or a multiple of) the previous candle's range. You can set multiple take profits.
It will also automatically calculate the number of contracts for a predefined risk amount. This allows you to automatically see how many contracts you should buy/sell.
F2F Trading indicatorF2F trading indicator.
It helps to monitor:
PDH / PDL
PWH / PWL
Market sessions (Asia, Frankfurt, London, NY)
Sessions liquidity sweeps / confirms
iFVG
Using it and managing alerts on any event you like you can significantly improve your tading strategy.
Nifty 50 Gainers Losers Table
How it Works
1. Dropdown List Selection
allows for dynamic interaction, making it flexible and user-friendly.
Scripts added to list as per Their Weightage Allocated in Nifty_50 Index.
Switch Lists Option: to Check Complete List of 50 ( List is Splitted Because of Restriction to use of 40)
Use the dropdown to switch between "Main 40" and "Remaining 10" lists dynamically.
2. Interpret Values
User Setting to Show Hide Column : Unchanged
Gainers (Green): Number of stocks that closed higher than the previous day.
Losers (Red): Number of stocks that closed lower.
Unchanged (Gray): No change in close from the previous day.
3. Compact Table Display :
User Setting to show Hide Table & Table Position As per Need (TOP,Bottom,Middle Etc)
is smartly placed and keeps the layout clean and readable.
4. User Input to Set Text Size. you can change Text Size as per Need.
✅ How to Use This Indicator Effectively
🔹 Step-by-Step User Flow:
Add to Chart
Apply this indicator to any chart—ideally NIFTY or NIFTY FUTURES (to keep contextually relevant).
Use in Decision Making
Use this internally as a market breadth tool.
If Gainers >> Losers, the market is strong/bullish.
If Losers >> Gainers, the market is weak/bearish.
If balanced, market is range-bound or sector-specific moves dominate.
Ai Golden Support and Resistance 🔰 Ai Golden Support & Resistance — by GoldenCryptoSignals
This advanced tool automatically identifies high-probability support and resistance zones using adaptive smart analysis driven by price action behavior and dynamic market conditions. It provides AI-enhanced detection of potential reversal areas, offering traders precise levels to watch for possible entries, exits, or stop placements.
🧠 Key Features:
AI-style Adaptive Zones: Dynamically generated support and resistance levels based on changing volatility and price behavior.
Breakout & Retest Visualization: Highlights critical price levels and potential reaction zones when the market breaks key levels.
Explosive Move Detection: Alerts traders to areas where the price previously made strong directional moves, indicating possible institutional footprints.
Flexible Risk Profiles: Choose between High, Medium, or Low Risk zone sensitivity — adapt the algorithm to your trading style.
Smart Zone Persistence: Zones remain visible until invalidated, helping traders visually track active supply and demand levels.
Auto Labeling and Color Coding: Easy-to-understand visuals showing market structure, zone type, and breakout signals.
Optimized for Clarity: Minimal chart clutter with elegant layout, auto-zoning boxes, and breakout signals that assist decision-making.
🔎 Use Cases:
Spot institutional levels where price is likely to react.
Use zones for confluence with other strategies or indicators.
Anticipate potential breakout or fakeout areas.
Track active vs inactive zones dynamically.
⚠️ Disclaimer:
This script is designed to assist in analysis and does not provide financial advice. Always manage your own risk and test any tool before using it in live trading. This is a closed-source indicator developed by GoldenCryptoSignals.
Dynamic SL/TP Helper (Multi TP)This script will draw lines above and below the current candle that are equal in range (or a multiple of) the previous candle's range.
Smart Range Zones [Waqas Pro Edition - Straight Lines]🔰 Smart Range Zone – Waqas Pro Edition 🔰
By: Waqas Crypto Hunter
This premium indicator is designed for professional traders who rely on daily high–low range dynamics to identify key price zones for scalping, intraday, and breakout strategies.
📌 Features:
✅ Auto-Updated Daily Range
Automatically draws the High, Low, and Midrange lines from your selected higher timeframe (default: Daily).
✅ Straight Line Zones (Non-Repainting)
Clear and clean horizontal lines that stay fixed throughout the day — perfect for zone-based decision-making.
✅ Color-Coded Levels
🔴 High: Resistance zone
🟠 Midrange: Equilibrium level
🟢 Low: Support zone
✅ Multi-Timeframe Input
You can choose your preferred timeframe to draw Smart Zones (e.g. D, 4H, 1H).
✅ Minimalist and Clean Layout
Optimized for neat charting — no background colors, no clutter — just pure professional zone mapping.
🎯 How to Use:
Range Breakout Strategy:
Price breaking above the High = potential Long breakout.
Price breaking below the Low = potential Short breakout.
Range Reversal Strategy:
Price rejecting the High or Low with confirmation = reversal entry opportunity.
Scalping Midrange:
Midrange acts as a magnet and support/resistance flip zone.
📊 Ideal For:
Crypto Scalping
Forex Intraday
Futures Breakout Trading
Smart Money Concept (SMC) Zone Mapping
📢 Note: This is part of the Waqas Pro Indicator Series — built with precision, no repaint, and ready for serious traders.
FSTO + MACD Combined OscillatorFSTO + MACD Combined Oscillator with Advanced Alerts
Introduction
The FSTO + MACD Combined Oscillator is a powerful technical analysis tool that synergizes two proven momentum indicators to deliver high-confidence trading signals. By combining the Moving Average Convergence Divergence (MACD) with the Fast Slow Trend Oscillator (FSTO), this indicator provides unique insights into market momentum, trend direction, and potential reversal points.
Key Features
1. Dual Indicator Integration
MACD Component:
Fast EMA (user-configurable period)
Slow EMA (user-configurable period)
Signal line with customizable smoothing
Histogram showing momentum strength
FSTO Component:
Short-term EMA (price-based)
Long-term EMA (price-based)
Signal line with adjustable period
Zero-line crossover detection
2. Advanced Alert System
Four specialized alert conditions that trigger only when both indicators confirm momentum shifts:
Bullish Reversal Alert
FSTO crosses above zero + MACD transitions from falling to rising
Strong trend reversal signal
Bullish Momentum Alert
FSTO crosses above signal line + MACD transitions from falling to rising
Confirmation of bullish momentum
Bearish Reversal Alert
FSTO crosses below zero + MACD transitions from rising to falling
Strong trend reversal signal
Bearish Momentum Alert
FSTO crosses below signal line + MACD transitions from rising to falling
Confirmation of bearish momentum
3. Visual Indicators
Color-coded plots:
MACD line (blue)
MACD signal line (orange)
FSTO line (purple)
FSTO signal line (amber)
Histogram:
Green: Strengthening bullish momentum
Light green: Weakening bullish momentum
Red: Strengthening bearish momentum
Light red: Weakening bearish momentum
Alert markers:
Numbered labels (1-4) at chart extremes
Color-coded for quick identification
4. Information Panel
Real-time display of:
Current MACD and FSTO values
Trend direction (bullish/bearish)
Momentum status (rising/falling)
Active alerts with color coding
How It Works
The indicator calculates two parallel momentum measurements:
MACD = EMA(close, fast_length) - EMA(close, slow_length)
FSTO = EMA(close, short_period) - EMA(close, long_period)
The true power emerges when these indicators confirm each other's signals:
MACD detects momentum shifts in price derivatives
FSTO identifies trend changes in price itself
Combined signals filter out false positives
Trading Applications
1. Trend Identification
Bullish Trend: FSTO > 0 and MACD > signal line
Bearish Trend: FSTO < 0 and MACD < signal line
2. High-Probability Entries
Long Entry: Alert 1 or 2 triggers
Short Entry: Alert 3 or 4 triggers
3. Exit Signals
MACD histogram color change (green to light green)
FSTO crossing signal line against trend direction
4. Risk Management
Stop placement below recent swing low (bullish)
Stop placement above recent swing high (bearish)
Position sizing based on histogram strength
Recommended Settings
Market MACD Fast MACD Slow FSTO Short FSTO Long
Stocks 12 26 12 26
Cryptocurrency 10 20 10 20
Forex 8 17 8 17
Commodities 14 28 14 28
Benefits
Synergistic Signals: Combines price-based and derivative-based momentum
Reduced False Signals: Requires confirmation from both indicators
Customizable Alerts: Enable/disable specific alert types
Visual Clarity: Color-coded elements for quick interpretation
Multi-Timeframe: Works on all timeframes from 1-minute to monthly
How to Use
Add indicator to TradingView chart
Configure periods based on market and timeframe
Enable desired alerts in settings
Set up notifications through TradingView alert system
Combine with price action analysis for best results
The MACD + FSTO Combined Oscillator provides professional traders with a sophisticated yet intuitive tool for identifying high-probability trade setups across all financial markets. Its unique alert system ensures you never miss critical momentum shifts confirmed by dual-indicator analysis.
FSTO - Fast Slow Trend OscillatorFSTO Indicator: Fast Slow Trend Oscillator
Introduction
The FSTO (Fast Slow Trend Oscillator) is a powerful momentum indicator designed to identify trend direction, strength, and potential reversal points in financial markets. Based on the relationship between short-term and long-term exponential moving averages (EMAs), FSTO provides clear visual signals and actionable alerts to help traders make informed decisions.
Key Features
1. Dual-Line Visualization
FSTO Line: The difference between short-term and long-term EMAs
Signal Line: Smoothed version of the FSTO line for confirmation
2. Comprehensive Trend Analysis
Zero Line: Clearly marks the boundary between bullish and bearish territory
Color Zones:
Green area: Positive momentum (bullish)
Red area: Negative momentum (bearish)
3. Intelligent Alert System
Zero Line Cross Alerts: Signals when trend direction changes
Signal Line Cross Alerts: Identifies entry and exit points
Visual Markers: Triangle indicators highlight important cross events
4. Information Panel
Real-time display of:
Current FSTO value
Trend direction (Bullish/Bearish)
Momentum strength (Strengthening/Weakening)
How It Works
FSTO calculates the difference between two EMAs:
复制
FSTO Line = EMA(close, shortPeriod) - EMA(close, longPeriod)
Signal Line = EMA(FSTO, signalPeriod)
The indicator then:
Identifies when FSTO crosses above/below zero (trend change)
Detects when FSTO crosses above/below its signal line (entry/exit signals)
Visualizes momentum strength through color zones
Provides real-time alerts for key events
Recommended Settings
Market Short EMA Long EMA Signal Line
Stocks 12 26 9
Cryptocurrency 8 21 5
Forex 10 30 7
Commodities 14 28 8
Trading Signals
Bullish Trend: FSTO > 0
Bearish Trend: FSTO < 0
Buy Signal: FSTO crosses above signal line
Sell Signal: FSTO crosses below signal line
Strong Buy: Bullish cross below zero line
Strong Sell: Bearish cross above zero line
How to Use
Add the indicator to your TradingView chart
Configure EMA periods based on your trading style
Set up alerts for key events:
Zero line crosses (trend changes)
Signal line crosses (entry/exit points)
Combine with other indicators for confirmation
Use information panel for quick market assessment
Benefits
Clear visualization of trend direction
Early detection of momentum shifts
Customizable parameters for different markets
Actionable alerts for timely trading decisions
Comprehensive information panel for quick analysis
The FSTO indicator is an essential tool for traders seeking to identify trend direction, momentum strength, and potential reversal points across all timeframes and market conditions.
Matt Klemczak 15 M breakout v6.1Matt Klemczak breakout strategy. This is a strategy with high profit potential and significant result fluctuations, requiring patience and mental resilience. It relies on rare but substantial wins that offset long series of losing trades. It works best when applied consistently and with strict risk management. The key to success is perseverance through difficult periods and the ability to “wait for” the moments when the market is favorable.
DXTRADE//@version=5
indicator(title="DXTRADE", shorttitle="", overlay=true)
// التأكد من أن السوق هو XAUUSD فقط
isGold = syminfo.ticker == "XAUUSD"
// حساب شموع الهايكن آشي
haClose = (open + high + low + close) / 4
var float haOpen = na
haOpen := na(haOpen ) ? open : (haOpen + haClose ) / 2
haHigh = math.max(high, math.max(haOpen, haClose))
haLow = math.min(low, math.min(haOpen, haClose))
// إعداد المعلمات
atr_len = input.int(3, "ATR Length", group="SuperTrend Settings")
fact = input.float(4, "SuperTrend Factor", group="SuperTrend Settings")
adxPeriod = input(2, title="ADX Filter Period", group="Filtering Settings")
adxThreshold = input(2, title="ADX Minimum Strength", group="Filtering Settings")
// حساب ATR
volatility = ta.atr(atr_len)
// حساب ADX يدويًا
upMove = high - high
downMove = low - low
plusDM = upMove > downMove and upMove > 0 ? upMove : 0
minusDM = downMove > upMove and downMove > 0 ? downMove : 0
smoothedPlusDM = ta.rma(plusDM, adxPeriod)
smoothedMinusDM = ta.rma(minusDM, adxPeriod)
smoothedATR = ta.rma(volatility, adxPeriod)
plusDI = (smoothedPlusDM / smoothedATR) * 100
minusDI = (smoothedMinusDM / smoothedATR) * 100
dx = math.abs(plusDI - minusDI) / (plusDI + minusDI) * 100
adx = ta.rma(dx, adxPeriod)
// حساب SuperTrend
pine_supertrend(factor, atr) =>
src = hl2
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 na(atr )
_direction := 1
else if prevSuperTrend == prevUpperBand
_direction := close > upperBand ? -1 : 1
else
_direction := close < lowerBand ? 1 : -1
superTrend := _direction == -1 ? lowerBand : upperBand
= pine_supertrend(fact, volatility)
// فلتر التوقيت (من 8 صباحاً إلى 8 مساءً بتوقيت العراق UTC+3)
withinSession = time >= timestamp("Asia/Baghdad", year, month, dayofmonth, 8, 0) and time <= timestamp("Asia/Baghdad", year, month, dayofmonth, 20, 0)
// إشارات الدخول مع فلتر ADX والتوقيت
validTrend = adx > adxThreshold
longEntry = ta.crossunder(dir, 0) and isGold and validTrend and withinSession
shortEntry = ta.crossover(dir, 0) and isGold and validTrend and withinSession
// وقف الخسارة والهدف
pipSize = syminfo.mintick * 10
takeProfit = 150 * pipSize
stopLoss = 150 * pipSize
// حساب الأهداف والستوب بناءً على شمعة الدخول (haClose للشمعة الحالية)
longTP = haClose + takeProfit
longSL = haClose - stopLoss
shortTP = haClose - takeProfit
shortSL = haClose + stopLoss
// إشارات الدخول
plotshape(series=longEntry, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(series=shortEntry, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")
// رسم خطوط الأهداف ووقف الخسارة عند بداية الشمعة التالية للإشارة
if longEntry
line.new(bar_index, haClose + takeProfit, bar_index + 10, haClose + takeProfit, color=color.green, width=2, style=line.style_dashed)
line.new(bar_index, haClose - stopLoss, bar_index + 10, haClose - stopLoss, color=color.red, width=2, style=line.style_dashed)
if shortEntry
line.new(bar_index, haClose - takeProfit, bar_index + 10, haClose - takeProfit, color=color.green, width=2, style=line.style_dashed)
line.new(bar_index, haClose + stopLoss, bar_index + 10, haClose + stopLoss, color=color.red, width=2, style=line.style_dashed)
// إضافة تنبيهات
alertcondition(longEntry, title="Buy Alert", message="Gold Scalping - Buy Signal!")
alertcondition(shortEntry, title="Sell Alert", message="Gold Scalping - Sell Signal!")