
یہ حکمت عملی ای ایم اے کی تین مختلف ادوار کی اوسط پر مبنی ہے ، اس بات کا تعین کرنے کے لئے کہ آیا قیمت ای ایم اے کی اوسط سے اوپر ہے یا نہیں ، موجودہ رجحان کی سمت کا تعین کرنے کے لئے۔ جب قلیل مدتی ای ایم اے لائن طویل مدتی ای ایم اے لائن کو عبور کرتی ہے تو خریدنے کا اشارہ پیدا کرتی ہے۔ جب قلیل مدتی ای ایم اے لائن طویل مدتی ای ایم اے لائن کو عبور کرتی ہے تو فروخت کا اشارہ پیدا کرتی ہے۔ یہ حکمت عملی رجحان کی پیروی کرتی ہے اور جب رجحان بدل جاتا ہے تو بروقت صفائی کرتی ہے۔
اس حکمت عملی میں تین EMA اوسط استعمال کیے جاتے ہیں ، 10 دن کی لائن ، 20 دن کی لائن اور 50 دن کی لائن۔ اس کا فیصلہ کرنے کا قاعدہ یہ ہے:
جب 10 ویں ای ایم اے لائن اور 20 ویں ای ایم اے لائن دونوں 50 ویں ای ایم اے لائن کے اوپر ہوتی ہیں تو ، اس کو اوپر کی طرف جانے کے رجحان کے طور پر بیان کیا جاتا ہے۔
جب 10 ویں ای ایم اے لائن اور 20 ویں ای ایم اے لائن دونوں 50 ویں ای ایم اے لائن سے نیچے ہوں تو ، اس کو نیچے کی طرف جانے والے رجحان کے طور پر بیان کیا گیا ہے۔
خریدنے کا اشارہ پیدا ہوتا ہے جب طویل مدتی ای ایم اے لائن (50 دن کی لائن) کو مختصر ای ایم اے لائن (10 دن کی لائن اور 20 دن کی لائن) پر پار کیا جاتا ہے۔
ایک فروخت سگنل پیدا ہوتا ہے جب ایک طویل ای ایم اے لائن (10 دن کی لائن اور 20 دن کی لائن) طویل ای ایم اے لائن (50 دن کی لائن) کے نیچے ہوتا ہے۔
بڑھتے ہوئے رجحان کے دوران ایک سے زیادہ پوزیشنوں پر قبضہ، گرنے کے رجحان کے دوران خالی پوزیشنوں پر قبضہ؛
جب رجحان بدل جاتا ہے تو ((EMA مختصر لائن اور طویل لائن کے ساتھ ٹرانسمیشن ہوتا ہے) موجودہ سگنل کی سمت کی پوزیشنوں کو ختم کرتا ہے.
اس حکمت عملی کے ذریعے کیپچر منافع، بروقت خالی پوزیشنوں کی طرف سے منافع کو لاک کرنے کے طریقے سے باری باری کثیر فضائی آپریشن.
یہ حکمت عملی مندرجہ ذیل فوائد رکھتی ہے:
اس حکمت عملی کے کچھ خطرات بھی ہیں:
مندرجہ بالا خطرات کو مندرجہ ذیل طریقوں سے بہتر بنایا جاسکتا ہے:
اس حکمت عملی کو مندرجہ ذیل طریقوں سے بہتر بنایا جاسکتا ہے:
پیرامیٹرز کی اصلاح۔ مختلف ای ایم اے دوروں کے پیرامیٹرز کے مجموعے کو جانچنے کے لئے بہترین پیرامیٹرز تلاش کریں۔
ٹرانزیکشن لاگت کو بہتر بنائیں۔ غیر ضروری بار بار تجارت کو کم کرنے کے لئے پوزیشن کھولنے کے قواعد کو مناسب طریقے سے بہتر بنائیں۔
نقصان کی روک تھام کی حکمت عملی کو بہتر بنانا۔ مناسب نقصان کی روک تھام کی سطح کا تعین کریں اور انفرادی نقصان کو کنٹرول کریں۔
دوسرے اشارے کے ساتھ مل کر │ MACD ، KDJ اور دیگر دیگر اشارے کا استعمال معاون فیصلے ، داخلے کے وقت کو بہتر بنائیں │
یہ حکمت عملی مجموعی طور پر آسان اور عملی ہے۔ یہ ای ایم اے کا استعمال کرتے ہوئے رجحان کی سمت کا تعین کرتی ہے ، مناسب اسٹاپ اسٹریٹجی کے ساتھ ، جو خطرے کو مؤثر طریقے سے کنٹرول کرسکتی ہے۔ اس کے ساتھ ہی کچھ اصلاح کی گنجائش بھی موجود ہے ، اگر اس حکمت عملی کی تاثیر کو پیرامیٹرز کی اصلاح ، اسٹاپ اسٹریٹجی ، دیگر اشارے وغیرہ کے ساتھ ملایا جائے تو اس میں بہت زیادہ اضافہ کرنے کی گنجائش ہے۔
/*backtest
start: 2024-01-28 00:00:00
end: 2024-01-31 04:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mattehalen
//@version=4
//study("EMA 10,20 59",overlay=true)
strategy("EMA 10,20 59",overlay=true)
infoBox = input(true, title="infoBox", type=input.bool)
infoBox2 = input(false, title="infoBox2", type=input.bool)
BuySellSignal_Bool = input(false, title="Buy & SellSignal", type=input.bool)
infoBoxSize = input(title="infoBoxSize", defval=size.large, options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge])
ema1Value = input(10)
ema2Value = input(20)
ema3Value = input(59)
maxLoss = input(3000)
ema1 = ema(close,ema1Value)
ema2 = ema(close,ema2Value)
ema3 = ema(close,ema3Value)
objcnt = 0
buyTitle = tostring(close[1])
myProfit = float(0)
plot(ema1,title="ema1",color=color.red,linewidth=2)
plot(ema2,title="ema2",color=color.green,linewidth=2)
plot(ema3,title="ema3",color=color.black,linewidth=2)
Buytrend = (ema1 and ema2 > ema3) and (ema1[1] and ema2[1] > ema3[1])
BarssinceBuyTrend = barssince(Buytrend)
BarssinceSellTrend = barssince(not Buytrend)
closeAtBuyTrend = close[1]
bgcolor(Buytrend ? color.green : color.red,transp=70)
BuySignal = Buytrend and not Buytrend[1] and BuySellSignal_Bool
BuySignalOut = Buytrend and (crossunder(ema1,ema2)) and BuySellSignal_Bool
BarssinceBuy = barssince(BuySignal)
bgcolor(BuySignal ? color.green : na , transp=30)
bgcolor(BuySignalOut ? color.black : na , transp=30)
plot(BarssinceBuy,title="BarssinceBuy",display=display.none)
SellSignal = not Buytrend and Buytrend[1] and BuySellSignal_Bool
SellSignalOut = not Buytrend and (crossover(ema1,ema2)) and BuySellSignal_Bool
BarssinceSell = barssince(SellSignal)
bgcolor(SellSignal ? color.red : na , transp=30)
bgcolor(SellSignalOut ? color.black : na , transp=30)
plot(BarssinceSell,title="BarssinceSell",display=display.none)
buyProfit = float(0)
cntBuy =0
sellProfit = float(0)
cntSell =0
buyProfit := Buytrend and not Buytrend[1]? nz(buyProfit[1]) + (close[BarssinceBuyTrend[1]]-close) : nz(buyProfit[1])
cntBuy := Buytrend and not Buytrend[1]? nz(cntBuy[1]) + 1: nz(cntBuy[1])
sellProfit := not Buytrend and Buytrend[1]? nz(sellProfit[1]) + (close-close[BarssinceSellTrend[1]]) : nz(sellProfit[1])
cntSell := not Buytrend and Buytrend[1]? nz(cntSell[1]) + 1 : nz(cntSell[1])
totalProfit = buyProfit + sellProfit
// if (Buytrend and not Buytrend[1] and infoBox==true)
// l = label.new(bar_index - (BarssinceBuyTrend[1]/2), na,text="Close = " + tostring(close) + "\n" + "Start = "+tostring(close[BarssinceBuyTrend[1]]) + "\n" + "Profit = "+tostring(close[BarssinceBuyTrend[1]]-close) ,style=label.style_labelup, yloc=yloc.belowbar,color=color.red,size=infoBoxSize)
// if (not Buytrend and Buytrend[1] and infoBox==true)
// l = label.new(bar_index - (BarssinceSellTrend[1]/2), na,text="Close = " + tostring(close) + "\n" + "Start = "+tostring(close[BarssinceSellTrend[1]]) + "\n" + "Profit = "+tostring(close-close[BarssinceSellTrend[1]]) ,style=label.style_labeldown, yloc=yloc.abovebar,color=color.green,size=infoBoxSize)
// if (BuySignalOut and not BuySignalOut[1] and infoBox2==true)
// // l = label.new(bar_index - (BarssinceBuy[0]/2), na,text="Close = " + tostring(close) + "\n" + "Start = "+tostring(close[BarssinceBuy[0]]) + "\n" + "Profit = "+tostring(close-close[BarssinceBuy[0]]) ,style=label.style_labelup, yloc=yloc.belowbar,color=color.purple,size=infoBoxSize
// l = label.new(bar_index, na,text="Close = " + tostring(close) + "\n" + "Start = "+tostring(close[BarssinceBuy[0]]) + "\n" + "Profit = "+tostring(close-close[BarssinceBuy[0]]) ,style=label.style_labelup, yloc=yloc.belowbar,color=color.lime,size=infoBoxSize)
// if (SellSignalOut and not SellSignalOut[1] and infoBox2==true)
// // l = label.new(bar_index - (BarssinceSell[0]/2), na,text="Close = " + tostring(close) + "\n" + "Start = "+tostring(close[BarssinceSell[0]]) + "\n" + "Profit = "+tostring(close[BarssinceSell[0]]-close) ,style=label.style_labeldown, yloc=yloc.abovebar,color=color.purple,size=infoBoxSize)
// l = label.new(bar_index, na,text="Close = " + tostring(close) + "\n" + "Start = "+tostring(close[BarssinceSell[0]]) + "\n" + "Profit = "+tostring(close[BarssinceSell[0]]-close) ,style=label.style_labeldown, yloc=yloc.abovebar,color=color.fuchsia,size=infoBoxSize)
// l2 = label.new(bar_index, na, 'buyProfit in pip = '+tostring(buyProfit)+"\n"+ 'cntBuy = '+tostring(cntBuy) +"\n"+ 'sellProfit in pip = '+tostring(sellProfit)+"\n"+ 'cntSell = '+tostring(cntSell) +"\n"+ 'totalProfit in pip = '+tostring(totalProfit) ,
// color=totalProfit>0 ? color.green : color.red,
// textcolor=color.white,
// style=label.style_labeldown, yloc=yloc.abovebar,
// size=size.large)
// label.delete(l2[1])
//--------------------------------------------------
//--------------------------------------------------
if (Buytrend)
strategy.close("short", comment = "Exit short")
strategy.entry("long", true)
strategy.exit("Max Loss", "long", loss = maxLoss)
//if BuySignalOut
// strategy.close("long", comment = "Exit Long")
if (not Buytrend)
// Enter trade and issue exit order on max loss.
strategy.close("long", comment = "Exit Long")
strategy.entry("short", false)
strategy.exit("Max Loss", "short", loss = maxLoss)
//if SellSignalOut
// Force trade exit.
//strategy.close("short", comment = "Exit short")
//--------------------------------------------------
//--------------------------------------------------
//--------------------------------------------------