آر ایس آئی متغیر اشارے کی حکمت عملی

مصنف:چاؤ ژانگ، تاریخ: 2024-01-25 11:49:36
ٹیگز:

img

جائزہ

آر ایس آئی ڈائیورجنسی اشارے کی حکمت عملی رشتہ دار طاقت انڈیکس (آر ایس آئی) اشارے پر مبنی ایک مقداری تجارتی حکمت عملی ہے۔ یہ آر ایس آئی اشارے اور قیمت کے مابین فرق کا تجزیہ کرکے رجحان کی تبدیلی کے مواقع کا پتہ لگاتا ہے ، جس کا مقصد کم خریدنا اور زیادہ فروخت کرنا ہے۔

حکمت عملی منطق

اس حکمت عملی کا بنیادی اشارے آر ایس آئی ہے۔ یہ آر ایس آئی اشارے اور قیمت کے مابین فرق کا تجزیہ کرتا ہے۔ نام نہاد فرق آر ایس آئی اور قیمت کے مابین مخالف سگنلز سے مراد ہے۔

خاص طور پر ، جب آر ایس آئی نسبتا lower کم کم ہوتا ہے جبکہ قیمت نسبتا higher اعلی کم ہوتی ہے تو ، یہ آر ایس آئی اور قیمت کے مابین ایک تیزی کا فرق ہے۔ اس کا مطلب یہ ہے کہ قیمت اوپر کی طرف الٹ سکتی ہے۔ اس وقت حکمت عملی ایک طویل پوزیشن قائم کرے گی۔

اس کے برعکس ، جب آر ایس آئی نسبتا higher زیادہ اونچائی بناتا ہے جبکہ قیمت نسبتا lower کم اونچائی بناتی ہے ، تو یہ آر ایس آئی اور قیمت کے مابین ایک bearish فرق ہے۔ اس کا مطلب یہ ہے کہ قیمت نیچے کی طرف الٹ سکتی ہے۔ اس وقت حکمت عملی ایک مختصر پوزیشن قائم کرے گی۔

آر ایس آئی اور قیمت کے درمیان ان اختلافات کو پکڑنے سے، حکمت عملی وقت پر قیمتوں میں تبدیلی کے مواقع کا پتہ لگاسکتی ہے اور کم خریدنے اور اعلی فروخت حاصل کرسکتی ہے۔

فوائد

RSI Divergence حکمت عملی مندرجہ ذیل فوائد ہیں:

  1. قیمتوں میں الٹ پوائنٹس پر قبضہ کرنے میں درست۔ آر ایس آئی اور قیمت کے مابین اختلافات کا مطلب اکثر آنے والے رجحان کی تبدیلی ہوتا ہے ، جو ایک بہت ہی موثر پیش گوئی سگنل ہے۔

  2. کم خریدنے اور زیادہ فروخت کرنے کے حصول کے لئے۔ اختلافات کے مقامات پر پوزیشنیں قائم کرکے ، یہ مقداری تجارت کے بہترین طریقوں کے مطابق نسبتا low کم قیمتوں پر خریدنے اور نسبتا high اعلی قیمتوں پر فروخت کرنے کے قابل ہے۔

  3. روایتی آر ایس آئی حکمت عملیوں کی حدود کو توڑیں۔ روایتی آر ایس آئی حکمت عملی صرف زیادہ خریدنے اور زیادہ فروخت ہونے والے علاقوں پر مرکوز ہیں۔ یہ حکمت عملی موڑ کے مقامات کو زیادہ درست طریقے سے پکڑنے کے لئے آر ایس آئی کی خود کی اندرونی الٹ خصوصیات کا استعمال کرتی ہے ، جس سے حکمت عملی کی کارکردگی میں بہتری آتی ہے۔

  4. سادہ پیرامیٹر کی ترتیبات. اہم پیرامیٹرز صرف RSI مدت اور نظر واپس کی مدت ہیں، جو بہت آسان اور بہتر بنانے کے لئے آسان ہے.

خطرات

RSI Divergence حکمت عملی میں کچھ خطرات بھی ہیں:

  1. اختلاف کے اشارے غلط اشارے ہوسکتے ہیں۔ آر ایس آئی اور قیمت کے مابین اختلافات ضروری طور پر حقیقی قیمتوں میں الٹ نہیں ہوتے ہیں۔ بعض اوقات وہ غلط الٹ بھی بناتے ہیں ، جس سے تجارتی نقصانات کا باعث بنتا ہے۔ خطرات کو کنٹرول کرنے کے لئے معقول اسٹاپ نقصان مقرر کیا جانا چاہئے۔

  2. رجحان سازی کی مارکیٹوں میں خراب کارکردگی۔ جب قیمت میں واضح سمت کا رجحان ظاہر ہوتا ہے تو ، اس حکمت عملی کا منافع کی جگہ نسبتا small چھوٹی ہوگی۔ اس معاملے میں حکمت عملی کو عارضی طور پر غیر فعال کرنا اور نئی رینج مارکیٹوں کا انتظار کرنا بہتر ہے۔

  3. پرامڈائڈنگ کا خطرہ۔ حکمت عملی میں پرامڈائڈنگ پیرامیٹرز طے کیے گئے ہیں۔ مسلسل کھونے والی تجارت کی صورت میں ، اس سے اکاؤنٹ کی کھوج میں تیزی آسکتی ہے۔ خطرے کو کم کرنے کے لئے پوزیشن سائزنگ اور اسٹاپ نقصان کو کنٹرول کیا جانا چاہئے۔

