RSI Moving Average ট্রেলিং স্টপ কৌশল

লেখক:চাওঝাং, তারিখ: ২০২৩-০৯-১৩ ১৪ঃ২৬ঃ৪৩
ট্যাগঃ

এই কৌশলটি প্রবণতা পক্ষপাতের জন্য আরএসআই এবং চলমান গড়কে একত্রিত করে এবং ঝুঁকি ব্যবস্থাপনার জন্য ট্রেলিং স্টপ যুক্ত করে। এটি অভিযোজনযোগ্য প্রস্থানগুলির সাথে প্রবণতা অনুসরণ করার লক্ষ্যে।

কৌশলগত যুক্তি:

  1. অতিরিক্ত ক্রয়/অতিরিক্ত বিক্রয়ের মাত্রা নির্ধারণের জন্য RSI গণনা করুন। 50 এর উপরে RSI বাউলিস্টের সংকেত দেয়।

  2. দ্রুত এবং ধীর গতির গড় গণনা করুন, গোল্ডেন ক্রস ষাঁড়ের প্রবণতা নির্দেশ করে।

  3. আরএসআই-এর ধারাবাহিক বৃদ্ধিও লং এন্ট্রি সূচক।

  4. প্রবেশের পর, স্টপ লস সেট করুন এবং লাভের লাইন নিন।

  5. দামের নিচে স্টপ লস ট্রেইল, উপরে মুনাফা ট্রেইল নিন।

  6. যখন দাম থামবে তখন বেরিয়ে আসুন অথবা মুনাফা নিন।

উপকারিতা:

  1. আরএসআই শীর্ষ এবং নীচে তাড়া এড়ায়।

  2. চলমান গড়গুলি প্রবণতার দিক নির্দেশ করে। সংমিশ্রণ সঠিকতা উন্নত করে।

  3. ট্রেলিং স্টপ/লাভ দামের সাথে গতিশীলভাবে সামঞ্জস্য করে।

ঝুঁকি:

  1. RSI এবং MAs বিভিন্ন বাজারে মিথ্যা সংকেত প্রবণ।

  2. ট্রেলিং স্টপ প্রস্থের জন্য সতর্কতার সাথে ক্যালিব্রেশন প্রয়োজন, খুব প্রশস্ত বা খুব সংকীর্ণ সমস্যাযুক্ত।

  3. ক্ষতির আকার সীমিত করতে অক্ষম, বড় ক্ষতির ঝুঁকি।

সংক্ষেপে, এই কৌশলটি আরএসআই এবং এমএকে একত্রিত করে এবং ঝুঁকি ব্যবস্থাপনার জন্য ট্রেলিং স্টপ ব্যবহার করে। শক্তিশালী অপ্টিমাইজেশন এবং ঝুঁকি নিয়ন্ত্রণের সাথে এটি ভাল ফলাফল অর্জন করতে পারে।


/*backtest
start: 2022-09-06 00:00:00
end: 2023-09-12 00:00:00
period: 4d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("RSI and MA Strategy with Trailing Stop Loss and Take Profit",
         overlay=true,
         initial_capital=1000,
         process_orders_on_close=true,
         default_qty_type=strategy.percent_of_equity,
         default_qty_value=100,
         commission_type=strategy.commission.percent,
         commission_value=0.1)

showDate = input(defval=true, title='Show Date Range')
timePeriod = time >= timestamp(syminfo.timezone, 2022, 1, 1, 0, 0)
notInTrade = strategy.position_size <= 0

//==================================Buy Conditions============================================

//RSI
length = input(14)
rsi = ta.rsi(close, length)
buyCondition1 = rsi > 50

//MA
SMA9 = ta.sma(close, 9)
SMA50 = ta.sma(close, 50)
SMA100 = ta.sma(close, 100)
plot(SMA9, color = color.green)
plot(SMA50, color = color.orange)
plot(SMA100, color = color.blue)
buyCondition2 = SMA9 > SMA50//ta.crossover(SMA9, SMA100)

//RSI Increase
increase = 5
buyCondition3 = (rsi > rsi[1] + increase)


if (buyCondition1 and buyCondition2 and buyCondition3 and timePeriod) //and buyCondition
    strategy.entry("Long", strategy.long)

//==================================Sell Conditions============================================

//Trailing Stop Loss and Take Profit
longTrailPerc = input.float(title='Trail Long Loss (%)', minval=0.0, step=0.1, defval=2) * 0.01
shortTrailPerc = input.float(title='Trail Short Loss (%)', minval=0.0, step=0.1, defval=1) * 0.01

longStopPrice = 0.0
shortStopPrice = 0.0

longStopPrice := if strategy.position_size > 0
    stopValue = close * (1 - longTrailPerc)
    math.max(stopValue, longStopPrice[1])
else
    0

shortStopPrice := if strategy.position_size < 0
    stopValue = close * (1 + shortTrailPerc)
    math.min(stopValue, shortStopPrice[1])
else
    999999


strategy.exit(id="Exit", stop = longStopPrice, limit = shortStopPrice)

আরো