
এই কৌশলটি একটি গতিশীল ট্র্যাকিং স্টপ-ড্রপ কৌশল যা এটিআর (অর্ধ-সত্যিকারের তরঙ্গদৈর্ঘ্য) সূচকের উপর ভিত্তি করে। এটি এটিআর মানের মাধ্যমে গতিশীলভাবে স্টপ-ড্রপ অবস্থানগুলি সামঞ্জস্য করে এবং ইএমএ গড়ের সাথে ট্রেডিং সিগন্যালের নিশ্চিতকরণ করে। কৌশলটি নমনীয় অবস্থান পরিচালনার সমর্থন করে, যা বিভিন্ন বাজার পরিবেশ এবং ট্রেডিং জাতের উপর নির্ভর করে কাস্টমাইজড ক্রয়-বিক্রয় পরিমাণের জন্য উপযুক্ত। এটি 5 মিনিট থেকে 2 ঘন্টা পর্যন্ত মাঝারি সময়কালের উপর কাজ করার জন্য বিশেষভাবে উপযুক্ত, যা কার্যকরভাবে বাজার প্রবণতা ক্যাপচার করতে পারে।
কৌশলটির মূল যুক্তি নিম্নলিখিত মূল উপাদানগুলির উপর ভিত্তি করে:
এই কৌশলটি এটিআর সূচক এবং ইএমএ সমান্তরালের সাথে মিলিত হয়ে একটি নির্ভরযোগ্য গতিশীল ট্র্যাকিং স্টপ লস সিস্টেম তৈরি করে। এর সুবিধা হ’ল বাজারের ওঠানামার সাথে খাপ খাইয়ে নিতে সক্ষম, একটি ভাল ঝুঁকি ব্যবস্থাপনার ব্যবস্থা রয়েছে এবং একই সাথে অপারেশনটির নমনীয়তা বজায় রাখা। যদিও কিছু অন্তর্নিহিত ঝুঁকি রয়েছে, তবে ক্রমাগত অপ্টিমাইজেশন এবং পরিমার্জনের মাধ্যমে কৌশলটি বিভিন্ন বাজারের পরিস্থিতিতে স্থিতিশীল পারফরম্যান্স বজায় রাখার সম্ভাবনা রয়েছে। ব্যবসায়ীরা রিয়েল-স্টোর ব্যবহারের আগে প্যাকেজগুলি পুরোপুরি পরীক্ষা করার পরামর্শ দেয় এবং নির্দিষ্ট ব্যবসায়ের জাতের বৈশিষ্ট্য অনুসারে লক্ষ্যবস্তু অপ্টিমাইজেশন করে।
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-10 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title='ADET GİRMELİ Trend İz Süren Stop Strategy', overlay=true, overlay=true,default_qty_type = strategy.fixed, default_qty_value = 1)
// Inputs
a = input(9, title='Key Value. "This changes the sensitivity"')
c = input(3, title='ATR Period')
h = input(false, title='Signals from Heikin Ashi Candles')
xATR = ta.atr(c)
nLoss = a * xATR
src = h ? request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close, lookahead=barmerge.lookahead_off) : close
xATRTrailingStop = 0.0
iff_1 = src > nz(xATRTrailingStop[1], 0) ? src - nLoss : src + nLoss
iff_2 = src < nz(xATRTrailingStop[1], 0) and src[1] < nz(xATRTrailingStop[1], 0) ? math.min(nz(xATRTrailingStop[1]), src + nLoss) : iff_1
xATRTrailingStop := src > nz(xATRTrailingStop[1], 0) and src[1] > nz(xATRTrailingStop[1], 0) ? math.max(nz(xATRTrailingStop[1]), src - nLoss) : iff_2
pos = 0
iff_3 = src[1] > nz(xATRTrailingStop[1], 0) and src < nz(xATRTrailingStop[1], 0) ? -1 : nz(pos[1], 0)
pos := src[1] < nz(xATRTrailingStop[1], 0) and src > nz(xATRTrailingStop[1], 0) ? 1 : iff_3
xcolor = pos == -1 ? color.red : pos == 1 ? color.green : color.blue
ema = ta.ema(src, 1)
above = ta.crossover(ema, xATRTrailingStop)
below = ta.crossover(xATRTrailingStop, ema)
buy = src > xATRTrailingStop and above
sell = src < xATRTrailingStop and below
barbuy = src > xATRTrailingStop
barsell = src < xATRTrailingStop
// Alım ve Satım Sinyalleri
buySignal = src > xATRTrailingStop and above
sellSignal = src < xATRTrailingStop and below
// Kullanıcı girişi
sell_quantity = input.int(1, title="Sell Quantity", minval=1)
buy_quantity = input.int(1, title="Buy Quantity", minval=1)
// Portföy miktarı (örnek simülasyon verisi)
var portfolio_quantity = 0
// Sinyal üretimi (örnek sinyal, gerçek stratejinizle değiştirin)
indicator_signal = (src > xATRTrailingStop and above) ? "buy" :
(src < xATRTrailingStop and below) ? "sell" : "hold"
// Şartlara göre al/sat
if indicator_signal == "buy" and portfolio_quantity < buy_quantity
strategy.entry("Buy Order", strategy.long, qty=buy_quantity)
portfolio_quantity := portfolio_quantity + buy_quantity
if indicator_signal == "sell" and portfolio_quantity >= sell_quantity
strategy.close("Buy Order", qty=sell_quantity)
portfolio_quantity := portfolio_quantity - sell_quantity
// Plot buy and sell signals
plotshape(buy, title='Buy', text='Buy', style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.white, 0), size=size.tiny)
plotshape(sell, title='Sell', text='Sell', style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny)
// Bar coloring
barcolor(barbuy ? color.rgb(6, 250, 14) : na)
barcolor(barsell ? color.red : na)
// Alerts
alertcondition(buy, 'UT Long', 'UT Long')
alertcondition(sell, 'UT Short', 'UT Short')
// Strategy Entry and Exit
if buy
strategy.entry('Long', strategy.long)
if sell
strategy.entry('Short', strategy.short)
// Optional Exit Conditions
if sell
strategy.close('Long')
if buy
strategy.close('Short')