
یہ حکمت عملی ایک موافقت پذیر تجارتی نظام ہے جو متعدد تکنیکی تجزیہ اشارے کو مربوط کرتا ہے اور مارکیٹ کے حالات کی متحرک طور پر شناخت کرکے مختلف تجارتی حکمت عملیوں کے درمیان سوئچ کرتا ہے۔ یہ نظام بنیادی طور پر تین تکنیکی اشارے پر مبنی ہے: موونگ ایوریج (MA)، بولنگر بینڈز (BB) اور رشتہ دار طاقت انڈیکس (RSI)، اور مارکیٹ کے رجحانات اور رینج کے اتار چڑھاو کے مطابق خودکار طور پر موزوں ترین تجارتی طریقہ کا انتخاب کرتا ہے۔ حکمت عملی مختلف ٹیک-پرافٹ اور اسٹاپ لاس کے پیرامیٹرز کو ترتیب دے کر رجحان اور رینج مارکیٹس کے لیے مختلف رسک مینجمنٹ سلوشنز کو اپناتی ہے۔
یہ حکمت عملی مارکیٹ کے رجحانات کا تعین کرنے کے لیے 50 مدت اور 20 مدت کی موونگ ایوریج کا استعمال کرتی ہے، اور بولنگر بینڈز اور RSI انڈیکیٹرز کو جوڑ کر زیادہ خریدے گئے اور زیادہ فروخت ہونے والے علاقوں کی نشاندہی کرتی ہے۔ ایک ٹرینڈنگ مارکیٹ میں، نظام بنیادی طور پر قیمت اور سست رفتاری اور تیز رفتار اور سست لائنوں کے کراس اوور کے درمیان تعلقات کی بنیاد پر تجارت کرتا ہے، یہ بنیادی طور پر بولنگر بینڈ کی باؤنڈری کامیابیوں اور RSI سے زیادہ خریدے گئے اور زیادہ فروخت ہونے والے سگنلز کی بنیاد پر تجارت کرتا ہے۔ . یہ نظام مارکیٹ کے ماحول کے مطابق ٹیک-پرافٹ کو خود بخود ایڈجسٹ کرتا ہے اور 4% ٹیک-پرافٹ رینج مارکیٹس کے لیے یکساں طور پر استعمال کیا جاتا ہے۔ خطرات
یہ حکمت عملی متعدد کلاسک تکنیکی اشاریوں کو مربوط کرتی ہے تاکہ ایک انکولی تجارتی نظام بنایا جا سکے جو مارکیٹ کے مختلف ماحول کے مطابق ہو سکے۔ آپریشن کو سادہ رکھتے ہوئے، نظام کو مارکیٹ کی حیثیت کی متحرک شناخت اور تجارتی حکمت عملیوں کے خودکار سوئچنگ کا احساس ہوتا ہے، اور یہ انتہائی عملی ہے۔ ٹیک-پرافٹ اور سٹاپ-لاس کی مختلف ترتیبات کے ذریعے، حکمت عملی خطرات کو کنٹرول کرتے ہوئے اچھے منافع کو برقرار رکھتی ہے۔ مستقبل میں، مزید تکنیکی اشارے متعارف کروا کر اور پیرامیٹر ایڈجسٹمنٹ میکانزم کو بہتر بنا کر حکمت عملی کے استحکام اور وشوسنییتا کو مزید بہتر بنایا جا سکتا ہے۔
/*backtest
start: 2024-01-17 00:00:00
end: 2025-01-16 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=6
strategy("Supply & Demand Test 1 - Enhanced", overlay=true)
// Inputs
ma_length = input.int(50, title="50-period Moving Average Length", minval=1)
ma_length_fast = input.int(20, title="20-period Moving Average Length", minval=1)
bb_length = input.int(20, title="Bollinger Bands Length", minval=1)
bb_std_dev = input.float(2.0, title="Bollinger Bands Std Dev", step=0.1)
rsi_length = input.int(14, title="RSI Length", minval=1)
stop_loss_percent = input.float(0.02, title="Stop Loss Percent", step=0.001, minval=0.001)
take_profit_trend = input.float(0.06, title="Take Profit Percent (Trend)", step=0.001, minval=0.001)
take_profit_range = input.float(0.04, title="Take Profit Percent (Range)", step=0.001, minval=0.001)
// Moving Averages
ma_slow = ta.sma(close, ma_length)
ma_fast = ta.sma(close, ma_length_fast)
// Bollinger Bands
bb_basis = ta.sma(close, bb_length)
bb_dev = ta.stdev(close, bb_length)
bb_upper = bb_basis + bb_std_dev * bb_dev
bb_lower = bb_basis - bb_std_dev * bb_dev
// RSI
rsi = ta.rsi(close, rsi_length)
// Market Conditions
is_trending_up = close > ma_slow
is_trending_down = close < ma_slow
is_range_bound = not (is_trending_up or is_trending_down)
// Entry Conditions
long_trend_entry = is_trending_up and close >= ma_slow * 1.02
short_trend_entry = is_trending_down and close <= ma_slow * 0.98
long_ma_crossover = ta.crossover(ma_fast, ma_slow)
short_ma_crossover = ta.crossunder(ma_fast, ma_slow)
long_range_entry = is_range_bound and close <= bb_lower * 0.97
short_range_entry = is_range_bound and close >= bb_upper * 1.03
long_rsi_entry = is_range_bound and rsi < 30
short_rsi_entry = is_range_bound and rsi > 70
// Entry and Exit Logic
if long_trend_entry
strategy.entry("Long Trend", strategy.long)
strategy.exit("Exit Long Trend", from_entry="Long Trend", stop=close * (1 - stop_loss_percent), limit=close * (1 + take_profit_trend))
alert("Entered Long Trend", alert.freq_once_per_bar)
if short_trend_entry
strategy.entry("Short Trend", strategy.short)
strategy.exit("Exit Short Trend", from_entry="Short Trend", stop=close * (1 + stop_loss_percent), limit=close * (1 - take_profit_trend))
alert("Entered Short Trend", alert.freq_once_per_bar)
if long_ma_crossover
strategy.entry("Long MA Crossover", strategy.long)
strategy.exit("Exit Long MA Crossover", from_entry="Long MA Crossover", stop=close * (1 - stop_loss_percent), limit=close * (1 + take_profit_trend))
alert("Entered Long MA Crossover", alert.freq_once_per_bar)
if short_ma_crossover
strategy.entry("Short MA Crossover", strategy.short)
strategy.exit("Exit Short MA Crossover", from_entry="Short MA Crossover", stop=close * (1 + stop_loss_percent), limit=close * (1 - take_profit_trend))
alert("Entered Short MA Crossover", alert.freq_once_per_bar)
if long_range_entry
strategy.entry("Long Range", strategy.long)
strategy.exit("Exit Long Range", from_entry="Long Range", stop=close * (1 - stop_loss_percent), limit=close * (1 + take_profit_range))
alert("Entered Long Range", alert.freq_once_per_bar)
if short_range_entry
strategy.entry("Short Range", strategy.short)
strategy.exit("Exit Short Range", from_entry="Short Range", stop=close * (1 + stop_loss_percent), limit=close * (1 - take_profit_range))
alert("Entered Short Range", alert.freq_once_per_bar)
if long_rsi_entry
strategy.entry("Long RSI", strategy.long)
strategy.exit("Exit Long RSI", from_entry="Long RSI", stop=close * (1 - stop_loss_percent), limit=close * (1 + take_profit_range))
alert("Entered Long RSI", alert.freq_once_per_bar)
if short_rsi_entry
strategy.entry("Short RSI", strategy.short)
strategy.exit("Exit Short RSI", from_entry="Short RSI", stop=close * (1 + stop_loss_percent), limit=close * (1 - take_profit_range))
alert("Entered Short RSI", alert.freq_once_per_bar)
// Plotting
plot(ma_slow, color=color.blue, title="50-period MA")
plot(ma_fast, color=color.orange, title="20-period MA")
plot(bb_upper, color=color.red, title="Bollinger Upper")
plot(bb_lower, color=color.green, title="Bollinger Lower")
plot(bb_basis, color=color.gray, title="Bollinger Basis")
hline(70, "Overbought (RSI)", color=color.red, linestyle=hline.style_dotted)
hline(30, "Oversold (RSI)", color=color.green, linestyle=hline.style_dotted)