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


تخلیق کی تاریخ: 2025-09-10 11:14:13 آخر میں ترمیم کریں: 2025-11-21 11:55:25
کاپی: 0 کلکس کی تعداد: 29
2
پر توجہ دیں
319
پیروکار

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

جائزہ

یہ حکمت عملی ایک ایسا ٹرینڈ ٹریکنگ سسٹم ہے جس میں متغیر انڈیکس متحرک اوسط (VIDYA) اشارے اور بولنگر بینڈ (Bollinger Bands) شامل ہیں ، اور اس میں ایک کثیر سطحی اسٹاپنگ میکانزم بھی شامل ہے۔ روایتی رجحان سازی کی حکمت عملی کے برعکس ، اس نظام میں ایک زیادہ موافقت پذیر منافع بخش طریقہ استعمال کیا گیا ہے ، جس میں ایک منفرد اے ٹی آر بیس اور فیصد کے اہداف کے ذریعہ کثیر خالی پوزیشنوں کو الگ کیا گیا ہے۔ اس کی جدت طرازی متحرک کثیر سطحی اسٹاپنگ کے طریقہ کار کو اپنانے میں ہے ، خاص طور پر زیادہ شدت پسند فیصد ضرب کے ساتھ ، جو کہ مارکیٹ میں اتار چڑھاؤ اور رجحان کی طاقت کے مطابق ٹریڈنگ مینجمنٹ اور منافع کی تقسیم کو بہتر بنانے میں مدد فراہم کرتی ہے۔

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

