
اس حکمت عملی میں 5 دن کی متحرک اوسط چینل اور واک تھریڈ کے خرید و فروخت کے مقامات شامل ہیں ، جس سے چینل کے توڑ اور شارٹ لائن ٹریڈنگ کا دوہری کام انجام دیا جاتا ہے۔ حکمت عملی پہلے 5 دن کی اعلی اور کم کی متحرک اوسط کو چینل کے اوپر اور نیچے کے راستے کے طور پر شمار کرتی ہے ، اور پھر چینل کے توڑ کے اشارے اور واک تھریڈ کی شکل کی خصوصیات کے ساتھ مل کر انٹری اور آؤٹ ٹائمنگ کا فیصلہ کرتی ہے۔
اس حکمت عملی کے مجموعی طور پر چینل توڑنے کی حکمت عملی اور چلنے کے تصور کی مختصر لائن ٹریڈنگ کی حکمت عملی کا استعمال کیا گیا ہے ، جس سے متعدد سطح کے فیصلے اور خطرے پر قابو پایا جاسکتا ہے۔ بہتر ہونے کے بعد بہتر حکمت عملی کی کارکردگی کی توقع کی جاسکتی ہے۔ یہ نوٹ کرنا ضروری ہے کہ پیرامیٹرز کی ترتیب اور خطرے پر قابو پانے سے حکمت عملی کے اثر و رسوخ پر اہم اثر پڑتا ہے ، جس کی اچھی طرح سے جانچ اور توثیق کی ضرورت ہے۔
/*backtest
start: 2023-01-29 00:00:00
end: 2024-02-04 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("5MABAND + Mileage Concept Buy & Sell Strategy", overlay=true)
// Command 1 - 5MABAND Calculation
length = input(5, title="Number of Candles for Average")
avgHigh = ta.sma(high, length)
avgLow = ta.sma(low, length)
// Plotting 5MABAND Bands
plot(avgHigh, color=color.green, title="5MABAND High Line", linewidth=2)
plot(avgLow, color=color.red, title="5MABAND Low Line", linewidth=2)
// Command 2 - Mileage Concept Buy Entry
mileageBuyCondition = close > open and high - close < close - open and open - low < close - open and close - open > close[1] - open[1] and close - open > close[2] - open[2] and close - open > close[3] - open[3] and close > open and open > close[1]
// Command 3 - Mileage Concept Sell Entry
mileageSellCondition = open - close > open[1] - close[1] and open - close > open[2] - close[2] and open - close > open[3] - close[3] and open > close and close > open[1] and close > avgHigh
// Command 4 - 5MABAND Buy Entry
buyAlertCandle_5MABAND = close > avgHigh
plotshape(buyAlertCandle_5MABAND, color=color.green, style=shape.triangleup, location=location.belowbar, size=size.small, title="Buy Signal (5MABAND)")
// Command 5 - 5MABAND Sell Entry
sellAlertCandle_5MABAND = close < avgLow
plotshape(sellAlertCandle_5MABAND, color=color.red, style=shape.triangledown, location=location.abovebar, size=size.small, title="Sell Signal (5MABAND)")
// Command 6 - 5MABAND Exit Trigger
exitTriggerCandle_5MABAND_Buy = low < avgLow
exitTriggerCandle_5MABAND_Sell = high > avgHigh
// Exit Signals for 5MABAND
exitBuySignal_5MABAND = close < avgLow
exitSellSignal_5MABAND = close > avgHigh
// Buy and Sell Conditions for 5MABAND
buyCondition_5MABAND = close > avgHigh and buyAlertCandle_5MABAND
sellCondition_5MABAND = close < avgLow and (exitTriggerCandle_5MABAND_Buy or exitSellSignal_5MABAND)
// Combine Buy Conditions for Mileage Concept and 5MABAND
combinedBuyCondition = mileageBuyCondition and buyCondition_5MABAND
combinedSellCondition = mileageSellCondition and sellCondition_5MABAND
// Execute Buy and Sell Orders
strategy.entry("Buy", strategy.long, when = combinedBuyCondition)
strategy.close("Buy", when = sellCondition_5MABAND)
strategy.entry("Sell", strategy.short, when = combinedSellCondition)
strategy.close("Sell", when = exitBuySignal_5MABAND)
// Exit Buy and Sell Orders for 5MABAND
strategy.close("Buy", when = exitBuySignal_5MABAND)
strategy.close("Sell", when = exitSellSignal_5MABAND)