بہتری

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

  1. سگنل فلٹرنگ کے لئے دیگر اشارے کو جوڑیں۔ آر ایس آئی کے اختلافات کے نکات کی تصدیق کے لئے ایم اے سی ڈی ، کے ڈی جے اور دیگر اشارے شامل کیے جاسکتے ہیں ، کچھ غلط اشاروں کو فلٹر کرتے ہیں اور حکمت عملی کی جیت کی شرح کو بہتر بناتے ہیں۔

  2. آر ایس آئی پیرامیٹرز کو بہتر بنائیں۔ مختلف آر ایس آئی ادوار کا تجربہ کیا جاسکتا ہے تاکہ اس کو تلاش کیا جاسکے جو مصنوعات کی خصوصیات سے بہترین مطابقت رکھتا ہو۔ عام طور پر 6-15 کے درمیان کام کرتا ہے۔

  3. نظرثانی کی مدت کو بہتر بنائیں۔ نظرثانی کی مدت حکمت عملی کی تجارتی تعدد کو براہ راست متاثر کرتی ہے۔ زیادہ سے زیادہ تعدد تلاش کرنے کے لئے مختلف اقدار کی جانچ کی جاسکتی ہے ، عام طور پر 5-15 کے درمیان ایک اچھی حد ہے۔

  4. اسٹاپ نقصان کی منطق شامل کریں۔ معقول اسٹاپ نقصان کے طریقوں جیسے اے ٹی آر ٹریلنگ اسٹاپ نقصان کو فوری طور پر نقصانات کو کم کرنے کے لئے لاگو کیا جاسکتا ہے۔ اس سے حکمت عملی کے خطرے کو مؤثر طریقے سے کنٹرول کیا جاسکتا ہے۔

نتیجہ

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


/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
//study(title="Divergence Indicator", format=format.price)
//GOOGL setting  5 , close, 3 , 1  profitLevel at 75 shows win rate  87.21 %  profit factor 7.059
//GOOGL setting  8 , close, 3 , 1  profitLevel at 80 shows win rate  86.57 %  profit factor 18.96 
//SPY setting    5, close , 3, 3  profitLevel at 70  , shows win rate 80.34%  profit factor 2.348
strategy(title="RSI Divergence Indicator", overlay=false,pyramiding=2, default_qty_value=2,   default_qty_type=strategy.fixed, initial_capital=10000, currency=currency.USD)

len = input(title="RSI Period", minval=1, defval=9)
src = input(title="RSI Source", defval=close)
lbR = input(title="Pivot Lookback Right", defval=3)
lbL = input(title="Pivot Lookback Left", defval=1)
takeProfitRSILevel = input(title="Take Profit at RSI Level", minval=70, defval=80)

rangeUpper = input(title="Max of Lookback Range", defval=60)
rangeLower = input(title="Min of Lookback Range", defval=5)
plotBull = input(title="Plot Bullish", defval=true)
plotHiddenBull = input(title="Plot Hidden Bullish", defval=true)
plotBear = input(title="Plot Bearish", defval=true)
plotHiddenBear = input(title="Plot Hidden Bearish", defval=false)

//useTrailStopLoss = input(false, title="Use Trailing Stop Loss")

sl_type = input("NONE", title="Trailing StopLoss Type", options=['ATR','PERC', 'NONE'])

stopLoss = input(title="Stop Loss%", defval=5, minval=1)

atrLength=input(14, title="ATR Length (for Trailing stop loss)")
atrMultiplier=input(3.5, title="ATR Multiplier (for Trailing stop loss)")


bearColor = color.purple
bullColor = color.green
hiddenBullColor = color.new(color.green, 80)
hiddenBearColor = color.new(color.red, 80)
textColor = color.white
noneColor = color.new(color.white, 100)

osc = rsi(src, len)

plot(osc, title="RSI", linewidth=2, color=#8D1699)
hline(50, title="Middle Line", linestyle=hline.style_dotted)
obLevel = hline(70, title="Overbought", linestyle=hline.style_dotted)
osLevel = hline(30, title="Oversold", linestyle=hline.style_dotted)
fill(obLevel, osLevel, title="Background", color=#9915FF, transp=90)

plFound = na(pivotlow(osc, lbL, lbR)) ? false : true
phFound = na(pivothigh(osc, lbL, lbR)) ? false : true

_inRange(cond) =>
    bars = barssince(cond == true)
    rangeLower <= bars and bars <= rangeUpper

//------------------------------------------------------------------------------
// Regular Bullish

// Osc: Higher Low
oscHL = osc[lbR] > valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])

// Price: Lower Low
priceLL = low[lbR] < valuewhen(plFound, low[lbR], 1)

