
یہ حکمت عملی ایک جامع تجارتی نظام ہے جس میں ٹریڈنگ سگنل کی تصدیق کے لئے متعدد تکنیکی اشارے شامل ہیں۔ بنیادی منطق تیز رفتار اور سست رفتار اشاریہ حرکت پذیر اوسط ((EMA) کے کراس پر مبنی ہے ، اور سگنل کی تصدیق کی جاتی ہے جس کی وجہ سے قیمتوں میں وزن کی اوسط قیمت ((VWAP) اور نسبتا strong مضبوط اشارے ((RSI) ہے۔ اس کے علاوہ ، نظام میں حقیقی طول موج پر مبنی متحرک اسٹاپ نقصان کا پروگرام (ATR) ہے ، جو خطرے کے انتظام کی سائنسی اور لچک کو یقینی بناتا ہے۔
اس حکمت عملی کا بنیادی اصول یہ ہے کہ متعدد تکنیکی اشارے کے ہم آہنگی سے کام کرنے کے ذریعے تجارت کی سمت کی تصدیق کی جائے۔ اس میں شامل ہیں:
یہ حکمت عملی متعدد تکنیکی اشارے کے نامیاتی امتزاج کے ذریعہ ایک نسبتا complete مکمل تجارتی نظام کی تشکیل کرتی ہے۔ اس میں نہ صرف سگنل کی درستگی پر توجہ دی گئی ہے بلکہ خطرے کے انتظام کی اہمیت پر بھی زور دیا گیا ہے۔ اگرچہ اس میں کچھ حدود موجود ہیں ، لیکن مسلسل اصلاح اور بہتری کے ذریعہ ، اس حکمت عملی کو متعدد مارکیٹ کے ماحول میں مستحکم کارکردگی کا مظاہرہ کرنے کی امید ہے۔ اس کی کلید یہ ہے کہ پیرامیٹرز کو حقیقی تجارت کی صورتحال کے مطابق مستقل طور پر ایڈجسٹ کیا جائے اور مارکیٹ کے ماحول میں تبدیلیوں کے ساتھ لچکدار اطلاق کیا جائے۔
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("BTC Day Trading Strategy with Alerts", overlay=true)
// Input parameters
emaShortLength = input(9, title="Short EMA Length")
emaLongLength = input(21, title="Long EMA Length")
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought Level")
rsiOversold = input(30, title="RSI Oversold Level")
atrMultiplier = input(1.5, title="ATR Multiplier for SL")
riskRewardRatio = input(2, title="Risk-Reward Ratio") // Defines TP as 2x SL
// Calculate indicators
emaShort = ta.ema(close, emaShortLength)
emaLong = ta.ema(close, emaLongLength)
rsi = ta.rsi(close, rsiLength)
vwap = ta.vwap(close) // Fixed: Added "close" as the source
atr = ta.atr(14)
// Define conditions for entry
longCondition = ta.crossover(emaShort, emaLong) and close > vwap and rsi > 50
shortCondition = ta.crossunder(emaShort, emaLong) and close < vwap and rsi < 50
// ATR-based Stop Loss & Take Profit
longSL = close - (atr * atrMultiplier)
longTP = close + ((close - longSL) * riskRewardRatio)
shortSL = close + (atr * atrMultiplier)
shortTP = close - ((shortSL - close) * riskRewardRatio)
// Execute trades
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", from_entry="Long", stop=longSL, limit=longTP)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", from_entry="Short", stop=shortSL, limit=shortTP)
// 🔔 Add Alert Conditions for TradingView Alerts
alertcondition(longCondition, title="BTC Buy Signal", message="🚀 Buy Signal: 9 EMA crossed above 21 EMA, Price above VWAP, RSI > 50")
alertcondition(shortCondition, title="BTC Sell Signal", message="🔻 Sell Signal: 9 EMA crossed below 21 EMA, Price below VWAP, RSI < 50")
// Plot indicators
plot(emaShort, color=color.blue, title="9 EMA", linewidth=2) // Thicker line for better visibility
plot(emaLong, color=color.red, title="21 EMA", linewidth=2) // Thicker line for better visibility
hline(rsiOverbought, "RSI Overbought", color=color.red, linewidth=2) // Thicker line for RSI Overbought
hline(rsiOversold, "RSI Oversold", color=color.green, linewidth=2) // Thicker line for RSI Oversold
plot(vwap, color=color.purple, title="VWAP", linewidth=2) // VWAP line on price chart
// Create a separate panel for RSI for better scaling
plot(rsi, color=color.orange, title="RSI", linewidth=2, style=plot.style_line) // Plot RSI on a separate panel