
یہ حکمت عملی ایک کثیر اشارے ٹریڈنگ سسٹم ہے جس میں جی چینل ، انڈیکس منتقل اوسط ، ای ایم اے ، اور حقیقی اتار چڑھاؤ کی حد ، اے ٹی آر شامل ہے۔ یہ متحرک حمایت / مزاحمت کی سطح اور رجحان کی تصدیق کے ذریعہ تجارتی سگنل کی شناخت کرتا ہے ، اور اے ٹی آر پر مبنی اسٹاپ اور اسٹاپ کا استعمال کرتے ہوئے خطرے کا انتظام کرتا ہے۔ نظام کو قابل اعتماد اور خطرے پر قابو پانے پر توجہ دینے کے لئے ڈیزائن کیا گیا ہے ، جو تاجروں کے لئے موزوں ہے جو مستحکم تجارتی طریقہ تلاش کرتے ہیں۔
اس حکمت عملی کی بنیادی منطق مندرجہ ذیل اہم اجزاء پر مبنی ہے:
اس حکمت عملی نے متعدد پختہ تکنیکی اشارے کو جوڑ کر ایک مکمل تجارتی نظام تشکیل دیا ہے۔ نظام کی طاقت اس کے کثیر سطحی سگنل کی تصدیق کے طریقہ کار اور اتار چڑھاؤ پر مبنی رسک مینجمنٹ میں ہے ، لیکن پھر بھی اسے عملی استعمال میں مارکیٹ کی مخصوص خصوصیات کے مطابق بہتر بنانے کی ضرورت ہے۔ تجویز کردہ اصلاح کی سمت سے حکمت عملی کی استحکام اور موافقت کو مزید بڑھایا جاسکتا ہے۔
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-10 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("G-Channel with EMA Strategy and ATR SL/TP", shorttitle="G-EMA-ATR", overlay=true)
// Input parameters
length = input.int(100, title="G-Channel Length")
src = input.source(close, title="Source")
ema_length = input.int(50, title="EMA Length") // EMA length
atr_length = input.int(14, title="ATR Length") // ATR length
// G-Channel calculation
var float a = na
var float b = na
a := math.max(src, nz(a[1])) - nz(a[1] - b[1]) / length
b := math.min(src, nz(b[1])) + nz(a[1] - b[1]) / length
avg = (a + b) / 2
// G-Channel cross conditions
crossup = b[1] < close[1] and b > close
crossdn = a[1] < close[1] and a > close
bullish = ta.barssince(crossdn) <= ta.barssince(crossup)
c = bullish ? color.lime : color.red
// EMA calculation
ema_value = ta.ema(src, ema_length)
// ATR calculation
atr_value = ta.atr(atr_length)
// Plot G-Channel average and Close price
p1 = plot(avg, "G-Channel Average", color=c, linewidth=1, transp=90)
p2 = plot(close, "Close Price", color=c, linewidth=1, transp=100)
fill(p1, p2, color=c, transp=90)
// Plot EMA
plot(ema_value, color=color.blue, linewidth=2, title="EMA")
// Buy and Sell conditions
buy_condition = bullish and close < ema_value
sell_condition = not bullish and close > ema_value
// Track the last signal state
var bool last_was_buy = false
var bool last_was_sell = false
// ATR-based SL and TP calculations
long_sl = close - 2 * atr_value // 2 ATR below the entry for SL
long_tp = close + 4 * atr_value // 4 ATR above the entry for TP
short_sl = close + 2 * atr_value // 2 ATR above the entry for SL (short)
short_tp = close - 4 * atr_value // 4 ATR below the entry for TP (short)
// Generate Buy signal only if the last signal was not Buy
if (buy_condition and not last_was_buy)
strategy.entry("Buy", strategy.long)
strategy.exit("Exit Buy", from_entry="Buy", stop=long_sl, limit=long_tp)
last_was_buy := true
last_was_sell := false
// Generate Sell signal only if the last signal was not Sell
if (sell_condition and not last_was_sell)
strategy.entry("Sell", strategy.short)
strategy.exit("Exit Sell", from_entry="Sell", stop=short_sl, limit=short_tp)
last_was_sell := true
last_was_buy := false
// Plot shapes for Buy and Sell signals
plotshape(series=buy_condition and not last_was_buy, location=location.belowbar, style=shape.labelup, color=color.lime, size=size.small, text="Buy", textcolor=color.white)
plotshape(series=sell_condition and not last_was_sell, location=location.abovebar, style=shape.labeldown, color=color.red, size=size.small, text="Sell", textcolor=color.white)