
یہ حکمت عملی برن بینڈ اشارے پر مبنی ہے ، جو قیمتوں کے اوپر ، نیچے اور درمیانی سڑک کی نقل و حرکت کا تجزیہ کرکے بہترین خرید و فروخت کے مواقع کی نشاندہی کرتی ہے۔ حکمت عملی ایک ساتھ مل کر کثیر سر اور خالی سر کی پوزیشنوں کا انتظام کرتی ہے ، جس سے مارکیٹ کی مختلف سمتوں سے منافع حاصل کیا جاسکتا ہے۔ حکمت عملی کے پیرامیٹرز کو مختلف خطرے کی برداشت اور مارکیٹ کے طریقوں کے مطابق ڈھالنے کے لئے اپنی مرضی کے مطابق کیا جاسکتا ہے۔ حکمت عملی واضح گرافک اشارے اور حقیقی وقت میں خرید و فروخت کے سگنل کی یاد دہانی فراہم کرتی ہے۔
اس حکمت عملی نے ایک مضبوط فریم ورک مہیا کیا ہے جس کی مدد سے قیمتوں کے سلسلے میں اس کی نقل و حرکت پر مبنی درست ٹریڈنگ سگنل تیار کیے جاتے ہیں۔ اس حکمت عملی میں کثیر سر اور خالی سر پوزیشن مینجمنٹ ، تخصیص شدہ پیرامیٹرز ، اور بصری اور بدیہی بصری اور یاد دہانی کی خصوصیات کو مربوط کیا گیا ہے۔ اس حکمت عملی نے بہت اچھا کارکردگی کا مظاہرہ کیا ہے ، لیکن اس کے باوجود اس میں اصلاحات کی گنجائش موجود ہے ، جیسے اضافی اشارے ، متحرک اتار چڑھاؤ کی حساب کتاب ، مضبوط رسک مینجمنٹ ٹکنالوجی ، اور مارکیٹ کی حالت کی بنیاد پر اپنی مرضی کے مطابق پوزیشن ایڈجسٹمنٹ شامل کرنا۔ مسلسل بہتری اور ایڈجسٹمنٹ کے ذریعہ ، اس حکمت عملی کو کسی بھی تاجر کے ٹول باکس میں قیمتی تکمیل کی جاسکتی ہے ، جس سے وہ متحرک مارکیٹوں میں تشریف لے جانے اور منافع کو زیادہ سے زیادہ کرنے میں مدد ملتی ہے۔
/*backtest
start: 2024-04-01 00:00:00
end: 2024-04-30 23:59:59
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bollinger Bands Strategy with Long and Short", overlay=true)
// Bollinger Bands settings
length = input.int(20, title="BB Length")
src = input(close, title="Source")
mult = input.float(2.0, title="BB Multiplier")
// Calculate Bollinger Bands
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
// Plot Bollinger Bands
plot(basis, color=color.blue, linewidth=1, title="Basis")
p1 = plot(upper, color=color.red, linewidth=1, title="Upper Band")
p2 = plot(lower, color=color.green, linewidth=1, title="Lower Band")
fill(p1, p2, color=color.rgb(173, 216, 230, 90))
// Long Buy and Sell conditions
buyConditionLower = ta.crossover(src, lower)
sellConditionUpper = ta.crossunder(src, upper)
buyConditionBasis = ta.crossover(src, basis)
sellConditionBasis = ta.crossunder(src, basis)
// Combine long conditions
buyCondition = buyConditionLower or buyConditionBasis
sellCondition = sellConditionUpper or sellConditionBasis
// Short Sell and Buy conditions
shortConditionUpper = ta.crossunder(src, upper)
coverConditionLower = ta.crossover(src, lower)
shortConditionBasis = ta.crossunder(src, basis)
coverConditionBasis = ta.crossover(src, basis)
// Combine short conditions
shortCondition = shortConditionUpper or shortConditionBasis
coverCondition = coverConditionLower or coverConditionBasis
// Execute strategy orders for long
if (buyCondition)
strategy.entry("Long", strategy.long)
if (sellCondition)
strategy.close("Long")
// Execute strategy orders for short
if (shortCondition)
strategy.entry("Short", strategy.short)
if (coverCondition)
strategy.close("Short")
// Plot Buy and Sell signals for long
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", title="Buy Signal")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", title="Sell Signal")
// Plot Sell and Cover signals for short
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="SHORT", title="Short Signal")
plotshape(series=coverCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="COVER", title="Cover Signal")
// Alert conditions for long
alertcondition(buyCondition, title="Buy Alert", message="Price crossed above the lower Bollinger Band or Basis")
alertcondition(sellCondition, title="Sell Alert", message="Price crossed below the upper Bollinger Band or Basis")
// Alert conditions for short
alertcondition(shortCondition, title="Short Alert", message="Price crossed below the upper Bollinger Band or Basis")
alertcondition(coverCondition, title="Cover Alert", message="Price crossed above the lower Bollinger Band or Basis")