
یہ حکمت عملی ڈبل موونگ ایوریج کراس اوور سگنلز پر مبنی ایک ڈائنامک ٹرینڈ ٹریکنگ سسٹم ہے جو قلیل مدتی 20 دن کے ایکسپونیشل موونگ ایوریج (EMA) اور طویل مدتی 50 دن کے ایکسپونیشل موونگ ایوریج کے ذریعے مارکیٹ کے رجحان کی تبدیلیوں کی نشاندہی کرتی ہے۔ EMA)، اور خود بخود خرید و فروخت کی کارروائیوں کو انجام دیتا ہے۔ حکمت عملی ایک بالغ تکنیکی تجزیہ کا طریقہ اپناتی ہے، جو رجحان سے باخبر رہنے اور متحرک پوزیشن مینجمنٹ کی خصوصیات کو یکجا کرتی ہے، اور زیادہ اتار چڑھاؤ کے ساتھ مارکیٹ کے ماحول کے لیے موزوں ہے۔
حکمت عملی کی بنیادی منطق درج ذیل کلیدی عناصر پر مبنی ہے:
یہ حکمت عملی ایک کلاسک ٹرینڈ ٹریکنگ سسٹم کا جدید نفاذ ہے جس میں پروگرامیٹک ٹریڈنگ کے ذریعے روایتی ڈبل موونگ ایوریج کراس اوور کی حکمت عملی کو منظم اور معیاری بنایا گیا ہے۔ اگرچہ کچھ موروثی خطرات ہیں، لیکن مسلسل اصلاح اور بہتری کے ذریعے حکمت عملی کے اچھے اطلاق کے امکانات ہیں۔ حقیقی استعمال سے پہلے کافی پیرامیٹر کی اصلاح اور بیک ٹیسٹنگ کی تصدیق کرنے کی سفارش کی جاتی ہے۔
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover Buy/Sell Signals", overlay=true)
// Input parameters for EMAs
emaShortLength = input.int(20, title="Short EMA Length")
emaLongLength = input.int(50, title="Long EMA Length")
// Calculating EMAs
emaShort = ta.ema(close, emaShortLength)
emaLong = ta.ema(close, emaLongLength)
// Plotting EMA crossover lines
plot(emaShort, color=color.green, title="20 EMA")
plot(emaLong, color=color.red, title="50 EMA")
// Buy and Sell signal logic
longCondition = ta.crossover(emaShort, emaLong)
exitLongCondition = ta.crossunder(emaShort, emaLong)
shortCondition = ta.crossunder(emaShort, emaLong)
exitShortCondition = ta.crossover(emaShort, emaLong)
// Plot buy and sell signals on the chart
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal")
plotshape(series=exitLongCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Exit")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal")
plotshape(series=exitShortCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Exit")
// Backtesting strategy logic
var float entryPrice = na
var int position = 0 // 1 for long, -1 for short, 0 for no position
if (longCondition and position == 0)
entryPrice := close
position := 1
if (shortCondition and position == 0)
entryPrice := close
position := -1
if (exitLongCondition and position == 1)
strategy.exit("Exit Long", from_entry="Long", limit=close)
position := 0
if (exitShortCondition and position == -1)
strategy.exit("Exit Short", from_entry="Short", limit=close)
position := 0
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)