
اس حکمت عملی میں سپورٹ / مزاحمت ((S / R) بریک / ریورس ، ٹرانزیکشن فلٹرنگ اور انتباہی نظام شامل ہیں ، جس کا مقصد مارکیٹ میں اہم موڑ کو پکڑنا ہے۔ حکمت عملی میں قیمتوں میں توڑ یا الٹ سگنل کی نشاندہی کی جاتی ہے ، اور غیر معمولی ٹرانزیکشن کی تصدیق کے ساتھ مل کر ، ٹریڈنگ سگنل کی وشوسنییتا کو بڑھا دیا جاتا ہے۔ حکمت عملی میں خطرہ کا انتظام کرنے کے لئے ایک مقررہ 2٪ اسٹاپ نقصان اور ایڈجسٹ اسٹاپ تناسب ((ڈیفالٹ 3٪) کا استعمال کیا جاتا ہے۔
ta.pivothigh()اورta.pivotlow()یہ فنکشن ایک مخصوص دورانیے کے اندر اہم قیمت کی سطح کی شناخت کرتا ہے۔ جب قیمت مزاحمت کی سطح کو توڑتی ہے (ایک فیصد کی سطح سے اوپر) یا سپورٹ کی سطح سے اچھالتی ہے (کم تلاش کے بعد واپس لے لی جاتی ہے) تو یہ سگنل کو متحرک کرتا ہے۔strategy.exit()پورا کرنااس حکمت عملی نے ٹرپل توثیق (قیمت کی پوزیشن ، ٹرانزیکشن کی مقدار ، قیمت کا عمل) کے ذریعہ ایک اعلی امکانات کا تجارتی فریم ورک ڈیزائن کیا ہے ، جو خاص طور پر رجحانات کی ابتدائی گرفت کے لئے موزوں ہے۔ بنیادی فوائد منطقی شفافیت ، خطرے پر قابو پانے کے ہیں ، لیکن ہنگامہ خیز مارکیٹوں میں اس کی حدود پر دھیان دیں۔ مستقبل میں اصلاحات استحکام کو مزید بڑھانے کے لئے پیرامیٹرز کی خودکشی اور رجحان فلٹرنگ پر توجہ مرکوز کرسکتی ہیں۔
/*backtest
start: 2024-04-24 00:00:00
end: 2024-12-31 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/
//@version=5
strategy("S/R Breakout/Reversal + Volume + Alerts", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// === INPUTS ===
pivotLen = input.int(10, "Pivot Lookback for S/R")
volSmaLength = input.int(20, "Volume SMA Length")
volMultiplier = input.float(1.5, "Volume Multiplier")
tpPerc = input.float(3.0, "Take Profit %", step=0.1)
slPerc = 2.0 // Stop Loss fixed at 2%
// === S/R ZONES ===
pivotHigh = ta.pivothigh(high, pivotLen, pivotLen)
pivotLow = ta.pivotlow(low, pivotLen, pivotLen)
var float resZone = na
var float supZone = na
if not na(pivotHigh)
resZone := pivotHigh
if not na(pivotLow)
supZone := pivotLow
plot(supZone, title="Support", color=color.green, linewidth=2, style=plot.style_linebr)
plot(resZone, title="Resistance", color=color.red, linewidth=2, style=plot.style_linebr)
// === VOLUME FILTER ===
volSma = ta.sma(volume, volSmaLength)
highVolume = volume > volSma * volMultiplier
// === LONG LOGIC ===
priceAboveRes = close > resZone * 1.01
nearSupport = close >= supZone * 0.99 and close <= supZone * 1.01
rejectSupport = low <= supZone and close > supZone
longBreakoutCond = priceAboveRes and highVolume
longReversalCond = nearSupport and rejectSupport and highVolume
longCondition = longBreakoutCond or longReversalCond
// === SHORT LOGIC ===
priceBelowSup = close < supZone * 0.99
nearResistance = close >= resZone * 0.99 and close <= resZone * 1.01
rejectResistance = high >= resZone and close < resZone
shortBreakoutCond = priceBelowSup and highVolume
shortReversalCond = nearResistance and rejectResistance and highVolume
shortCondition = shortBreakoutCond or shortReversalCond
// === ENTRIES WITH LABELS ===
if (longCondition)
strategy.entry("Long", strategy.long)
label.new(bar_index, low * 0.995, "BUY", style=label.style_label_up, color=color.green, textcolor=color.white)
if (shortCondition)
strategy.entry("Short", strategy.short)
label.new(bar_index, high * 1.005, "SELL", style=label.style_label_down, color=color.red, textcolor=color.white)
// === TP/SL ===
longTP = close * (1 + tpPerc / 100)
longSL = close * (1 - slPerc / 100)
shortTP = close * (1 - tpPerc / 100)
shortSL = close * (1 + slPerc / 100)
strategy.exit("Long TP/SL", from_entry="Long", limit=longTP, stop=longSL)
strategy.exit("Short TP/SL", from_entry="Short", limit=shortTP, stop=shortSL)
// === ALERT CONDITIONS ===
alertcondition(longCondition, title="Buy Alert", message="🔔 BUY signal: S/R + Volume breakout/reversal")
alertcondition(shortCondition, title="Sell Alert", message="🔔 SELL signal: S/R + Volume breakout/reversal")