
یہ حکمت عملی شیریائیف-زہو انڈیکس ((SZI) پر مبنی ایک خود کار طریقے سے ٹریڈنگ سسٹم ہے۔ یہ مارکیٹ میں زیادہ خرید اور زیادہ فروخت کے حالات کی نشاندہی کرنے کے لئے عددی منافع کی شرح کے معیاری اسکور کا حساب لگاتا ہے تاکہ قیمتوں میں اوسط واپسی کے مواقع کو پکڑ سکے۔ حکمت عملی میں متحرک اسٹاپ نقصان اور منافع بخش اہداف کا امتزاج ہوتا ہے تاکہ خطرے پر عین مطابق کنٹرول حاصل کیا جاسکے۔
اس حکمت عملی کا بنیادی مقصد معیاری اشارے کی تعمیر کرنا ہے جس میں ہم آہنگی کی شرح منافع کی رولنگ اعداد و شمار کی خصوصیات شامل ہیں۔ اس کے لئے درج ذیل اقدامات ہیں:
یہ ایک ٹھوس اعدادوشمار پر مبنی ایک مقداری تجارت کی حکمت عملی ہے جو معیاری عددی منافع کے ذریعہ قیمت کے اتار چڑھاؤ کے مواقع کو پکڑتی ہے۔ حکمت عملی کا بنیادی فائدہ اس کی خودکشی اور بہتر خطرے پر قابو پانے میں ہے ، لیکن پیرامیٹرز کے انتخاب اور مارکیٹ کے ماحول میں موافقت کے لحاظ سے ابھی بھی اصلاح کی گنجائش موجود ہے۔ متحرک کمی اور کثیر جہتی سگنل کی تصدیق کے طریقہ کار کو متعارف کرانے سے حکمت عملی کی استحکام اور وشوسنییتا میں مزید اضافہ ہونے کا امکان ہے۔
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Jalambi Paul model", overlay=true)
// Define the length for the rolling window
window = input.int(50, title="Window Length", minval=1)
threshold = 2.0 // Fixed threshold value
risk_percentage = input.float(1.0, title="Risk Percentage per Trade", step=0.1) / 100
// Calculate the logarithmic returns
log_return = math.log(close / close[1])
// Calculate the rolling mean and standard deviation
rolling_mean = ta.sma(log_return, window)
rolling_std = ta.stdev(log_return, window)
// Calculate the Shiryaev-Zhou Index (SZI)
SZI = (log_return - rolling_mean) / rolling_std
// Generate signals based on the fixed threshold
long_signal = SZI < -threshold
short_signal = SZI > threshold
// Plot the signals on the main chart (overlay on price)
plotshape(series=long_signal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY", offset=-1)
plotshape(series=short_signal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL", offset=-1)
// Strategy logic: Buy when SZI crosses below the negative threshold, Sell when it crosses above the positive threshold
if (long_signal)
strategy.entry("Buy", strategy.long, comment="Long Entry")
if (short_signal)
strategy.entry("Sell", strategy.short, comment="Short Entry")
// Calculate the stop loss and take profit levels based on the percentage of risk
stop_loss_pct = input.float(2.0, title="Stop Loss (%)") / 100
take_profit_pct = input.float(4.0, title="Take Profit (%)") / 100
// Set the stop loss and take profit levels based on the entry price
strategy.exit("Take Profit / Stop Loss", "Buy", stop=close * (1 - stop_loss_pct), limit=close * (1 + take_profit_pct))
strategy.exit("Take Profit / Stop Loss", "Sell", stop=close * (1 + stop_loss_pct), limit=close * (1 - take_profit_pct))
// Plot the stop loss and take profit levels for visualization (optional)
plot(stop_loss_pct != 0 ? close * (1 - stop_loss_pct) : na, color=color.red, linewidth=1, title="Stop Loss Level")
plot(take_profit_pct != 0 ? close * (1 + take_profit_pct) : na, color=color.green, linewidth=1, title="Take Profit Level")