
یہ حکمت عملی ایک رجحان ٹریکنگ سسٹم ہے جو الفا ٹرینڈ اشارے اور کوفمین کی خود کار طریقے سے چلنے والی اوسط ((KAMA) کو یکجا کرتی ہے ، اور اس میں رسک مینجمنٹ کی خصوصیات کو مربوط کیا گیا ہے۔ اس حکمت عملی کا مقصد مارکیٹ کے رجحانات کو پکڑنا ہے ، جبکہ جزوی اسٹاپس کے ذریعہ خطرے کا انتظام کرنا ہے۔ اس حکمت عملی کا مرکز مجموعی رجحان کی سمت کی نشاندہی کرنے کے لئے الفا ٹرینڈ اشارے کا استعمال کرنا ہے ، جبکہ KAMA کو زیادہ درست اندراج اور باہر نکلنے کے سگنل پیدا کرنے کے لئے استعمال کیا جاتا ہے۔ اس کے علاوہ ، اس حکمت عملی میں ایک فیصد پر مبنی جزوی اسٹاپس کا طریقہ کار بھی شامل ہے جس میں مخصوص منافع کے اہداف کو حاصل کرنے پر منافع کے کچھ حصوں کو لاک کرنا ہے۔
الفا ٹرینڈ اشارے کا حساب کتاب:
KAMA کے حساب سے:
ٹریڈنگ سگنل پیدا:
رسک مینجمنٹ:
پوزیشن مینجمنٹ:
رجحانات کے مطابق ڈھالنے کی صلاحیت: الفا ٹرینڈ اور کاما کے ساتھ مل کر ، مختلف مارکیٹ کے حالات میں بہتر طور پر ڈھالنے کی صلاحیت۔
اعلی سگنل کی وشوسنییتا: ایک سے زیادہ شرائط کی تصدیق کے ذریعہ ، تجارتی سگنل کی وشوسنییتا میں اضافہ ہوا ہے۔
بہتر خطرے کا انتظام: غیر مستحکم مارکیٹوں میں منافع کو روکنے کے لئے جزوی روک تھام کا طریقہ کار۔
لچکدار پوزیشن مینجمنٹ: اکاؤنٹ کی خالص قیمت پر مبنی پوزیشن مینجمنٹ کا طریقہ ، مختلف فنڈز کے سائز کے مطابق۔
بہتر بصری اثرات: حکمت عملی تجزیہ اور نگرانی کے لئے ایک واضح گرافیکل انٹرفیس فراہم کرتی ہے۔
غلط بریک کا خطرہ: غیر مستحکم مارکیٹوں میں اکثر غلط بریک سگنل پیدا ہوسکتے ہیں۔
تاخیر: رجحانات کی پیروی کرنے کی حکمت عملی کے طور پر ، رجحانات کے الٹ کے ابتدائی مرحلے میں رد عمل میں تاخیر ہوسکتی ہے۔
پیرامیٹر حساسیت: حکمت عملی کی کارکردگی پیرامیٹرز کی ترتیبات سے زیادہ حساس ہوسکتی ہے۔
واپسی کا خطرہ: مضبوط رجحانات والے بازاروں میں ، کچھ رکاوٹوں سے بڑے بازار سے محروم ہوسکتا ہے۔
مارکیٹ کی موافقت: حکمت عملی کچھ مخصوص مارکیٹ کے حالات میں خراب کارکردگی کا مظاہرہ کرسکتی ہے۔
متحرک پیرامیٹرز کو ایڈجسٹ کریں:
ملٹی ٹائم فریم تجزیہ:
فلٹرنگ کی شرح:
ذہنی نقصان:
مارکیٹ کی درجہ بندی:
الفا ٹرینڈ اور کاما کے ساتھ مل کر ایڈجسٹ ٹرینڈ ٹریکنگ اور رسک مینجمنٹ حکمت عملی ایک جامع اور طاقتور تجارتی نظام ہے۔ یہ الفا ٹرینڈ اشارے اور کاما کے فوائد کو ملا کر مارکیٹ کے رجحانات کی درست گرفت کو حاصل کرتا ہے۔ حکمت عملی کا رسک مینجمنٹ میکانزم ، خاص طور پر جزوی اسٹاپ فنکشن ، سرمایہ کاروں کو اتار چڑھاؤ والی مارکیٹوں میں منافع کی حفاظت کے لئے ایک مؤثر ٹول فراہم کرتا ہے۔ اگرچہ کچھ موروثی خطرات جیسے جھوٹے توڑ اور پیرامیٹر حساسیت موجود ہیں ، لیکن اس حکمت عملی میں مستقل اصلاح اور ایڈجسٹمنٹ کے ذریعہ قابل اعتماد تجارتی نظام بننے کی صلاحیت موجود ہے۔ متحرک پیرامیٹر ایڈجسٹمنٹ اور فریم ٹائم تجزیہ جیسی مستقبل کی اصلاح کی سمت حکمت عملی کی لچک اور استحکام کو مزید بڑھا دے گی۔
/*backtest
start: 2024-06-01 00:00:00
end: 2024-06-30 23:59:59
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('AlphaTrend with KAMA and Risk Management', shorttitle='AT+KAMA+RM', overlay=true, format=format.price, precision=2, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// AlphaTrend Inputs
coeff = input.float(1, 'AT Multiplier', step=0.1)
AP = input.int(14, 'AT Common Period', minval=1)
src = input.source(close, 'AT Source')
showsignals = input.bool(true, 'Show Signals?')
novolumedata = input.bool(false, 'Change calculation (no volume data)?')
// KAMA Inputs
kamaLength = input.int(21, 'KAMA Length', minval=1)
// Risk Management Inputs
profitTarget = input.float(10, 'Profit Target for Partial Exit (%)', minval=1, step=0.1)
// Yeni değişkenler
var float entryPrice = na
var string currentPosition = "flat" // "long", "short", veya "flat"
var float partialExitPrice = na
// AlphaTrend Calculation
ATR = ta.sma(ta.tr, AP)
upT = low - ATR * coeff
downT = high + ATR * coeff
AlphaTrend = 0.0
AlphaTrend := (novolumedata ? ta.rsi(src, AP) >= 50 : ta.mfi(hlc3, AP) >= 50) ? upT < nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT : downT > nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT
// KAMA Calculation
xPrice = close
xvnoise = math.abs(xPrice - xPrice[1])
nAMA = 0.0
nfastend = 0.666
nslowend = 0.0645
nsignal = math.abs(xPrice - xPrice[kamaLength])
// Manual calculation of sum
nnoise = 0.0
for i = 0 to kamaLength-1
nnoise := nnoise + xvnoise[i]
nefratio = nnoise != 0 ? nsignal / nnoise : 0
nsmooth = math.pow(nefratio * (nfastend - nslowend) + nslowend, 2)
nAMA := nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))
// Plotting
color1 = AlphaTrend > AlphaTrend[2] ? #00E60F : AlphaTrend < AlphaTrend[2] ? #80000B : AlphaTrend[1] > AlphaTrend[3] ? #00E60F : #80000B
k1 = plot(AlphaTrend, color=color.new(#0022FC, 0), linewidth=3, title='AlphaTrend')
k2 = plot(AlphaTrend[2], color=color.new(#FC0400, 0), linewidth=3)
fill(k1, k2, color=color1)
plot(nAMA, color=color.yellow, linewidth=2, title='KAMA')
// Sinyal koşulları
buyCondition = (ta.crossover(nAMA, AlphaTrend) and ta.crossover(nAMA, AlphaTrend[2])) or
(ta.crossover(nAMA, AlphaTrend) and nAMA > AlphaTrend[2]) or
(ta.crossover(nAMA, AlphaTrend[2]) and nAMA > AlphaTrend)
sellCondition = (ta.crossunder(nAMA, AlphaTrend) and ta.crossunder(nAMA, AlphaTrend[2])) or
(ta.crossunder(nAMA, AlphaTrend) and nAMA < AlphaTrend[2]) or
(ta.crossunder(nAMA, AlphaTrend[2]) and nAMA < AlphaTrend)
// Yeni Sinyaller
buySignal = buyCondition
sellSignal = sellCondition
// Alım satım mantığı
if (buySignal and currentPosition != "long")
if (currentPosition == "short")
strategy.close("Short")
strategy.entry("Long", strategy.long)
entryPrice := close
currentPosition := "long"
partialExitPrice := entryPrice * (1 + profitTarget / 100)
if (sellSignal and currentPosition != "short")
if (currentPosition == "long")
strategy.close("Long")
strategy.entry("Short", strategy.short)
entryPrice := close
currentPosition := "short"
partialExitPrice := entryPrice * (1 - profitTarget / 100)
// Kısmi çıkış mantığı
if (currentPosition == "long" and high >= partialExitPrice)
strategy.close("Long", comment="Partial Exit at " + str.tostring(profitTarget) + "% profit", qty_percent=50)
partialExitPrice := na
if (currentPosition == "short" and low <= partialExitPrice)
strategy.close("Short", comment="Partial Exit at " + str.tostring(profitTarget) + "% profit", qty_percent=50)
partialExitPrice := na
// Plotting signals
plotshape(buySignal and showsignals ? AlphaTrend * 0.9999 : na, title='BUY', text='BUY', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(#0022FC, 0), textcolor=color.new(color.white, 0))
plotshape(sellSignal and showsignals ? AlphaTrend * 1.0001 : na, title='SELL', text='SELL', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.maroon, 0), textcolor=color.new(color.white, 0))
plotshape(currentPosition == "long" and high >= partialExitPrice ? high : na, title='PARTIAL EXIT LONG', text='PARTIAL', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.orange, 0), textcolor=color.new(color.white, 0))
plotshape(currentPosition == "short" and low <= partialExitPrice ? low : na, title='PARTIAL EXIT SHORT', text='PARTIAL', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(color.orange, 0), textcolor=color.new(color.white, 0))
// Alerts
alertcondition(buySignal, title='BUY Signal', message='KAMA crossed above AlphaTrend - BUY!')
alertcondition(sellSignal, title='SELL Signal', message='KAMA crossed below AlphaTrend - SELL!')
alertcondition((currentPosition == "long" and high >= partialExitPrice) or (currentPosition == "short" and low <= partialExitPrice), title='Partial Exit', message='Profit target reached - Closing half position!')