حکمت عملی کے بعد رفتار کا رجحان


تخلیق کی تاریخ: 2023-11-07 16:49:49 آخر میں ترمیم کریں: 2023-11-07 16:49:49
کاپی: 0 کلکس کی تعداد: 650
1
پر توجہ دیں
1617
پیروکار

حکمت عملی کے بعد رفتار کا رجحان

جائزہ

اس حکمت عملی میں ٹریڈنگ کے رجحانات کا تجزیہ کیا گیا ہے اور ٹریڈنگ کے رجحانات کی نشاندہی کی گئی ہے.

حکمت عملی کا اصول

  1. ای ایم اے کی اوسط اوسط قیمت اور تجارت کی اوسط اوسط اوسط قیمت کا حساب لگائیں
  2. جب EMA کو قریب سے پہنا جائے تو اس کو اوپر کی طرف جانے کا رجحان سمجھا جاتا ہے ، کثیر سر آپریشن کیا جاتا ہے
  3. جب یہ بڑھتا رہتا ہے تو ، قریب ہونے پر جمع EMA کی دوگنی اوسط لائن کو عبور کرتے وقت اضافی پوزیشن شامل کریں
  4. RSI اشارے کو ترتیب دیں اور جب RSI 90 سے زیادہ ہو تو 1 / 3 پوزیشنوں کو ختم کردیں
  5. جب ای ایم اے کے نیچے بند ہوجائیں تو اسے نیچے کی طرف جانے کا رجحان سمجھا جاتا ہے ، اور تمام اوور ہیڈ پوزیشنوں کو ختم کردیا جاتا ہے
  6. جب EMA سے نیچے قریب ہو تو ، نیچے کی طرف جانے کا فیصلہ کریں ، اور آپریشن کریں
  7. ایک سٹاپ نقصان کی لائن مقرر کریں، سٹاپ نقصان کی قیمت میں داخل ہونے کی ایک مقررہ فی صد کے طور پر
  8. خالی سر منافع کے لئے ایک ہی طریقہ ہے

طاقت کا تجزیہ

اس حکمت عملی کے اہم فوائد یہ ہیں:

  1. ای ایم اے اوسط سے رجحانات کا اندازہ لگانا ، رجحانات کو مؤثر طریقے سے ٹریک کرنا
  2. حقیقی رجحانات کا اندازہ لگانے کے لئے ٹرانزیکشن کی مقدار کا مجموعی EMA استعمال کریں
  3. RSI کی رفتار کی پیمائش کرنے کے لئے منافع بخش
  4. خطرے پر قابو پانے کے لئے ایک سٹاپ نقصان لائن
  5. مختلف حالات کے مطابق، لچکدار ایڈجسٹمنٹ پیرامیٹرز

خطرے کا تجزیہ

اس حکمت عملی کے اہم خطرات یہ ہیں:

  1. ای ایم اے اوسط لائن میں تاخیر پیدا ہوتی ہے ، ممکنہ طور پر موڑ کا نقطہ نظر سے محروم ہوجاتا ہے
  2. ٹرانزیکشن کی تعداد حقیقی رجحانات کی عکاسی نہیں کرتی
  3. فکسڈ فیصد سٹاپ نقصان بہت زیادہ میکانائزڈ ہوسکتا ہے
  4. پیرامیٹرز بہت زیادہ ہیں، ان کو ایڈجسٹ کرنا بہت مشکل ہے
  5. ٹرانزیکشن کی کثرت اور ٹرانزیکشن فیس کی زیادہ لاگت

خطرے سے نمٹنے کے طریقے:

  1. ای ایم اے پیرامیٹرز کو بہتر بنائیں اور تاخیر کو کم کریں
  2. دوسرے اشارے کے ساتھ مل کر ٹرانزیکشن سگنل کی تصدیق کریں
  3. مارکیٹ کے حالات کے مطابق سٹاپ نقصان کو بہتر بنائیں
  4. صرف بنیادی ترتیبات کو برقرار رکھنے کے لئے پیرامیٹرز کو آسان بنائیں
  5. اسٹاپ نقصان کی حد اور ٹریڈنگ کی فریکوئنسی میں مناسب نرمی

اصلاح کی سمت

اس حکمت عملی کو مندرجہ ذیل پہلوؤں سے بہتر بنایا جاسکتا ہے:

  1. مختلف EMA پیرامیٹرز کی ترتیبات کو آزمائیں اور بہترین پیرامیٹرز کا مجموعہ تلاش کریں
  2. VOLUME ضرب کو بڑھانے کے طور پر آنے والے سگنل کی طاقت کا فیصلہ
  3. ایم اے سی ڈی ، کے ڈی اور دیگر اشارے کے ساتھ مل کر داخلے کی تصدیق
  4. مخصوص اسٹاک کی خصوصیات کے مطابق اسٹاپ نقصان کے فیصد کو بہتر بنانا
  5. ٹرانزیکشن فریکوئنسی کو بہتر بنانا اور ٹرانزیکشن فیس کو کم کرنا

