কনফিগারযোগ্য BB+RSI+Aroon কৌশল ব্যাকটেস্ট

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

সারসংক্ষেপ

এই কৌশলটি বোলিংজার ব্যান্ড (বিবি), আপেক্ষিক শক্তি সূচক (আরএসআই) এবং অ্যারন সূচককে একত্রিত করে।

কিভাবে কাজ করে

  1. বিবি-এর নীচের ব্যাণ্ডে দামের লং সিগন্যাল দেখা যাচ্ছে।

  2. আরএসআই ওভারসোল্ড লাইন অতিক্রম করে দীর্ঘ সময় ধরে নিশ্চিত করে।

  3. অ্যারন ক্রসওভার দীর্ঘ নিশ্চিতকরণ দেখায়।

  4. সব তিনটি শর্ত পূরণ হলে দীর্ঘ প্রবেশ।

  5. বিবি এর উপরের ব্যাণ্ডে কম সিগন্যাল দেখাচ্ছে।

  6. আরএসআই ওভারকপ লাইন অতিক্রম করলে সংক্ষিপ্ত নিশ্চিতকরণ পাওয়া যায়।

  7. অ্যারন ক্রসওভারে সংক্ষিপ্ত নিশ্চিতকরণ দেখাচ্ছে।

  8. যখন তিনটি শর্ত পূরণ হবে তখনই সংক্ষিপ্ত প্রবেশ।

সুবিধা

  • অপ্টিমাইজেশনের জন্য কনফিগারযোগ্য পরামিতি
  • একাধিক নিশ্চিতকরণ সঠিকতা উন্নত করে
  • বিভিন্ন বাজারের অবস্থার সাথে খাপ খাইয়ে নেওয়া
  • সহজ যুক্তি বাস্তবায়ন করা সহজ

ঝুঁকি

  • খারাপ প্যারামিটার টিউনিং মিথ্যা সংকেত সৃষ্টি করতে পারে
  • একাধিক সূচক বিলম্ব যোগ করে, দ্রুত বিপরীত হতে পারে
  • বিপরীতমুখী ব্যবসায়ের ঘনত্ব এবং খরচ বৃদ্ধি পায়

অপ্টিমাইজেশান নির্দেশাবলী

  • অপ্টিমাম প্যারামিটারগুলির জন্য বাজার এবং সময়সীমা জুড়ে ব্যাকটেস্ট
  • প্রতিটি সূচকের অবদান মূল্যায়ন করুন, ছাড়পত্রগুলি সরান
  • প্যারামিটার অপ্টিমাইজেশনের জন্য মেশিন লার্নিং অন্বেষণ করুন
  • গণনা কমাতে কোড অপ্টিমাইজ করুন
  • টেস্টের সময়সীমার বিভিন্ন পরামিতি পরীক্ষা করুন

সিদ্ধান্ত

কৌশলটি একাধিক সূচকগুলির শক্তিকে শক্তিশালী এন্ট্রি সিগন্যালে একত্রিত করে। প্যারামিটার অপ্টিমাইজেশান, অতিরিক্ত সূচক হ্রাস এবং কোড অপ্টিমাইজেশনের মাধ্যমে আরও উন্নতি কর্মক্ষমতা উন্নত করতে পারে। সামগ্রিকভাবে একটি কার্যকর কাস্টমাইজযোগ্য সমাধান ট্রেডিং।


