مومینٹم زون اے ٹی آر ریورسل آرڈر مقداری حکمت عملی


تخلیق کی تاریخ: 2023-11-24 15:55:36 آخر میں ترمیم کریں: 2023-11-24 15:55:36
کاپی: 0 کلکس کی تعداد: 646
1
پر توجہ دیں
1617
پیروکار

مومینٹم زون اے ٹی آر ریورسل آرڈر مقداری حکمت عملی

جائزہ

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

اصول

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

فوائد

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

خطرات اور حل

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

اصلاح کی سمت

  1. پیرامیٹرز کی ترتیبات کو بہتر بنائیں اور بہترین پیرامیٹرز کا مجموعہ تلاش کریں۔
  2. اضافی تکنیکی اشارے کو فلٹر کریں اور سگنل کوالٹی کو بہتر بنائیں
  3. فنڈ مینجمنٹ ماڈیول شامل کریں تاکہ پوزیشنوں کو اکاؤنٹ کے مجموعی اثاثوں سے منسلک کیا جاسکے۔
  4. ٹائم سائیکل تجزیہ کو شامل کریں اور حکمت عملی کو بہتر بنانے کے لئے مزید معلومات کا استعمال کریں.

خلاصہ کریں۔

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

حکمت عملی کا ماخذ کوڈ
/*backtest
start: 2023-10-24 00:00:00
end: 2023-11-23 00:00:00
period: 1h
basePeriod: 15m
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/
// © fenirlix

//@version=5
// Strategy parameter incl. position size, commission and initial capital
strategy("ACTIONZONE-ATR REVERSEORDER STRATEGY", "ACTIONZONEATR-REVERSEORDER", overlay=true
     )

// User Input Variable
fastMaInput     = input.int(12, "Fast MA Period", minval=2, step=1)
slowMaInput     = input.int(26, "Fast MA Period", minval=2, step=1)

atrLengthInput  = input.int(14, "ATR length", minval=2,step=1)
atrInnerMultInput = input.float(1, "atr inner multiplier", minval=0.1, step=0.1)
atrMidMultInput = input.float(2, "atr inner multiplier", minval=0.1, step=0.1) //***** MOST OF RISK MANAGEMENT LOGIC BASE ON THIS INPUT *****//
atrOuterMultInput = input.float(3, "atr inner multiplier", minval=0.1, step=0.1)

// Backtesting Date range
startYearInput      = input.int(2021, "Start Year", minval=1900, maxval=2100, step=1)
startMonthInput     = input.int(12, "Start Month", minval=1, maxval=12, step=1)
startDateInput      = input.int(1, "Start Day", minval=1, maxval=31, step=1)
setEndRangeInput    = input.bool(false, "Using Specific End Test Date") //Set specific End date or use present(end of candle) data
endYearInput        = input.int(2022, "End Year", minval=1900, maxval=2100, step=1)
endMonthInput       = input.int(1, "End Month", minval=1, maxval=12, step=1)
endDateInput        = input.int(31, "End Day", minval=1, maxval=31, step=1)

startDate = timestamp(syminfo.timezone, startYearInput, startMonthInput, startDateInput)
endDate = timestamp(syminfo.timezone, endYearInput, endMonthInput, endDateInput)
inDateRange = time >= startDate //Set backtest date range to present data
if setEndRangeInput
    inDateRange and time <= endDate //set backtest date range to specific date

// minimum position hold period (to get rid of false signal in sideway trend)
minHoldInput = input.int(8, 'Minimum position Hold Limit', minval=1, maxval=365, step=1) // Set Minimum Position Hold

var bool reverseToLong = false // Assign reverse order operator
var bool reverseToShort = false // Assign reverse order operator

// Indicator Declaration
fastEma = ta.ema(close, fastMaInput)
slowEma = ta.ema(close, slowMaInput)
atr = ta.atr(atrLengthInput)

// Declare trend of asset
isBullish = fastEma > slowEma
isBearish = fastEma <= slowEma

// Record position hold length, to limit minimum hold period(candle)
var int hold_length = 0
if strategy.opentrades > 0 or strategy.opentrades < 0
    hold_length := hold_length + 1
else
    hold_length := 0

// create permanent variable of stop price
var float longStopPrice = na
var float shortStopPrice = na
    
// Chart-Indicator COLOR declaration
REDBEAR     = color.new(color.red, 80)
GREENBULL   = color.new(color.green, 80)

