RSI + VWAP Strategy by vipindaskr🔍 This script combines RSI and VWAP for intraday trend-based entries.
✅ *Buy Signal:*
- Price above VWAP
- RSI > 60
- Green background + up triangle shown
❌ *Sell Signal:*
- Price below VWAP
- RSI < 40
- Red background + down triangle shown
📈 Ideal for Nifty 50 intraday traders using 5-minute chart.
Developed by vipindaskr 💻
Indicatori di Bill Williams
Improved Weinstein Stage AnalysisThe code provides an actionable, disciplined, and visually informative implementation of the “Stage Analysis” approach pioneered by Stan Weinstein, with enhancements to modernize, automate, and clarify the methodology for today’s traders using TradingView. It faithfully follows the workflow recommended: identify long-term cycles, confirm with volume and relative strength, and only engage aggressively with the market during the advancing (bullish) stage with all “clues” aligned.
William's Awesome Oscillator (AO) - Log-scaledA 5-34-5 MACD plotted as a histogram, aka William's Awesome Oscillator, scaled to log price
William's Accelerator Oscillator (AC) - Log-ScaledA 5-34-5 MACD Histogram, aka William's Accelerator Oscillator, scaled to log price
Triumm algo v2 with Signal Qualitythis indicator very usefull for trding
it give signal entry sl tp buy selll
A buy/sell indicator is a tool used in technical analysis to help traders identify optimal entry (buy) and exit (sell) points in the market. These indicators analyze price movements, volume, and momentum to generate signals that suggest potential trading opportunities.
LinkedIn
+1
Angel One
+1
Key Buy/Sell Indicators
Relative Strength Index (RSI)
The RSI measures the speed and change of price movements on a scale from 0 to 100. Traditionally, an RSI above 70 indicates that an asset may be overbought (a potential sell signal), while an RSI below 30 suggests it may be oversold (a potential buy signal).
Moving Average Convergence Divergence (MACD)
The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of an asset's price. A bullish signal occurs when the MACD line crosses above the signal line, while a bearish signal occurs when it crosses below.
Moving Average Crossovers
This method involves plotting two moving averages of different lengths on a chart. A common strategy is the "Golden Cross," where a short-term moving average crosses above a long-term moving average, indicating a potential uptrend. Conversely, a "Death Cross" occurs when a short-term moving average crosses below a long-term moving average, suggesting a potential downtrend.
Bollinger Bands
Bollinger Bands consist of a moving average and two standard deviation lines plotted above and below it. When the price touches the upper band, the asset may be overbought; when it touches the lower band, it may be oversold.
Stochastic Oscillator
This momentum indicator compares a particular closing price of an asset to a range of its prices over a certain period. Values above 80 are considered overbought, and values below 20 are considered oversold.
Practical Considerations
Lagging Nature: Most indicators are based on historical data and may lag behind current market conditions. Therefore, they should be used in conjunction with other forms of analysis.
False Signals: No indicator is foolproof. It's essential to confirm signals with additional analysis or indicators to reduce the likelihood of acting on false signals.
Reddit
Market Conditions: The effectiveness of indicators can vary depending on market conditions. For instance, some indicators perform better in trending markets, while others are more suited for ranging markets.
Gator Trader FX ScannerThe Gator Trader FX Scanner is designed to identify high-probability reversals by combining the Relative Strength Index (RSI) with Bill Williams Divergent Candles.
How It Works:
The scanner continuously scans multiple assets and timeframes for overbought and oversold RSI conditions. It then filters for divergent candles that signal potential shifts in momentum.
Color-Coded Signals:
Dark Green: RSI > 70 (Overbought) — potential for a pullback.
Dark Red: RSI < 30 (Oversold) — watch for possible bounce.
Bright Green: RSI > 70 plus a bearish divergent bar — strong reversal alert to the downside.
Bright Red: RSI < 30 plus a bullish divergent bar — strong reversal alert to the upside.
SMC BOS Strategy for XAUUSDThis is a custom-built TradingView strategy that uses Smart Money Concept (SMC) logic to identify high-probability trend continuation and reversal entries based on Break of Structure (BOS) on XAUUSD. It is designed for traders looking to test institutional-style structure breaks with dynamic entry and risk-managed exits.
The strategy detects BOS using swing highs and lows, then enters trades based on price momentum (bullish or bearish candle confirmation). Each trade is automatically managed using a fixed stop loss in pips and a customizable risk-to-reward (RR) ratio. The goal is to backtest how BOS alone can drive clean directional entries, simulating Smart Money precision without repainting or false signals.
🔑 Key Features:
BOS-Based Entry Logic: Enters trades only after a valid break of structure (new higher high or lower low), signaling continuation from a Smart Money shift.
Momentum Filtered Entry: Requires candle confirmation to validate direction (e.g., bullish close after bullish BOS).
Full Backtest Engine: Built using strategy() functions, allowing you to test SL/TP performance and adjust position sizing.
Custom Risk Control: Adjust Stop Loss (in pips) and Target Profit using a flexible RR ratio (e.g. 1:2 or 1:3 setups).
Works Across Timeframes: Optimized for 15m, 1H, and 4H on XAUUSD, but works on any asset that respects structure.
⚙️ Settings:
Swing Sensitivity – Controls how strict pivot highs/lows are
Minimum Bar Spacing – Prevents overtrading after recent BOS
Stop Loss (in pips) – Fixed distance from entry
Risk/Reward Ratio – Multiplies SL for dynamic take-profit
Trade Direction – Supports both long and short with momentum
📊 How It Works:
Detects new structure break (BOS)
Confirms momentum with candle direction (close > open for long, close < open for short)
Triggers entry and sets TP/SL automatically
Logs results in the Strategy Tester for full backtest evaluation
📌 Optimized For:
XAUUSD (Gold)
Smart Money / SMC / ICT traders
Trend continuation + reversal structures
Backtest-focused strategy building
Institutional-level analysis
📎 Release Notes:
v1.0 – Initial release of BOS-only SMC strategy with full entry/exit simulation and strategy tester support.
⚠️ Disclaimer:
This strategy is built for educational and research purposes only. It is not a signal provider or financial advice. Always combine with your personal confirmation, confluence tools, and risk management.
SMC Structure Levels – BOS & CHoCH for XAUUSDThis is a custom-made TradingView indicator designed to visualize high-confidence market structure shifts based on Smart Money Concepts (SMC), focusing on Break of Structure (BOS) and Change of Character (CHoCH) points. The tool is optimized for XAUUSD but works across all major forex, crypto, and index markets.
It identifies key pivot points and filters them using both price distance and bar spacing, helping traders focus only on meaningful structural changes — not noisy signals. This makes it ideal for traders looking to track institutional-style price behavior with clarity.
🔑 Key Features:
Clean BOS & CHoCH Labels: The indicator plots “BOS” above candles when a structural break occurs in the trend direction, and “CHoCH” below candles when early signs of a reversal appear.
Spaced Signals: Only plots structure shifts that meet both time and price distance filters, preventing clutter and overplotting on the chart.
Swing-Based Logic: Built on pivot high/low analysis with adjustable sensitivity, ensuring flexible structure detection on any timeframe.
Fully Customizable: Modify:
Swing Sensitivity (number of bars before/after pivot)
Minimum bar spacing between BOS/CHoCH signals
Minimum price movement (in pips) between labels
Toggle BOS or CHoCH visibility individually
No Repainting: Once confirmed, signals remain fixed on the chart for historical review.
Zero Clutter: Unlike typical SMC tools that flood the chart, this indicator prioritizes clarity and signal quality.
🧠 What is BOS & CHoCH?
Break of Structure (BOS): Indicates continuation of the current market trend.
Change of Character (CHoCH): Suggests a potential early trend reversal or shift in momentum.
These tools are often used by Smart Money traders to mark significant turning points and trend confirmations.
⚙️ Use Cases:
Structural tracking in Smart Money Concepts (SMC)
Identifying trend continuation or early reversal
XAUUSD (Gold) swing and intraday analysis
Support for Order Blocks, Liquidity Grabs, and FVG confluence
Backtesting market structure break behavior
📌 Best Pairs:
XAUUSD (Gold)
Any asset where structure-based analysis is relevant
📎 Release Notes:
v1.0 – Initial release of BOS/CHoCH structure tool with spacing and pip-distance filtering for XAUUSD analysis.
⚠️ Disclaimer:
This indicator is built for educational and analytical purposes only. It does not constitute trading advice or guarantee profitable signals. Always use with a proper risk management strategy and confirm signals with additional confluence.
✅ This matches the exact quality and structure of the description you showed earlier.
Just copy this into your TradingView script page when publishing. If you'd like the next version with Order Blocks or FVG, say the word.
Confirmed Entry Grid Pro//@version=5
indicator("Confirmed Entry Grid Pro", overlay=true)
// === المتوسطات ===
ma9 = ta.sma(close, 9)
ma21 = ta.sma(close, 21)
ma200 = ta.sma(close, 200)
// === الاتجاه ===
trendBull = close > ma200
trendBear = close < ma200
// === الزخم ===
rsi = ta.rsi(close, 14)
rsiBull = rsi > 50
rsiBear = rsi < 50
// === الحجم ===
volMA = ta.sma(volume, 20)
volHigh = volume > volMA
// === شموع ابتلاعية ===
bullEngulf = close > open and open < close and close > open
bearEngulf = close < open and open > close and close < open
// === بولنجر باند ===
basis = ta.sma(close, 20)
dev = ta.stdev(close, 20)
upper = basis + 2 * dev
lower = basis - 2 * dev
bbBreakUp = close > upper
bbBreakDown = close < lower
// === دعم / مقاومة ديناميكية ===
support = ta.lowest(low, 20)
resistance = ta.highest(high, 20)
nearSupport = math.abs(close - support) / close < 0.015
nearResistance = math.abs(close - resistance) / close < 0.015
// === تقاطع المتوسطات ===
crossUp = ta.crossover(ma9, ma21)
crossDown = ta.crossunder(ma9, ma21)
// === ATR ===
atr = ta.atr(14)
atrActive = atr > ta.sma(atr, 14)
// === SMC: BOS + CHOCH ===
bosUp = high > high and low > low
bosDown = low < low and high < high
chochUp = close > high and close < high
chochDown = close < low and close > low
smcBuy = bosUp and chochUp
smcSell = bosDown and chochDown
// === مناطق السيولة ===
liqHigh = ta.highest(high, 30)
liqLow = ta.lowest(low, 30)
liquidityBuyZone = close < liqLow
liquiditySellZone = close > liqHigh
// === حساب النقاط لكل صفقة ===
buyScore = (trendBull ? 1 : 0) + (rsiBull ? 1 : 0) + (volHigh ? 1 : 0) + (bullEngulf ? 1 : 0) + (smcBuy ? 1 : 0) + (bbBreakUp ? 1 : 0) + (nearSupport ? 1 : 0) + (crossUp ? 1 : 0) + (atrActive ? 1 : 0) + (liquidityBuyZone ? 1 : 0)
sellScore = (trendBear ? 1 : 0) + (rsiBear ? 1 : 0) + (volHigh ? 1 : 0) + (bearEngulf ? 1 : 0) + (smcSell ? 1 : 0) + (bbBreakDown ? 1 : 0) + (nearResistance ? 1 : 0) + (crossDown ? 1 : 0) + (atrActive ? 1 : 0) + (liquiditySellZone ? 1 : 0)
// === شروط الإشارات مع منع التكرار خلال آخر 5 شموع ===
var int lastBuyBar = na
var int lastSellBar = na
canBuy = buyScore >= 5 and (na(lastBuyBar) or bar_index - lastBuyBar > 5)
canSell = sellScore >= 5 and (na(lastSellBar) or bar_index - lastSellBar > 5)
if canBuy
lastBuyBar := bar_index
if canSell
lastSellBar := bar_index
showBuy = canBuy
showSell = canSell
// === طول الخطوط ===
var int lineLen = 5
// === رسم الإشارات ===
plotshape(showBuy, title="BUY", location=location.belowbar, style=shape.triangleup, size=size.small, color=color.green)
plotshape(showSell, title="SELL", location=location.abovebar, style=shape.triangledown, size=size.small, color=color.red)
// === خطوط الصفقة ===
var line buyLines = array.new_line(0)
var line sellLines = array.new_line(0)
if (showBuy)
entry = low
tpLevels = array.new_float(5)
array.set(tpLevels, 0, 0.618)
array.set(tpLevels, 1, 1.0)
array.set(tpLevels, 2, 1.272)
array.set(tpLevels, 3, 1.618)
array.set(tpLevels, 4, 2.0)
slLevel = -0.618
for i = 0 to 4
tp = entry + array.get(tpLevels, i) * atr
line = line.new(bar_index, tp, bar_index + lineLen, tp, color=color.green)
array.push(buyLines, line)
sl = entry + slLevel * atr
slLine = line.new(bar_index, sl, bar_index + lineLen, sl, color=color.red)
array.push(buyLines, slLine)
if (showSell)
entry = high
tpLevels = array.new_float(5)
array.set(tpLevels, 0, -0.618)
array.set(tpLevels, 1, -1.0)
array.set(tpLevels, 2, -1.272)
array.set(tpLevels, 3, -1.618)
array.set(tpLevels, 4, -2.0)
slLevel = 0.618
for i = 0 to 4
tp = entry + array.get(tpLevels, i) * atr
line = line.new(bar_index, tp, bar_index + lineLen, tp, color=color.green)
array.push(sellLines, line)
sl = entry + slLevel * atr
slLine = line.new(bar_index, sl, bar_index + lineLen, sl, color=color.red)
array.push(sellLines, slLine)
// === نسبة المخاطرة ===
label.new(bar_index, showBuy ? low : na, "Risk: 38.2%", style=label.style_label_left, textcolor=color.white, size=size.tiny, color=color.gray)
label.new(bar_index, showSell ? high : na, "Risk: 38.2%", style=label.style_label_left, textcolor=color.white, size=size.tiny, color=color.gray)
Bollinger + Supertrend Hybrid Pro (Auto-Backtest)This strategy tell you when to huy and sell it is bollinger and supertrend
ICT Unicorn Strategy [RoboQuant]Baseline Calculation –
• A «period‑length» «moving average / VWAP / Donchian midline» establishes directional bias.
Momentum Layer –
• A «RSI / MACD histogram / custom oscillator» gauges buying vs. selling pressure.
Signal Generation –
• A long/short arrow prints when both:
Price closes «above / below» the baseline, and
Momentum crosses «+/- zero line / threshold X».
• Color‑coded background highlights confirmed trends; gray background warns of chop.
Williams FractalsBoaBias Fractals High & Lows is an indicator based on Bill Williams' fractals that helps identify key support and resistance levels on the chart. It displays horizontal lines at fractal highs (red) and lows (green), which extend to the current bar. Lines automatically disappear if the price breaks through them, leaving only the relevant levels. Additionally, the indicator shows the price values of active fractals on the price scale for convenient monitoring.
Key Features:
Customizable Fractals: Choose between 3-bar or 5-bar fractals (default: 3-bar).
Period: Adjust the number of periods for calculation
Visualization: Red lines for highs (resistance), green for lows (support). Lines are fixed on the chart and persist during scrolling or scaling changes.
Alert System: Notifications for the formation of a new fractal high/low and for level breaks (Fractal High Formed, Fractal Low Formed, Fractal High Broken, Fractal Low Broken).
How to Use:
Add the indicator to the chart.
Configure parameters: select the fractal type (3 or 5 bars) and period.
Set up alerts in TradingView to receive notifications about new fractals or breaks.
Use the lines as levels for entry/exit positions, stop-losses, or take-profits in fractal-based strategies.
Troubleshooting: If Levels Are Not Fixed on the Chart
If the levels (fractal lines) do not stay fixed on the chart and fail to move with it during scrolling or scaling (e.g., they remain stationary while the chart shifts), this is typically due to the indicator's scale settings in TradingView. The indicator may be set to "No scale," causing the lines to desynchronize from the chart's price scale.
What to Do:
Locate the Indicator Label: On the chart, find the indicator label in the top-left corner of the pane (or where "BoaBias Fractals High & Lows" is displayed).
Right-Click the Label: Click the right mouse button on this label.
Adjust the Scale:
In the context menu, look for the "Scale" or "Pin to scale" option.
If it shows "Pin to scale (now no scale)" or similar, select "Pin to right scale" (or "Pin to left scale," depending on your chart's main price scale—usually the right).
Refresh the Chart: After changing the setting, refresh the chart (press F5 or reload the page), or toggle the indicator off and on again to apply the changes.
After this, the lines should move and scale with the chart during scrolling (horizontal or vertical) or zooming. If the issue persists, check:
TradingView Limits: The indicator may draw too many lines (maximum ~500 per script). If there are many historical fractals, older lines might not display.
Chart Settings: Ensure the chart is not in logarithmic scale (if applicable) or that auto-scaling is enabled.
Indicator Version: Verify you are using the latest script version (Pine Script v6) and check for errors in the TradingView console.
This indicator is ideal for traders working with Bill Williams' chaos theory or those seeking dynamic support/resistance levels. It is based on standard fractals but with enhancements for convenience: automatic removal of broken levels and integration with the price scale.
Note: The indicator does not provide trading signals on its own — use it in combination with other tools. Test on historical data before real trading.
Code written in Pine Script v6. Original template: Mit Nayi.
ORB Breakouts with AlertsORB Breakout indicator with alerts. Lets you select which candles to set alerts and highlights on.
AO Divergence StrategyQuick strategy tester to set up and find the best indicator values
Recommended values:
AO Fast EMA/SMA Length: 5
AO Slow EMA/SMA Length: 25
Use EMA instead of SMA for AO: ❌ (unchecked)
Right Lookback Pivot: 24
Left Lookback Pivot: 18
Maximum Lookback Range: 60
Minimum Lookback Range: 5
Bullish Trace: ✅
Hidden Bullish Trace: ❌
Bearish Trace: ✅
Hidden Bearish Trace: ❌
Status Line Input: ✅
Do your own testing and research, don't just rely on the posting chart that differs from the recommended settings.
MA Crossover with Dots📘 Strategy Description – Moving Average Crossover with Dot Signals
This indicator is based on a Simple Moving Average (SMA) crossover strategy, which is a classic method to identify trend changes and potential buy/sell signals in the market.
📊 Core Logic:
It calculates two SMAs:
Fast SMA: 20-period moving average (short-term trend)
Slow SMA: 50-period moving average (longer-term trend)
✅ Buy Signal (Green Dot):
When the Fast SMA crosses above the Slow SMA, a Buy signal is generated.
This suggests bullish momentum or the start of an uptrend.
❌ Sell Signal (Red Dot):
When the Fast SMA crosses below the Slow SMA, a Sell signal is generated.
This suggests bearish momentum or the start of a downtrend.
📍 Visual Representation:
The Buy and Sell signals are plotted as colored dots at different levels:
Green dot = Buy
Red dot = Sell
The dots are plotted at fixed vertical positions in a separate panel below the chart for better clarity and to avoid overlap.
FİBO FİNAL An Indicator Suitable for Further Development
OK3 Final Buy
S1 Take Profit
S2 Close Half of the Position
S3 Close the Position
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.
Student-t Weighted Acceleration & Velocity⚙️ Student-t Weighted Acceleration & Velocity
Author: © GabrielAmadeusLau
Category: Momentum, Smoothing, Divergence Detection
🔍 Overview
Student-t Weighted Acceleration & Velocity is a precision-engineered momentum indicator designed to analyze the rate of price change (velocity) and rate of change of velocity (acceleration). It leverages Student-t weighted smoothing, bandpass filtering, and divergence detection to reveal underlying momentum trends, shifts, and potential reversals with high sensitivity and low noise.
🧠 Key Features
🌀 1. Student-t Weighted Moving Average
Applies Student-t distribution weights to price data.
Controlled by:
ν (Degrees of Freedom): Lower ν increases weight on recent data, improving sensitivity to fast-moving markets.
Window Length: Sets the lookback period for weighted averaging.
🚀 2. Velocity & Acceleration Calculation
Velocity: Measures how fast price is moving over time.
Acceleration: Measures the change in velocity, revealing turning points.
Both are calculated via:
Butterworth High-pass Filter
Super Smoother Low-pass Filter
Fast Root Mean Square (RMS) normalization
Optionally smoothed using a Super Smoother EMA.
🎯 3. Signal Conditions
Strong Up: When smoothed velocity crosses above the overbought threshold and acceleration is positive.
Strong Down: When smoothed velocity crosses below the oversold threshold and acceleration is negative.
Visual cues:
Green & red triangle shapes for signals.
Colored histogram & column plots.
Optional bar coloring based on A/V behavior.
🔎 4. Divergence Detection Engine
Built-in multi-timeframe divergence system with:
Bullish/Bearish Regular Divergence
Bullish/Bearish Hidden Divergence
Customizable settings:
Pivot detection, confirmation logic, lookback limits.
Heikin Ashi mode for smoothed divergence detection.
Configurable line style, width, and color.
Visual plots of divergence lines on price chart.
⚙️ Custom Inputs
A/V Calculation Parameters:
Lookback period, filter lengths (Butterworth, Super Smoother, RMS), EMA smoothing.
Divergence Settings:
Enable/disable confirmation, show last divergence only.
Adjustable pivot period and max lookback bars.
Heikin Ashi Mode:
Option to use Heikin Ashi candles for divergence detection only (without switching chart type).
Thresholds:
Overbought/Oversold Sigma levels for strong signal detection.
🔔 Alerts Included
Strong Up Alert: Momentum and acceleration aligned bullishly.
Strong Down Alert: Momentum and acceleration aligned bearishly.
All Divergence Types:
Bullish/Bearish Regular Divergence
Bullish/Bearish Hidden Divergence
Aggregated Divergence Alerts
📌 Use Cases
Spot momentum bursts and reversals with confirmation from both velocity and acceleration.
Identify divergence-based signals for early entries/exits.
Apply across multiple timeframes or pair with other trend filters.
VIPDX//@version=5
indicator(title="VIPDX1", 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!")