/*backtest
start: 2023-09-13 00:00:00
end: 2023-09-20 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Developed by Marco Jarquin as part of Arkansas 22 Project for Binary Options
// CBRA for binary options (Configurable Bollinger Bands, RSI and Aroon)

//@version=4
// ====================================================================================

//strategy("A22.CBRA.Strat", overlay=true, initial_capital=10000, currency="USD", calc_on_every_tick=true, default_qty_type=strategy.cash, default_qty_value=4000, commission_type=strategy.commission.cash_per_order, commission_value=0)

// Aroonish Parameters
// ====================================================================================

Aroonish_length = input(4, minval=1, title="Aroonish Lenght")
Aroonish_ConfVal = input(50, minval=0, maxval=100, step=25, title="Aroonish Confirmation Value")
Aroonish_upper = 100 * (-highestbars(high, Aroonish_length+1) + Aroonish_length)/Aroonish_length
Aroonish_lower = 100 * (-lowestbars(low, Aroonish_length+1) + Aroonish_length)/Aroonish_length

// Aroonish confirmations
// ====================================================================================
Aroonish_ConfLong = (Aroonish_lower >= Aroonish_ConfVal) and (Aroonish_upper < Aroonish_lower)
Aroonish_ConfShrt = (Aroonish_upper >= Aroonish_ConfVal) and (Aroonish_upper > Aroonish_lower)

plotshape(crossover(Aroonish_lower, Aroonish_upper), color = color.red, style = shape.triangledown, location = location.abovebar, size = size.auto, title = "Ar-B")
plotshape(crossover(Aroonish_upper, Aroonish_lower), color = color.green, style = shape.triangleup, location = location.belowbar, size = size.auto, transp = 0, title = "Ar-S")

// RSI Parameters
// ====================================================================================
RSI_length = input(4, title="RSI Lenght")
RSI_overSold = input(20, title="RSI Oversold Limit")
RSI_overBought = input(80, title="RSI Overbought Limit" )

RSI = rsi(close, RSI_length)

plotshape(crossover(RSI, RSI_overSold), color = color.orange, style = shape.square, location = location.belowbar, size = size.auto, title = "RSI-B")
plotshape(crossunder(RSI, RSI_overBought), color = color.orange, style = shape.square, location = location.abovebar, size = size.auto, transp = 0, title = "RSI-S")

// Bollinger Parameters
// ====================================================================================
BB_length = input(20, minval=1, title="Bollinger Lenght")
BB_mult = input(2.5, minval=0.1, maxval=50, step=0.1, title="Bollinger Std Dev")
// BB_bars = input(3, minval=1, maxval=5, title="Check bars after crossing")

BB_basis = sma(close, BB_length)
BB_dev = BB_mult * stdev(close, BB_length)

BB_upper = BB_basis + BB_dev
BB_lower = BB_basis - BB_dev

p1 = plot(BB_upper, color=color.blue)
p2 = plot(BB_lower, color=color.blue)

// Bars to have the operation open
// ====================================================================================
nBars = input(3, minval=1, maxval=30, title="Bars to keep the operation open")

// Strategy condition short or long
// ====================================================================================
ConditionShrt = ((crossunder(close, BB_upper) or crossunder(close[1], BB_upper[1])) and Aroonish_ConfShrt) and (crossunder(RSI, RSI_overBought) or crossunder(RSI[1], RSI_overBought[1]))
ConditionLong = ((crossover(close, BB_lower) or crossover(close[1], BB_lower[1])) and Aroonish_ConfLong) and (crossover(RSI, RSI_overSold) or crossover(RSI[1], RSI_overSold[1]))

plotshape(crossover(close, BB_lower), color = color.blue, style = shape.circle, location = location.belowbar, size = size.auto, title = "BB-B")
plotshape(crossunder(close, BB_upper), color = color.blue, style = shape.circle, location = location.abovebar, size = size.auto, transp = 0, title = "BB-S")


// Make input options that configure backtest date range
// ====================================================================================
iMo = input(title="Start Month", type=input.integer, defval=1, minval=1, maxval=12)
iDy = input(title="Start Date", type=input.integer, defval=1, minval=1, maxval=31)
iYr = input(title="Start Year", type=input.integer, defval=(2020), minval=1800, maxval=2100)

eMo = input(title="End Month", type=input.integer, defval=1, minval=1, maxval=12)
eDy = input(title="End Date", type=input.integer, defval=1, minval=1, maxval=31)
eYr = input(title="End Year", type=input.integer, defval=(2021), minval=1800, maxval=2100)

// Look if the close time of the current bar falls inside the date range
// ====================================================================================
inDateRange = true


// Evaluates conditions to enter short or long
// ====================================================================================
if (inDateRange and ConditionLong)
    strategy.entry("A22.L", strategy.long)

if (inDateRange and ConditionLong[nBars])
    strategy.close("A22.L", comment="A22.L Exit")
    
if (inDateRange and ConditionShrt)
    strategy.entry("A22.S", strategy.short)

if (inDateRange and ConditionShrt[nBars])
    strategy.close("A22.S", comment="A22.S Exit")

if (not inDateRange)
    strategy.close_all()

আরো