greenLong = isBullish and close > fastEma
yellowLong = isBullish and close < fastEma
blueShort = isBearish and close > fastEma
redShort = isBearish and close < fastEma

// assign oversold, overbought condition(in this case, price over middle atr plus/minus fastEma)
overBand = high[1] > fastEma + (2*atr)
underBand = low[1] < fastEma - (2*atr)

// Strategy

// Main Entry Condition
goLong = isBullish and isBullish[1] == 0
goShort = isBearish and isBearish[1] == 0

inPosition = strategy.position_size != 0
minHoldPeriod = hold_length > minHoldInput ? true : false

// Entry Condition
if not inPosition and inDateRange and barstate.isconfirmed == true //compute after close of the bar to avoid repainting
    if goLong or reverseToLong // Long if longcondition or reverse order receive.
        strategy.entry('long', strategy.long)
        longStopPrice := fastEma - (atr * 2) // Set stop loss price
        reverseToLong := false // Reset reverse order status
    
    else if goShort or reverseToShort
        strategy.entry('short', strategy.short)
        shortStopPrice := fastEma + (atr * 2)
        reverseToShort := false
// Take profit and Set Higher Stop 
if inPosition and minHoldPeriod and barstate.isconfirmed == true // check if we're in position and pass minimum hold period, confirm no repainting
    if strategy.position_size > 0
        // if exit position by Sellcondition(which is the same as ShortCondition), Exit Long position and make Short order(by set reverse order to true)
        strategy.close('long', when=goShort, comment='exitLong(' + str.tostring(hold_length) + ')')
        reverseToShort := true
        if overBand //If overbought condition met, set Stop price to LAST LOW, and not reverse any position
            longStopPrice := low[1]
            reverseToShort := false
    else if strategy.position_size < 0
        strategy.close('short', when=goLong, comment='exitShort(' + str.tostring(hold_length) + ')')
        reverseToLong := true
        if underBand
            shortStopPrice := high[1]
            reverseToLong := false
// Stop Loss and Set calculate stop loss using Atr Channel
if inPosition 
    if strategy.position_size > 0
        if fastEma - (atr * atrMidMultInput) > longStopPrice // set long stop price to the higher of latest long stop price and ATR lower channel
            longStopPrice := fastEma - (atr * atrMidMultInput)
        strategy.exit('Long Stop atr ', 'long', stop=longStopPrice)
    else if strategy.position_size < 0
        if fastEma + (atr * atrMidMultInput) < shortStopPrice
            shortStopPrice := fastEma + (atr * atrMidMultInput)
        strategy.exit('Short Stop atr ', 'short', stop=shortStopPrice)

// Plotting
fastLine = plot(fastEma, title='fast ema line', linewidth=1, color=isBullish ? color.green : color.red)
slowLine = plot(slowEma, title='slow ema line', linewidth=2, color= isBullish? color.green : color.red)
atrUpperLine1 = plot(fastEma + (atr * atrInnerMultInput), title='ATR Upperline1', color=color.new(color.black,85))
atrLowerLine1 = plot(fastEma - (atr * atrInnerMultInput), title='ATR Lowerline1', color=color.new(color.black,85))
atrUpperLine2 = plot(fastEma + (atr * atrMidMultInput), title='ATR Upperline2', color=color.new(color.black,75))
atrLowerLine2 = plot(fastEma - (atr * atrMidMultInput), title='ATR Lowerline2', color=color.new(color.black,75))
atrUpperLine3 = plot(fastEma + (atr * atrOuterMultInput), title='ATR Upperline3', color=color.new(color.black,50))
atrLowerLine3 = plot(fastEma - (atr * atrOuterMultInput), title='ATR Lowerline3', color=color.new(color.black,50))

plot(longStopPrice, color=strategy.position_size > 0 ? color.red : na, linewidth=2)
plot(shortStopPrice, color=strategy.position_size < 0 ? color.red : na, linewidth=2)

//  Filling
fill(fastLine, slowLine, color=isBullish ? GREENBULL : REDBEAR)
fill(atrUpperLine3, atrLowerLine3, color=inPosition and (minHoldInput - hold_length > 0) ? color.new(color.blue,90): na)

barColor = switch
    greenLong => color.green
    yellowLong =>  color.yellow
    blueShort => color.blue
    redShort => color.red
    => color.black
barcolor(color=barColor)

// Fill background to distinguish inactive time(Zulu time)
nightTime = time(timeframe.period, "1500-0100") ? color.new(color.black, 95): na
bgcolor(nightTime)