اس حکمت عملی کا بنیادی مقصد قیمتوں کے رجحانات کا تجزیہ کرنے کے لئے تیز رفتار اور سست رفتار دونوں وڈیایا اشارے کا استعمال کرنا ہے ، جبکہ مارکیٹ میں اتار چڑھاؤ کو مدنظر رکھتے ہوئے۔ وڈیایا اشارے کا حساب کتاب فارمولہ ہے: ہموار کرنے والا عنصر ((α) = 2/ ((سائیکل +1) VIDYA (ٹی) = α * ک * قیمت (ٹی) + (1 - α * ک) * VIDYA (ٹی -1) جہاں k =

برن بینڈ کے طور پر فلٹر: اپ ریل = MA + (K * معیاری فرق) نچلے ریل = MA - (K * معیاری فرق)

داخلے کی شرائط:

  • کثیر سر: قیمت نے سست وڈیوا کو توڑ دیا اور تیز وڈیوا اوپر کی طرف بڑھ گیا ، جبکہ قیمت نے برلن بینڈ کو ٹریک کیا۔
  • خالی سر: قیمتیں سست وڈیوا سے نیچے اور تیز وڈیوا نیچے کی طرف بڑھتی ہیں ، جبکہ قیمتیں برن بینڈ سے نیچے کی طرف بڑھتی ہیں

کثیر پرت روک تھام کے نظام میں شامل ہیں:

  1. اے ٹی آر پر مبنی اسٹاپ
  2. فی صد کی بنیاد پر روک
  3. فاریکس ٹریڈنگ میں ضرب کا استعمال روکنے کے تناسب کو بڑھانے کے لئے

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

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

اسٹریٹجک رسک

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

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

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

خلاصہ کریں۔

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

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

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © PresentTrading

// This strategy, "VIDYA ProTrend Multi-Tier Profit," is a trend-following system that utilizes fast and slow VIDYA indicators 
// to identify entry and exit points based on the direction and strength of the trend. 
// It incorporates Bollinger Bands as a volatility filter and features a multi-step take profit mechanism, 
// with adjustable ATR-based and percentage-based profit targets for both long and short positions. 
// The strategy allows for more aggressive take profit settings for short trades, making it adaptable to varying market conditions.

//@version=5
strategy("VIDYA ProTrend Multi-Tier Profit", overlay=true)


// User-defined inputs
tradeDirection = input.string(title="Trading Direction", defval="Both", options=["Long", "Short", "Both"])
fastVidyaLength = input.int(10, title="Fast VIDYA Length", minval=1)
slowVidyaLength = input.int(30, title="Slow VIDYA Length", minval=1)
minSlopeThreshold = input.float(0.05, title="Minimum VIDYA Slope Threshold", step=0.01)

// Bollinger Bands Inputs
bbLength = input.int(20, title="Bollinger Bands Length", minval=1)
bbMultiplier = input.float(1.0, title="Bollinger Bands Multiplier", step=0.1)

// Multi-Step Take Profit Settings
group_tp = "Multi-Step Take Profit"
useMultiStepTP = input.bool(true, title="Enable Multi-Step Take Profit", group=group_tp)
tp_direction = input.string(title="Take Profit Direction", defval="Both", options=["Long", "Short", "Both"], group=group_tp)
atrLengthTP =  input.int(14, title="ATR Length", group=group_tp)


// ATR-based Take Profit Steps
atrMultiplierTP1 = input.float(2.618, title="ATR Multiplier for TP 1", group=group_tp)
atrMultiplierTP2 = input.float(5.0, title="ATR Multiplier for TP 2", group=group_tp)
atrMultiplierTP3 = input.float(10.0, title="ATR Multiplier for TP 3", group=group_tp)

// Short Position Multiplier for Take Profit Percentages
shortTPPercentMultiplier = input.float(1.5, title="Short TP Percent Multiplier", group=group_tp)

// Percentage-based Take Profit Steps (Long)
tp_level_percent1 = input.float(title="Take Profit Level 1 (%)", defval=3.0, group=group_tp)
tp_level_percent2 = input.float(title="Take Profit Level 2 (%)", defval=8.0, group=group_tp)
tp_level_percent3 = input.float(title="Take Profit Level 3 (%)", defval=17.0, group=group_tp)

// Percentage-based Take Profit Allocation (Long)
tp_percent1 = input.float(title="Take Profit Percent 1 (%)", defval=12.0, group=group_tp)
tp_percent2 = input.float(title="Take Profit Percent 2 (%)", defval=8.0, group=group_tp)
tp_percent3 = input.float(title="Take Profit Percent 3 (%)", defval=10.0, group=group_tp)

// ATR-based Take Profit Percent Allocation (Long)
tp_percentATR1 = input.float(title="ATR TP Percent 1 (%)", defval=10.0, group=group_tp)
tp_percentATR2 = input.float(title="ATR TP Percent 2 (%)", defval=10.0, group=group_tp)
tp_percentATR3 = input.float(title="ATR TP Percent 3 (%)", defval=10.0, group=group_tp)

// Short position percentage allocations using the multiplier
tp_percent1_short = tp_percent1 * shortTPPercentMultiplier
tp_percent2_short = tp_percent2 * shortTPPercentMultiplier
tp_percent3_short = tp_percent3 * shortTPPercentMultiplier

tp_percentATR1_short = tp_percentATR1 * shortTPPercentMultiplier
tp_percentATR2_short = tp_percentATR2 * shortTPPercentMultiplier
tp_percentATR3_short = tp_percentATR3 * shortTPPercentMultiplier

// VIDYA Calculation Function
calcVIDYA(src, length) =>
    alpha = 2 / (length + 1)
    momm = ta.change(src)
    m1 = momm >= 0.0 ? momm : 0.0
    m2 = momm < 0.0 ? -momm : 0.0
    sm1 = math.sum(m1, length)
    sm2 = math.sum(m2, length)
    chandeMO = nz(100 * (sm1 - sm2) / (sm1 + sm2))
    k = math.abs(chandeMO) / 100
    var float vidya = na
    vidya := na(vidya[1]) ? src : (alpha * k * src + (1 - alpha * k) * vidya[1])
    vidya

// Calculate VIDYAs
fastVIDYA = calcVIDYA(close, fastVidyaLength)
slowVIDYA = calcVIDYA(close, slowVidyaLength)

// Bollinger Bands Calculation
[bbUpper, bbBasis, bbLower] = ta.bb(close, bbLength, bbMultiplier)

// Manual Slope Calculation (price difference over time)
calcSlope(current, previous, length) =>
    (current - previous) / length

// Slope of fast and slow VIDYA (comparing current value with value 'length' bars ago)
fastSlope = calcSlope(fastVIDYA, fastVIDYA[fastVidyaLength], fastVidyaLength)
slowSlope = calcSlope(slowVIDYA, slowVIDYA[slowVidyaLength], slowVidyaLength)

// Conditions for long entry with Bollinger Bands filter
longCondition = close > slowVIDYA and fastSlope > slowSlope and fastSlope > minSlopeThreshold and slowSlope > 1/2*minSlopeThreshold and close > bbUpper

// Conditions for short entry with Bollinger Bands filter
shortCondition = close < slowVIDYA and fastSlope < slowSlope and fastSlope < -minSlopeThreshold and slowSlope < -1/2*minSlopeThreshold and close < bbLower

// Exit conditions (opposite crossovers or flat slopes)
exitLongCondition = fastSlope < -minSlopeThreshold and slowSlope < -1/2*minSlopeThreshold or shortCondition
exitShortCondition = fastSlope > minSlopeThreshold and slowSlope > 1/2*minSlopeThreshold or longCondition

// Entry and Exit logic with trading direction
if (longCondition) and (strategy.position_size == 0) and (tradeDirection == "Long" or tradeDirection == "Both")
    strategy.order("Long", strategy.long)

if (exitLongCondition) and strategy.position_size > 0 and (tradeDirection == "Long" or tradeDirection == "Both")
    strategy.close("Long")

if (shortCondition) and (strategy.position_size == 0) and (tradeDirection == "Short" or tradeDirection == "Both")
    strategy.order("Short", strategy.short)

if (exitShortCondition) and strategy.position_size < 0 and (tradeDirection == "Short" or tradeDirection == "Both")
    strategy.close("Short")


if useMultiStepTP
    if strategy.position_size > 0 and (tp_direction == "Long" or tp_direction == "Both")
        // ATR-based Take Profit (Long)
        tp_priceATR1_long = strategy.position_avg_price + atrMultiplierTP1 * ta.atr(atrLengthTP)
        tp_priceATR2_long = strategy.position_avg_price + atrMultiplierTP2 * ta.atr(atrLengthTP)
        tp_priceATR3_long = strategy.position_avg_price + atrMultiplierTP3 * ta.atr(atrLengthTP)
        
        // Percentage-based Take Profit (Long)
        tp_pricePercent1_long = strategy.position_avg_price * (1 + tp_level_percent1 / 100)
        tp_pricePercent2_long = strategy.position_avg_price * (1 + tp_level_percent2 / 100)
        tp_pricePercent3_long = strategy.position_avg_price * (1 + tp_level_percent3 / 100)

        // Execute ATR-based exits for Long
        strategy.exit("TP ATR 1 Long", from_entry="Long", qty_percent=tp_percentATR1, limit=tp_priceATR1_long)
        strategy.exit("TP ATR 2 Long", from_entry="Long", qty_percent=tp_percentATR2, limit=tp_priceATR2_long)
        strategy.exit("TP ATR 3 Long", from_entry="Long", qty_percent=tp_percentATR3, limit=tp_priceATR3_long)
        
        // Execute Percentage-based exits for Long
        strategy.exit("TP Percent 1 Long", from_entry="Long", qty_percent=tp_percent1, limit=tp_pricePercent1_long)
        strategy.exit("TP Percent 2 Long", from_entry="Long", qty_percent=tp_percent2, limit=tp_pricePercent2_long)
        strategy.exit("TP Percent 3 Long", from_entry="Long", qty_percent=tp_percent3, limit=tp_pricePercent3_long)

    if strategy.position_size < 0 and (tp_direction == "Short" or tp_direction == "Both")
        // ATR-based Take Profit (Short) - using the same ATR levels as long
        tp_priceATR1_short = strategy.position_avg_price - atrMultiplierTP1 * ta.atr(atrLengthTP)
        tp_priceATR2_short = strategy.position_avg_price - atrMultiplierTP2 * ta.atr(atrLengthTP)
        tp_priceATR3_short = strategy.position_avg_price - atrMultiplierTP3 * ta.atr(atrLengthTP)
        
        // Percentage-based Take Profit (Short) - using the same levels, but more aggressive percentages
        tp_pricePercent1_short = strategy.position_avg_price * (1 - tp_level_percent1 / 100)
        tp_pricePercent2_short = strategy.position_avg_price * (1 - tp_level_percent2 / 100)
        tp_pricePercent3_short = strategy.position_avg_price * (1 - tp_level_percent3 / 100)

        // Execute ATR-based exits for Short (using the percentage multiplier for short)
        strategy.exit("TP ATR 1 Short", from_entry="Short", qty_percent=tp_percentATR1_short, limit=tp_priceATR1_short)
        strategy.exit("TP ATR 2 Short", from_entry="Short", qty_percent=tp_percentATR2_short, limit=tp_priceATR2_short)
        strategy.exit("TP ATR 3 Short", from_entry="Short", qty_percent=tp_percentATR3_short, limit=tp_priceATR3_short)
        
        // Execute Percentage-based exits for Short
        strategy.exit("TP Percent 1 Short", from_entry="Short", qty_percent=tp_percent1_short, limit=tp_pricePercent1_short)
        strategy.exit("TP Percent 2 Short", from_entry="Short", qty_percent=tp_percent2_short, limit=tp_pricePercent2_short)
        strategy.exit("TP Percent 3 Short", from_entry="Short", qty_percent=tp_percent3_short, limit=tp_pricePercent3_short)
// Plot VIDYAs
plot(fastVIDYA, color=color.green, title="Fast VIDYA")
plot(slowVIDYA, color=color.red, title="Slow VIDYA")