
یہ حکمت عملی ایک ٹریڈنگ سسٹم ہے جو بروئنگ بینڈ کے معیاری فاصلے پر مبنی رجحانات کی پیروی کرتی ہے۔ حکمت عملی اس رجحان کی طاقت کا اندازہ لگانے کے لئے بروئنگ بینڈ کے نیچے والے مقام کے سلسلے میں تین مسلسل سلاخوں کا مشاہدہ کرتی ہے ، اور جب رجحان قائم ہوتا ہے تو تجارت کرتی ہے۔ اس نظام میں ہر تجارت کے خطرے کا انتظام کرنے کے لئے ایک مقررہ خطرہ منافع کا تناسب استعمال کیا جاتا ہے۔
حکمت عملی کی بنیادی منطق درج ذیل نکات پر مبنی ہے:
یہ ایک مناسب ڈیزائن کردہ رجحان سے باخبر رہنے کی حکمت عملی ہے ، جس میں مارکیٹ کے رجحانات کو برین بینڈ اور متعدد تصدیق کے طریقہ کار کے ذریعہ پکڑ لیا گیا ہے۔ حکمت عملی کا خطرہ مینجمنٹ فریم ورک کامل ہے ، معیارات پر عمل درآمد واضح ہے۔ اگرچہ کچھ پسماندگی موجود ہے ، لیکن تجویز کردہ اصلاح کی سمت سے حکمت عملی کی استحکام اور منافع کو مزید بہتر بنایا جاسکتا ہے۔ رجحان سے باخبر رہنے اور خطرے پر قابو پانے پر توجہ دینے والے تاجروں کے لئے ، یہ ایک قابل ذکر حکمت عملی کا فریم ورک ہے۔
/*backtest
start: 2024-11-01 00:00:00
end: 2025-02-18 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=6
strategy("Bollinger Band Buy and Sell Strategy (Entry at Close of 3rd Candle)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10, pyramiding=0)
// Bollinger Band settings
length = input.int(20, "Bollinger Band Length")
mult = input.float(2.0, "Standard Deviation Multiplier")
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upper_band = basis + dev
lower_band = basis - dev
// Plot Bollinger Bands
plot(upper_band, "Upper Band", color.blue)
plot(lower_band, "Lower Band", color.red)
// Initialize variables
var float buyEntryPrice = na
var float buyStopLoss = na
var float buyTargetPrice = na
var float sellEntryPrice = na
var float sellStopLoss = na
var float sellTargetPrice = na
// Buy Condition: Last 3 candles closed above upper band
buyCondition = close[2] > upper_band[2] and
close[1] > upper_band[1] and
close > upper_band
// Sell Condition: Last 3 candles closed below lower band
sellCondition = close[2] < lower_band[2] and close[1] < lower_band[1] and close < lower_band
// Buy Logic
if buyCondition and strategy.position_size == 0
buyEntryPrice := close // Entry at the close of the 3rd candle
buyStopLoss := low[2] // Low of the earliest candle in the 3-candle sequence
buyTargetPrice := buyEntryPrice + (buyEntryPrice - buyStopLoss)
strategy.entry("Buy", strategy.long)
strategy.exit("Buy Exit", "Buy", stop=buyStopLoss, limit=buyTargetPrice)
// Plot buy signal arrow on the entry candle
label.new(bar_index, low, "▲", color=color.green, style=label.style_label_up, yloc=yloc.belowbar)
// Sell Logic
if sellCondition and strategy.position_size == 0
sellEntryPrice := close // Entry at the close of the 3rd candle
sellStopLoss := high[2] // High of the earliest candle in the 3-candle sequence
sellTargetPrice := sellEntryPrice - (sellStopLoss - sellEntryPrice)
strategy.entry("Sell", strategy.short)
strategy.exit("Sell Exit", "Sell", stop=sellStopLoss, limit=sellTargetPrice)
// Plot sell signal arrow on the entry candle
label.new(bar_index, high, "▼", color=color.red, style=label.style_label_down, yloc=yloc.abovebar)
// Plot stop loss and target levels for buy trades
plot(strategy.position_size > 0 ? buyStopLoss : na, "Buy Stop Loss", color.red, 2, plot.style_linebr)
plot(strategy.position_size > 0 ? buyTargetPrice : na, "Buy Target", color.green, 2, plot.style_linebr)
// Plot stop loss and target levels for sell trades
plot(strategy.position_size < 0 ? sellStopLoss : na, "Sell Stop Loss", color.red, 2, plot.style_linebr)
plot(strategy.position_size < 0 ? sellTargetPrice : na, "Sell Target", color.green, 2, plot.style_linebr)