bullCond = plotBull and priceLL and oscHL and plFound

plot(
	 plFound ? osc[lbR] : na,
	 offset=-lbR,
	 title="Regular Bullish",
	 linewidth=2,
	 color=(bullCond ? bullColor : noneColor),
	 transp=0
	 )


plotshape(
	 bullCond ? osc[lbR] : na,
	 offset=-lbR,
	 title="Regular Bullish Label",
	 text=" Bull ",
	 style=shape.labelup,
	 location=location.absolute,
	 color=bullColor,
	 textcolor=textColor,
	 transp=0
	 )

//------------------------------------------------------------------------------
// Hidden Bullish

// Osc: Lower Low
oscLL = osc[lbR] < valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])

// Price: Higher Low
priceHL = low[lbR] > valuewhen(plFound, low[lbR], 1)

hiddenBullCond = plotHiddenBull and priceHL and oscLL and plFound

plot(
	 plFound ? osc[lbR] : na,
	 offset=-lbR,
	 title="Hidden Bullish",
	 linewidth=2,
	 color=(hiddenBullCond ? hiddenBullColor : noneColor),
	 transp=0
	 )

plotshape(
	 hiddenBullCond ? osc[lbR] : na,
	 offset=-lbR,
	 title="Hidden Bullish Label",
	 text=" H Bull ",
	 style=shape.labelup,
	 location=location.absolute,
	 color=bullColor,
	 textcolor=textColor,
	 transp=0
	 )

longCondition=bullCond or hiddenBullCond
//? osc[lbR] : na  
//hiddenBullCond
strategy.entry(id="RSIDivLE", long=true,  when=longCondition)


//Trailing StopLoss
////// Calculate trailing SL
/////////////////////////////////////////////////////
sl_val = sl_type == "ATR"      ? stopLoss * atr(atrLength) : 
         sl_type == "PERC" ? close * stopLoss / 100 : 0.00

trailing_sl = 0.0
trailing_sl :=   strategy.position_size>=1 ?  max(low  - sl_val, nz(trailing_sl[1])) :  na

//draw initil stop loss
//plot(strategy.position_size>=1 ? trailing_sl : na, color = color.blue , style=plot.style_linebr,  linewidth = 2, title = "stop loss")
//plot(trailing_sl, title="ATR Trailing Stop Loss", style=plot.style_linebr, linewidth=1, color=color.purple, transp=30)
//Trailing StopLoss
////// Calculate trailing SL
/////////////////////////////////////////////////////


//------------------------------------------------------------------------------
// Regular Bearish

// Osc: Lower High
oscLH = osc[lbR] < valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])

// Price: Higher High
priceHH = high[lbR] > valuewhen(phFound, high[lbR], 1)

bearCond = plotBear and priceHH and oscLH and phFound

plot(
	 phFound ? osc[lbR] : na,
	 offset=-lbR,
	 title="Regular Bearish",
	 linewidth=2,
	 color=(bearCond ? bearColor : noneColor),
	 transp=0
	 )

plotshape(
	 bearCond ? osc[lbR] : na,
	 offset=-lbR,
	 title="Regular Bearish Label",
	 text=" Bear ",
	 style=shape.labeldown,
	 location=location.absolute,
	 color=bearColor,
	 textcolor=textColor,
	 transp=0
	 )

//------------------------------------------------------------------------------
// Hidden Bearish

// Osc: Higher High
oscHH = osc[lbR] > valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])

// Price: Lower High
priceLH = high[lbR] < valuewhen(phFound, high[lbR], 1)

hiddenBearCond = plotHiddenBear and priceLH and oscHH and phFound

plot(
	 phFound ? osc[lbR] : na,
	 offset=-lbR,
	 title="Hidden Bearish",
	 linewidth=2,
	 color=(hiddenBearCond ? hiddenBearColor : noneColor),
	 transp=0
	 )

plotshape(
	 hiddenBearCond ? osc[lbR] : na,
	 offset=-lbR,
	 title="Hidden Bearish Label",
	 text=" H Bear ",
	 style=shape.labeldown,
	 location=location.absolute,
	 color=bearColor,
	 textcolor=textColor,
	 transp=0
	 )
longCloseCondition=crossover(osc,takeProfitRSILevel) or bearCond
strategy.close(id="RSIDivLE", comment="Close All="+tostring(close - strategy.position_avg_price, "####.##"), when= abs(strategy.position_size)>=1  and  sl_type == "NONE" and longCloseCondition)

//close all on stop loss
strategy.close(id="RSIDivLE", comment="TSL="+tostring(close - strategy.position_avg_price, "####.##"),  when=abs(strategy.position_size)>=1 and (sl_type == "PERC"   or sl_type == "ATR" ) and crossunder(close, trailing_sl)  )  //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89


// Calculate start/end date and time condition
startDate  = input(timestamp("2019-01-01T00:00:00"), type = input.time)
finishDate = input(timestamp("2021-01-01T00:00:00"), type = input.time)
 
time_cond  = time >= startDate and time <= finishDate


مزید