خلاصہ کریں۔

یہ حکمت عملی مجموعی طور پر ایک مساوی لائن نظام پر مبنی رجحان کی پیروی کرنے والی حکمت عملی ہے۔ مرکزی خیال یہ ہے کہ ای ایم اے کا استعمال رجحان کی سمت کا تعین کرنے کے لئے کیا جائے ، اور اس کی تصدیق کے لئے حجم کی حرکیات کے اشارے کے ساتھ کام کیا جائے۔ پیرامیٹرز کی اصلاح کے ذریعہ مسلسل اصلاح کی جاسکتی ہے ، اور دیگر اشارے کی مزید تصدیق میں معاون ہے۔ مجموعی طور پر ایک لچکدار رجحان کی پیروی کرنے والی حکمت عملی ہے ، جو مہارت سے استعمال ہونے پر اچھی واپسی حاصل کرسکتی ہے۔

حکمت عملی کا ماخذ کوڈ
/*backtest
start: 2023-10-30 00:00:00
end: 2023-11-06 00:00:00
period: 5m
basePeriod: 1m
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/
// © mohanee

//@version=4
strategy("EMA_cumulativeVolume_crossover[Strategy]", overlay=true, pyramiding=5, default_qty_type=strategy.percent_of_equity,  default_qty_value=20, initial_capital=10000)


emaLength= input(25, title="EMA Length", minval=1, maxval=200)
cumulativePeriod = input(100,  title="cumulative volume Period", minval=1, maxval=200)


riskCapital = input(title="Risk % of capital", defval=10, minval=1)
stopLoss=input(8,title="Stop Loss",minval=1)
takePartialProfits=input(true, title="take partial profits  (percentage same as stop loss)")

tradeDirection=input(title="Trade Direction", defval="LONG", options=["LONG", "SHORT"])

avgPrice = (high + low + close) / 3
avgPriceVolume = avgPrice * volume

cumulPriceVolume = sum(avgPriceVolume, cumulativePeriod)
cumulVolume = sum(volume, cumulativePeriod)

cumValue = cumulPriceVolume / cumulVolume

emaVal=ema(close, emaLength)

emaCumValue1=ema(cumValue, emaLength)
emaCumValue2=ema(cumValue, emaLength*2)

emaCumValueHistory=ema(cumValue[emaLength], emaLength)


//vwapVal1=vwap(hlc3)

rsiVal=rsi(close,5)

plotEma=plot(emaVal, title="EMA", color=color.green,  transp=25)
//plot(vwapValue, title="Cumulate Volumne", color=color.orange,  linewidth=2, transp=25)
//plot(vwapVal1, title="vwapVal1", color=color.purple,  linewidth=1, transp=25)
plotCum=plot(emaCumValue1, title="emaVwapValue", color=color.purple,  linewidth=2, transp=35)
plot(emaCumValue2, title="emaVwapValue", color=color.yellow,  linewidth=3, transp=25)
fill(plotEma,plotCum, color=emaVal>emaCumValue1 ? color.lime : color.red, transp=35, title="ema and cum area")

plot(emaCumValueHistory, title="emaCumValueHistory", color=color.black,  linewidth=2, transp=25)



//bgcolor(emaVal>vwapValue?color.blue:color.purple)    

//Entry--
//Echeck how many units can be purchased based on risk manage ment and stop loss
qty1 = (strategy.equity  * riskCapital / 100 ) /  (close*stopLoss/100)  

//check if cash is sufficient  to buy qty1  , if capital not available use the available capital only
qty1:= (qty1 * close >= strategy.equity ) ? (strategy.equity / close) : qty1

//strategy.entry(id="LE",comment="LE", long=true, qty=qty1, when=crossover(emaVal, vwapValue)  and (tradeDirection=="LONG") )    //emaVal>vwapValue and crossover(close , emaVal)

strategy.entry(id="LE",comment="LE", long=true, qty=qty1, when=strategy.position_size==0 and crossover(emaVal, emaCumValue1)  and (tradeDirection=="LONG") )    //emaVal>vwapValue and crossover(close , emaVal)

//re-entry
rentryCondition1=strategy.position_size>1 and emaVal > emaCumValue1 and emaCumValue1>emaCumValue2 and crossover(close, emaCumValue2) and close>open and  (tradeDirection=="LONG")
strategy.entry(id="LE",comment="LE RE", long=true, qty=qty1, when=rentryCondition1 )

rentryCondition2=strategy.position_size>1 and emaVal > emaCumValue1 and emaCumValue1>emaCumValueHistory and crossover(close, emaCumValueHistory) and close>open and  (tradeDirection=="LONG")
//strategy.entry(id="LE",comment="LE RE", long=true, qty=qty1, when=rentryCondition2 )    


//stoploss
stopLossVal=  strategy.position_size>=1 ?  (strategy.position_avg_price * (1-(stopLoss*0.01) )) : 0.00

//draw initil stop loss
//plot(strategy.position_size>=1 ? stopLossVal : na, color = color.purple , style=plot.style_linebr,  linewidth = 2, title = "stop loss")

//partial exits
takeProfit=  strategy.position_size>=1 ?  (strategy.position_avg_price * (1+(1*0.01) )) : ( close[1] * 2 )
//if(takePartialProfits==true)
    //strategy.close(id="LE", comment="Partial"+tostring(close-strategy.position_avg_price, "###.##") , qty=strategy.position_size/3 , when = (tradeDirection=="LONG" ) and close>takeProfit and crossunder(close, emaVal) )    //close<close[1] and close[1]<close[2] and close[2]<close[3])

strategy.close(id="LE", comment="PExit Points=>"+tostring(close-strategy.position_avg_price, "###.##") , qty=strategy.position_size/3 , when = (tradeDirection=="LONG" ) and  takePartialProfits == true and close>=takeProfit and crossunder(rsiVal,90) )

profitVal=    strategy.position_size>=1 ?  (strategy.position_avg_price * (1+(1*0.01) )) : ( close[1] * 2 )

//strategy.close(id="LE" , comment="LE Exit Points="+tostring(close-strategy.position_avg_price, "###.##"), when=crossunder(emaVal, vwapValue) and (tradeDirection=="LONG") )

strategy.close(id="LE" , comment="Exit Points=>"+tostring(close-strategy.position_avg_price, "###.##"), when=  crossunder(emaVal, emaCumValue1) and (tradeDirection=="LONG") )


strategy.close(id="LE" , comment="SL Exit Loss="+tostring(close-strategy.position_avg_price, "###.##"), when= close < stopLossVal   and (tradeDirection=="LONG") )


//for short  you dont have to wait crossodown of ema, falling is speed , so just check if close crossing down vwapVal
strategy.entry(id="SE",comment="SE", long=false, qty=qty1, when=crossunder(emaVal, emaCumValue1) and (tradeDirection=="SHORT") )    //emaVal>vwapValue and crossover(close , emaVal)


//stoploss
stopLossValUpside=  abs(strategy.position_size)>=1 and tradeDirection=="SHORT" ?  (strategy.position_avg_price * (1+(stopLoss*0.01) )) : 0.00

//draw initil stop loss
//plot(abs(strategy.position_size)>=1 and tradeDirection=="SHORT" ? stopLossValUpside : na, color = color.purple , style=plot.style_linebr,  linewidth = 2, title = "stop loss")

//partial exits
shortTakeProfit=  abs(strategy.position_size)>=1 and tradeDirection=="SHORT" ?  (strategy.position_avg_price * (1-(stopLoss*0.01) )) : 0.00
if(takePartialProfits==true)
    strategy.close(id="SE", comment="Partial" , qty=strategy.position_size/3 , when = (tradeDirection=="SHORT"   ) and  crossover(rsiVal,15) )  //close<takeProfit and (emaVal - close)>8 )
  
//strategy.close(id="SE" , comment="SE Exit Points="+tostring(close-strategy.position_avg_price, "###.##"), when=crossover(emaVal, vwapValue) and (tradeDirection=="SHORT") )
//strategy.close(id="SE" , comment="SE Exit Points="+tostring(close-strategy.position_avg_price, "###.##"), when= abs(strategy.position_size)>=1 and ( (emaVal<emaCumValue1 and close>emaCumValue1 and open>emaCumValue1 and close>open )   or (crossover(emaVal,emaCumValue1))  ) and (tradeDirection=="SHORT") )

//strategy.close(id="SE" , comment="SL Exit Loss="+tostring(close-strategy.position_avg_price, "###.##"), when= abs(strategy.position_size)>=1 and  close > stopLossValUpside   and (tradeDirection=="SHORT"   ) )
strategy.close(id="SE" , comment="SL Exit Loss="+tostring(close-strategy.position_avg_price, "###.##"), when= abs(strategy.position_size)>=1 and  crossover(emaVal, emaCumValue1)   and (tradeDirection=="SHORT"   ) )