
سپر ٹرینڈ اور ای ایم اے کا مجموعہ حکمت عملی ایک تجارتی حکمت عملی ہے جس میں سپر ٹرینڈ اشارے اور متعدد ای ایم اے اشارے کا استعمال کیا جاتا ہے۔ یہ حکمت عملی موجودہ مارکیٹ کی رجحان کی سمت کا فیصلہ کرنے کے لئے سپر ٹرینڈ اشارے کا استعمال کرتی ہے ، جبکہ مختلف دورانیے کے ای ایم اے اشارے کو خرید و فروخت کے سگنل کے طور پر استعمال کرتی ہے۔ جب قلیل مدتی ای ایم اے اور درمیانی مدت ای ایم اے میں فورک ہوتا ہے اور سپر ٹرینڈ اشارے اوپر کی طرف رجحان دکھاتا ہے تو ، خریدنے کا اشارہ ہوتا ہے۔ جب قلیل مدتی ای ایم اے اور درمیانی مدت ای ایم اے میں مورچا ہوتا ہے اور سپر ٹرینڈ اشارے نیچے کی طرف رجحان دکھاتا ہے تو ، فروخت کا اشارہ ہوتا ہے۔
سپر ٹرینڈ اور ای ایم اے کی مجموعی حکمت عملی کا بنیادی اصول یہ ہے کہ سپر ٹرینڈ اشارے اور ای ایم اے اشارے کی خصوصیات کا استعمال کرکے مارکیٹ میں رجحان کی تبدیلیوں اور قیمت کے اتار چڑھاؤ کو پکڑیں۔ سپر ٹرینڈ اشارے موجودہ مارکیٹ کی سمت کا فیصلہ کرتے ہوئے موجودہ مارکیٹ کی سمت کا فیصلہ کرتے ہیں۔ جب بند ہونے والی قیمت پچھلے دور کے اوپر اور نیچے کی سمت سے ٹکرا جاتی ہے تو ، اس سے ظاہر ہوتا ہے کہ مارکیٹ اوپر کی طرف بڑھ رہی ہے۔ جب بند ہونے والی قیمت نیچے کی طرف گرتی ہے تو ، اس سے ظاہر ہوتا ہے کہ مارکیٹ نیچے کی طرف بڑھ رہی ہے۔
سپر ٹرینڈ اور ای ایم اے کی مجموعی حکمت عملی سپر ٹرینڈ اشارے کو متعدد ای ایم اے اشارے کے ساتھ جوڑ کر ایک مکمل ٹرینڈ ٹریکنگ سسٹم تشکیل دیتی ہے۔ یہ حکمت عملی سپر ٹرینڈ اشارے کا استعمال کرکے مارکیٹ کے رجحانات کا فیصلہ کرتی ہے ، جبکہ ای ایم اے اشارے کے کراسنگ کی صورت حال سے خرید و فروخت کے اشارے پیدا کرتی ہے ، جس میں رجحانات کی پیروی کرنے کی طاقت ، سگنل کی تصدیق کی قابل اعتماد ، اور موافقت کی وسیع صلاحیت وغیرہ ہیں۔ تاہم ، حکمت عملی کو پیرامیٹرز کی اصلاح ، مارکیٹ میں اتار چڑھاؤ اور رجحان کی تبدیلی جیسے خطرات کا بھی سامنا کرنا پڑتا ہے ، حکمت عملی کی استحکام اور منافع بخش صلاحیت کو بڑھانے کے لئے پیرامیٹرز کی اصلاح ، سگنل فلٹرنگ ، اسٹاپ لاسٹ اسٹاپ اور کثیر نوعیت کے متعدد دوروں کے ذریعہ اصلاح اور بہتری کی ضرورت ہے۔
/*backtest
start: 2023-06-01 00:00:00
end: 2024-06-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Supertrend EMA Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Supertrend Parameters
atrPeriod = input(10, title="ATR Period")
src = input(hl2, title="Source")
multiplier = input(3.0, title="ATR Multiplier", step=0.1)
changeATR = input(true, title="Change ATR Calculation Method?")
showSignals = input(true, title="Show Buy/Sell Signals?")
highlighting = input(true, title="Highlighter On/Off?")
// Calculate ATR
atr = changeATR ? atr(atrPeriod) : sma(tr, atrPeriod)
// Calculate Supertrend
up = src - (multiplier * atr)
dn = src + (multiplier * atr)
up1 = nz(up[1], up)
dn1 = nz(dn[1], dn)
up := close[1] > up1 ? max(up, up1) : up
dn := close[1] < dn1 ? min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
// Plot Supertrend
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
// EMA Parameters
shortEmaLength = input(20, title="Short EMA Length")
mediumEmaLength = input(50, title="Medium EMA Length")
longEmaLength = input(100, title="Long EMA Length")
longestEmaLength = input(200, title="Longest EMA Length")
// Calculate EMA
shortEma = ema(close, shortEmaLength)
mediumEma = ema(close, mediumEmaLength)
longEma = ema(close, longEmaLength)
longestEma = ema(close, longestEmaLength)
// Plot EMA
plot(shortEma, color=color.red, title="EMA 20")
plot(mediumEma, color=color.orange, title="EMA 50")
plot(longEma, color=color.aqua, title="EMA 100")
plot(longestEma, color=color.blue, title="EMA 200")
// Define Buy and Sell Conditions
buyCondition = crossover(shortEma, mediumEma) and trend == 1
sellCondition = crossunder(shortEma, mediumEma) and trend == -1
// Plot Buy/Sell Signals
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Add Text Labels for Buy and Sell Signals
if (buyCondition)
label.new(bar_index, high, text="Buy", color=color.green, textcolor=color.white, style=label.style_label_up, yloc=yloc.abovebar)
if (sellCondition)
label.new(bar_index, low, text="Sell", color=color.red, textcolor=color.white, style=label.style_label_down, yloc=yloc.belowbar)
// Strategy Entry and Exit
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.close("Buy")
// Highlight Trend
longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white
shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white
fill(plot(ohlc4, title="", style=plot.style_circles, linewidth=0), upPlot, title="UpTrend Highlighter", color=longFillColor)
fill(plot(ohlc4, title="", style=plot.style_circles, linewidth=0), dnPlot, title="DownTrend Highlighter", color=shortFillColor)
// Alerts
alertcondition(buyCondition, title="Buy Alert", message="Supertrend EMA Buy Signal")
alertcondition(sellCondition, title="Sell Alert", message="Supertrend EMA Sell Signal")