ملٹی پیریڈ سپر ٹرینڈ ڈائنامک پیرامڈ ٹریڈنگ حکمت عملی

ATR ST SL
تخلیق کی تاریخ: 2025-01-06 17:02:35 آخر میں ترمیم کریں: 2025-01-06 17:02:35
کاپی: 0 کلکس کی تعداد: 460
1
پر توجہ دیں
1617
پیروکار

ملٹی پیریڈ سپر ٹرینڈ ڈائنامک پیرامڈ ٹریڈنگ حکمت عملی

جائزہ

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

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

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

اسٹریٹجک فوائد

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

اسٹریٹجک رسک

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

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

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

خلاصہ کریں۔

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

حکمت عملی کا ماخذ کوڈ
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=6
strategy('4Vietnamese 3x Supertrend', overlay=true, max_bars_back=1000, initial_capital = 10000000000, slippage = 2, commission_type = strategy.commission.percent, commission_value = 0.013, default_qty_type=strategy.percent_of_equity, default_qty_value = 33.33, pyramiding = 3, margin_long = 0, margin_short = 0)

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Inputs

// Supertrend Settings
STATRLENGTH1 = input.int(10, title='Fast Supertrend ATR Length', group='SUPERTREND SETTINGS')
STATRMULT1 = input.float(1, title='Fast Supertrend ATR Multiplier', group='SUPERTREND SETTINGS')
STATRLENGTH2 = input.int(11, title='Medium Supertrend ATR Length', group='SUPERTREND SETTINGS')
STATRMULT2 = input.float(2, title='Medium Supertrend ATR Multiplier', group='SUPERTREND SETTINGS')
STATRLENGTH3 = input.int(12, title='Slow Supertrend ATR Length', group='SUPERTREND SETTINGS')
STATRMULT3 = input.float(3, title='Slow Supertrend ATR Multiplier', group='SUPERTREND SETTINGS')

isUseHighestOf2RedCandleSetup = input.bool(false, group = "Setup Filters")


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculations 
[superTrend1, dir1] = ta.supertrend(STATRMULT1, STATRLENGTH1)
[superTrend2, dir2] = ta.supertrend(STATRMULT2, STATRLENGTH2)
[superTrend3, dir3] = ta.supertrend(STATRMULT3, STATRLENGTH3)

// directionST1 = dir1 == 1 and dir1[1] == 1 ? false : dir1 == -1 and dir1[1] == -1 ? true : false
// directionST2 = dir2 == 1 and dir2[1] == 1 ? false : dir2 == -1 and dir2[1] == -1 ? true : false
// directionST3 = dir3 == 1 and dir3[1] == 1 ? false : dir3 == -1 and dir3[1] == -1 ? true : false


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculate highest from supertrend1 uptrend
var float highestGreen = 0
if dir1 < 0 and highestGreen == 0 and (isUseHighestOf2RedCandleSetup ? close < open : true)
    highestGreen := high
if highestGreen > 0 and (isUseHighestOf2RedCandleSetup ? close < open : true)
    if high > highestGreen
        highestGreen := high
if dir1 >= 0
    highestGreen := 0


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Entry SL
var entrySL4Long1 = false
var entrySL4Long2 = false
var entrySL4Long3 = false

isUseEntrySL = input.bool(true, group = "Entry SL Option")
dataToCalculate = input.source(low, group = "Entry SL Option")

if isUseEntrySL and (dir1 > 0 and dir2 < 0 and dir3 < 0)
    if strategy.opentrades >= 1
        if dataToCalculate > strategy.opentrades.entry_price(0)
            entrySL4Long1 := true
        else 
            entrySL4Long1 := false

        if entrySL4Long1 and close > strategy.opentrades.entry_price(0)
            strategy.exit('exit1', from_entry = 'long1', stop = strategy.opentrades.entry_price(0))

    if strategy.opentrades >= 2 
        if dataToCalculate > strategy.opentrades.entry_price(1)
            entrySL4Long2 := true
        else 
            entrySL4Long2 := false
    
        if entrySL4Long2 and close > strategy.opentrades.entry_price(1)
            strategy.exit('exit2', from_entry = 'long2', stop = strategy.opentrades.entry_price(1))   

    if strategy.opentrades >= 3 
        if dataToCalculate > strategy.opentrades.entry_price(2) 
            entrySL4Long3 := true
        else 
            entrySL4Long3 := false
    
        if entrySL4Long3 and close >  strategy.opentrades.entry_price(2)
            strategy.exit('exit3', from_entry = 'long3', stop = strategy.opentrades.entry_price(2))

if strategy.closedtrades > strategy.closedtrades[1]
    if strategy.closedtrades.exit_id(strategy.closedtrades-1) == 'exit3'
        entrySL4Long3 := false
    if strategy.closedtrades.exit_id(strategy.closedtrades-1) == 'exit2'
        entrySL4Long2 := false
    if strategy.closedtrades.exit_id(strategy.closedtrades-1) == 'exit1'
        entrySL4Long1 := false

    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Entry
if dir3 < 0
    if dir2 > 0 and dir1 < 0
        strategy.entry('long1', strategy.long)
    else if dir2 < 0
        strategy.entry('long2', strategy.long, stop=superTrend1)
else
    if dir1 < 0 and highestGreen > 0
        strategy.entry('long3', strategy.long, stop=highestGreen)


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Exit
isUseAllDowntrendExit = input.bool(true, group = "Exit Type")
if isUseAllDowntrendExit and dir3 > 0 and dir2 > 0 and dir1 > 0 and close < open
    strategy.close_all()

isUseAvgPriceInLoss = input.bool(true, group = "Exit Type")
if isUseAvgPriceInLoss and strategy.position_avg_price > close //and strategy.position_avg_price <= close[1]
    //  and (dir1 > 0 or dir2 > 0 or dir3 > 0)
    //  and strategy.opentrades >= 1  
    //  and strategy.opentrades >= 3  
    strategy.close_all()

isUseAllPositionsInLoss = input.bool(false, group = "Exit Type")
if isUseAllPositionsInLoss
      and (
       false
         or (strategy.opentrades == 1 and ((not na(strategy.opentrades.entry_price(0))) and strategy.opentrades.entry_price(0) > close))

         or (strategy.opentrades == 1 and ((not na(strategy.opentrades.entry_price(0))) and strategy.opentrades.entry_price(0) > close)
             and ((not na(strategy.opentrades.entry_price(1))) and strategy.opentrades.entry_price(1) > close))

         or (strategy.opentrades == 1 and ((not na(strategy.opentrades.entry_price(0))) and strategy.opentrades.entry_price(0) > close)
             and ((not na(strategy.opentrades.entry_price(1))) and strategy.opentrades.entry_price(1) > close)
             and ((not na(strategy.opentrades.entry_price(2))) and strategy.opentrades.entry_price(2) > close))
         )
    strategy.close_all()


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Plot
plot(superTrend1, title='Fast Supertrend',      color=dir1 == 1 and dir1[1] == 1 ? color.red : dir1 == -1 and dir1[1] == -1 ? color.green : na)
plot(superTrend2, title='Medium Supertrend',    color=dir2 == 1 and dir2[1] == 1 ? color.red : dir2 == -1 and dir2[1] == -1 ? color.green : na)
plot(superTrend3, title='Slow Supertrend',      color=dir3 == 1 and dir3[1] == 1 ? color.red : dir3 == -1 and dir3[1] == -1 ? color.green : na)