
এই কৌশলটি একটি সম্পূর্ণ ট্রেডিং কৌশল অর্জনের জন্য ট্রেডিংয়ের দিকনির্দেশের জন্য ডিএমআই নির্দেশক এবং RSI নির্দেশকের সাথে একত্রিত হয়। যখন ডিএমআই নির্দেশক ট্রেন্ডিংয়ের দিকে নির্দেশ করে এবং আরএসআই নির্দেশকটি ওভার-বাউস বা ওভার-সোল্ড দেখায়, তখন ওভার-বাউস বা শূন্য থাকে। মুনাফা লক করার জন্য একটি চলমান স্টপ-লস সেট করা হয়।
এটি একটি পরিপক্ক এবং স্থিতিশীল ট্রেন্ড ফলোয়ার কৌশল যার নিম্নলিখিত সুবিধাগুলি রয়েছেঃ
এই কৌশলটির কিছু ঝুঁকি রয়েছে যা সম্পর্কে সতর্ক থাকা দরকারঃ
এই কৌশলটি নিম্নলিখিত দিকগুলি থেকেও উন্নত করা যেতে পারেঃ
এই কৌশলটি সামগ্রিকভাবে একটি স্থিতিশীল প্রবণতা অনুসরণ কৌশল, DMI দ্বারা প্রবণতা দিক নির্ণয়, RSI দ্বারা ওভারবাইট এবং ওভারসোল্ড নির্ণয়, যাতে মধ্যম দীর্ঘ লাইন ট্রেডিং সুযোগ দখল। একই সাথে মুনাফা লক করার জন্য একটি চলমান ক্ষতি সেট করুন। এই কৌশলটি প্যারামিটার নির্বাচন সহজ, ট্রেডিং নিয়ম পরিষ্কার এবং সহজেই অনুশীলন করা যায়। তবে পর্যাপ্ত সময়মত বন্ধ এবং ক্ষতির ঝুঁকিও রয়েছে। কিছু প্যারামিটার এবং মডেল অপ্টিমাইজেশনের মাধ্যমে এই কৌশলটির কার্যকারিতা আরও ভাল করা যায়।
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-24 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © YingYangJPN
//@version=5
strategy("DMI and RSI Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// DMI indikatörünü tanımlayalım
lensig = input.int(14, title="ADX Smoothing", minval=1, maxval=50)
len = input.int(14, minval=1, title="DI Length")
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / trur)
minus = fixnan(100 * ta.rma(minusDM, len) / trur)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)
trailing_stop_loss_factor = input.float(0.50, "Trailing Stop Loss Factor", step = 0.01)
// RSI indikatörünü tanımlayalım
rsiLength = input.int(14, minval=1, title="RSI Length")
rsiSource = input(close, title="RSI Source")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsiValue = ta.rsi(rsiSource, rsiLength)
// Uzun pozisyon açma koşullarını tanımlayalım
longCondition1 = rsiValue < rsiOversold // RSI oversold seviyesinin altındaysa
longCondition2 = adx > 20 // ADX 20'den büyükse
longCondition3 = minus > plus
// Kısa pozisyon açma koşullarını tanımlayalım
shortCondition1 = rsiValue > rsiOverbought // RSI overbought seviyesinin üstündeyse
shortCondition2 = adx > 20 // ADX 20'den büyükse
shortCondition3 = plus > minus
// Uzun pozisyon açalım
if longCondition1 and longCondition2 and longCondition3
strategy.entry("Long", strategy.long)
// Kısa pozisyon açalım
if shortCondition1 and shortCondition2 and shortCondition3
strategy.entry("Short", strategy.short)
// Trailing Stop Loss
longTrailingStopLoss = strategy.position_avg_price * (1 - trailing_stop_loss_factor / 100)
shortTrailingStopLoss = strategy.position_avg_price * (1 + trailing_stop_loss_factor / 100)
if strategy.position_size > 0
strategy.exit("Exit Long", "Long", stop = longTrailingStopLoss)
if strategy.position_size < 0
strategy.exit("Exit Short", "Short", stop = shortTrailingStopLoss)
// DMI ve RSI indikatörlerini grafiğe çizelim
plot(adx, color=#F50057, title="ADX")
plot(plus, color=#2962FF, title="+DI")
plot(minus, color=#FF6D00, title="-DI")
plot(rsiValue, color=#9C27B0, title="RSI")
hline(rsiOverbought, title="RSI Overbought Level", color=#E91E63, linestyle=hline.style_dashed)
hline(rsiOversold, title="RSI Oversold Level", color=#4CAF50, linestyle=hline.style_dashed)