
یہ حکمت عملی ایک ٹریڈنگ سسٹم ہے جو 14 دوروں کی انڈیکس کی حرکت پذیری اوسط ((EMA) پر مبنی ہے ، جس میں فاریکس چارٹ کی شکل تجزیہ اور قیمت کی نقل و حرکت کی خصوصیات کو یکجا کیا گیا ہے۔ حکمت عملی قیمتوں اور EMA کے کراس تعلقات کا تجزیہ کرکے ، اور فاریکس چارٹ کی شکل کی خصوصیات کو بھی مدنظر رکھتے ہوئے (جیسے جسم اور سائے کی لائن کا تناسب) ٹریڈنگ سگنل کی نشاندہی کرتی ہے ، تاکہ مارکیٹ کے رجحانات میں تبدیلی کے مقامات کو پکڑ سکے۔
حکمت عملی کی بنیادی منطق درج ذیل کلیدی عناصر پر مبنی ہے:
اس حکمت عملی نے ای ایم اے ، چارٹ پیٹرن اور قیمتوں کے رویے کے تجزیے کو مربوط طور پر استعمال کرکے ایک مکمل تجارتی نظام تشکیل دیا ہے۔ حکمت عملی کی طاقت سگنل کی تصدیق کی سختی اور خطرے کے کنٹرول کی مکملیت میں ہے ، لیکن اس حکمت عملی کی کارکردگی پر مارکیٹ کے ماحول کے اثرات کو بھی دھیان میں رکھنے کی ضرورت ہے۔ تجویز کردہ اصلاحی سمت کے ذریعہ ، حکمت عملی کی استحکام اور موافقت کو مزید فروغ دینے کی امید ہے۔
/*backtest
start: 2024-11-19 00:00:00
end: 2024-12-18 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Buy and Sell Signals with EMA", overlay=true)
// Define the 14-period EMA
ema14 = ta.ema(close, 14)
// --- Buy Conditions ---
ema_length = input.int(14, title="EMA Length")
// Calculate the 14 EMA
ema_14 = ta.ema(close, ema_length)
// Calculate the candle body and wicks
body = close - open
upper_wick = high - close
lower_wick = open - low
total_candle_length = high - low
// Define the condition for the candle to be green (bullish)
is_green_candle = close > open
// Condition for crossing the 14 EMA (previous close was below, current close is above)
crossing_ema = ta.crossover(close, ema_14)
// Condition for at least 50% of the candle's body crossing the 14 EMA
body_crossed_ema = (close - open) * 0.5 <= (close - ema_14) and close > ema_14
// Condition for wick percent being less than or equal to 40% of the total candle length
wick_percent = (upper_wick + lower_wick) / total_candle_length
valid_wick_condition = wick_percent <= 0.4
// Define the buy condition
buy_condition = is_green_candle and crossing_ema and body_crossed_ema and valid_wick_condition
// --- Sell Conditions ---
candleIsRed = close < open
priceBelowEMA = close < ema14
prevLowAboveEMA = low[1] > ema14[1] // Previous candle's low must be above the EMA
wickTooLarge = (low - math.min(open, close)) / (high - low) <= 0.2 // Lower wick should not exceed 20%
// Sell signal condition
sellSignal = priceBelowEMA and candleIsRed and prevLowAboveEMA and wickTooLarge
// --- Plotting ---
plot(ema14, color=color.blue, linewidth=2, title="14-period EMA") // Plot the 14-period EMA
// Plot the buy signal as an arrow on the chart
plotshape(buy_condition, color=color.green, style=shape.labelup, location=location.belowbar, text="BUY")
// Plot the sell signal as an arrow on the chart
plotshape(sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")
// Optional: Add strategies for backtesting
if (buy_condition)
strategy.entry("Buy", strategy.long)
if (sellSignal)
strategy.entry("Sell", strategy.short)