RSI ডাবল ট্র্যাক অসিলেটর লং এবং শর্ট টু-ওয়ে ট্রেডিং কৌশল


সৃষ্টির তারিখ: 2023-10-25 11:57:46 অবশেষে সংশোধন করুন: 2023-10-25 11:57:46
অনুলিপি: 1 ক্লিকের সংখ্যা: 627
1
ফোকাস
1617
অনুসারী

RSI ডাবল ট্র্যাক অসিলেটর লং এবং শর্ট টু-ওয়ে ট্রেডিং কৌশল

ওভারভিউ

আরএসআই ডাবল-রেল স্ট্রাইকিং লাইন লম্বা দ্বি-মুখী ট্রেডিং কৌশলটি একটি কৌশল যা আরএসআই সূচক ব্যবহার করে দ্বি-মুখী বাণিজ্য করে। এই কৌশলটি আরএসআই সূচকের ওভার-বিক্রয় ওভার-বিক্রয় নীতির মাধ্যমে, দ্বি-রেল সেটআপ এবং সমান্তরাল ট্রেডিং সিগন্যালের সাথে মিলিত, কার্যকর দ্বি-মুখী খোলা এবং পজিশনের জন্য।

কৌশল নীতি

এই কৌশলটি মূলত আরএসআই সূচকটির ওভার-বই ওভার-সেল নীতির উপর ভিত্তি করে ট্রেডিং সিদ্ধান্ত গ্রহণ করে। কৌশলটি প্রথমে আরএসআই সূচকের মান ভার্সি, এবং দ্বি-ট্র্যাকের উচ্চতর ট্র্যাক sn এবং নিম্নতর ট্র্যাক ln গণনা করে। যখন আরএসআই মান নীচে ট্র্যাকের নীচে প্রবেশ করে তখন একটি মাল্টিসিগন্যান্ট তৈরি হয় এবং যখন আরএসআই মান sn ট্র্যাকের উপরে প্রবেশ করে তখন একটি ফাঁকা সংকেত তৈরি হয়।

কৌশলটি K-লাইনগুলির উত্থান-পতন পরিবর্তনগুলিও সনাক্ত করে এবং আরও বেশি খালি সংকেত তৈরি করে। বিশেষত, যখন K-লাইন নীচে থেকে উপরে উঠে যায় তখন একটি দীর্ঘ লজিক এবং যখন K-লাইন উপরে থেকে নীচে যায় তখন একটি শর্ট লজিক তৈরি করে। এছাড়াও, কৌশলটি একটি প্যারামিটার সুইচ সরবরাহ করে যা কেবলমাত্র, কেবলমাত্র খালি বা উল্টো দিকে যেতে পারে।

একাধিক কমানোর সংকেত উত্পন্ন করার পরে, কৌশলটি সংকেতের সংখ্যা পরিসংখ্যান করবে এবং পজিশন খোলার সংখ্যা নিয়ন্ত্রণ করবে। প্যারামিটারগুলির মাধ্যমে বিভিন্ন পজিশন নিয়ম সেট করা যেতে পারে। পজিশনের শর্তে স্টপ, স্টপ লস, মুভিং স্টপ লস ইত্যাদি অন্তর্ভুক্ত রয়েছে। বিভিন্ন স্টপ লস শতাংশ সেট করা যেতে পারে।

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

কৌশলগত সুবিধা

  • আরএসআই সূচক ব্যবহার করে ওভার-বই ওভার-সেল নীতি ব্যবহার করে, যুক্তিসঙ্গত অবস্থানে আরও কমানোর অবস্থান স্থাপন করুন।
  • ডাবল রেল সেটআপ ভুল সংকেত এড়াতে। উপরের রেলটি মাল্টি হেড পজিশনকে খুব তাড়াতাড়ি সমতল করতে বাধা দেয় এবং নীচের রেলটি খালি হেড পজিশনকে খুব তাড়াতাড়ি সমতল করতে বাধা দেয়।
  • মিডল লাইন ট্রেডিং সিগন্যাল ফিল্টার মিথ্যা ব্রেকআপ শেয়ারের দাম মিডল লাইন ভেঙে একটি সংকেত তৈরি করে, মিথ্যা সংকেত এড়াতে
  • পরিসংখ্যান সংকেত বার এবং সংরক্ষণাগার বার, ঝুঁকি নিয়ন্ত্রণ
  • কাস্টমাইজড স্টপ-অফ-লস শতাংশ, আয়-ঝুঁকি নিয়ন্ত্রণযোগ্য।
  • মোবাইল স্টপ লস ট্র্যাকিং স্টপ লস, আরও লাভ লকিং।
  • বিভিন্ন বাজারের অবস্থার সাথে খাপ খাইয়ে নেওয়ার জন্য শুধুমাত্র অতিরিক্ত, খালি বা উল্টো সিগন্যাল ব্যবহার করা যায়।
  • অটোমেটেড ট্রেডিং সিস্টেম, ম্যানুয়াল অপারেটিং খরচ কমানো।

কৌশলগত ঝুঁকি

  • RSI সূচকটি বিপরীতমুখী ব্যর্থতার ঝুঁকিতে রয়েছে। RSI ওভার-বই ওভার-সোল্ড অঞ্চলে প্রবেশ করে তবে এটি অবশ্যই বিপরীতমুখী হবে না।
  • ফিক্সড স্টপ লস পয়েন্টের ঝুঁকি রয়েছে। ভুলভাবে স্টপ লস সেট করা হলে অকাল ব্রেকিং বা স্টপ লস হতে পারে।
  • প্রযুক্তিগত সূচকগুলির উপর নির্ভর করে, প্যারামিটার অপ্টিমাইজেশনের ঝুঁকি রয়েছে। সূচক প্যারামিটারগুলি ভুলভাবে সেট করা হয়েছে, যা কৌশলটির কার্যকারিতা প্রভাবিত করে।
  • একসাথে একাধিক শর্তের কারণে, ভর্তি ফরম খারিজ হওয়ার ঝুঁকি রয়েছে।
  • স্বয়ংক্রিয় লেনদেনের সিস্টেমে অস্বাভাবিক ত্রুটির ঝুঁকি রয়েছে।

উপরের ঝুঁকির জন্য, আপনি প্যারামিটার সেটিং অপ্টিমাইজ করতে পারেন, স্টপ স্টপ লস কৌশলটি সামঞ্জস্য করতে পারেন, তরলতা পরিস্রাবণ বৃদ্ধি করতে পারেন, সংকেত উত্পাদন লজিকটি অপ্টিমাইজ করতে পারেন, অস্বাভাবিক ত্রুটি পর্যবেক্ষণ যুক্ত করতে পারেন।

কৌশল অপ্টিমাইজেশনের দিকনির্দেশনা

  • RSI সূচক প্যারামিটারগুলিকে বিভিন্ন পর্যায়ের প্যারামিটারগুলির জন্য অনুকূলিতকরণ পরীক্ষা করুন।
  • বিভিন্ন স্টপস্টপ লস শতাংশ সেটিং পরীক্ষা করুন।
  • ট্রেডিং ভলিউম বা রিটার্নের হার বাড়ানোর জন্য এবং লিকুইডিটির অভাব এড়ানোর জন্য।
  • সিগন্যাল জেনারেশন লজিক অপ্টিমাইজ করুন, সমান্তরাল ক্রস পদ্ধতি উন্নত করুন।
  • আরো সময়কালের জন্য পুনরাবৃত্তি পরীক্ষা করে স্থিতিশীলতা যাচাই করুন।
  • সিগন্যালের কার্যকারিতা উন্নত করতে অন্যান্য সূচক যুক্ত করার কথা ভাবুন।
  • পজিশন ম্যানেজমেন্ট স্ট্র্যাটেজিতে যোগদান করুন।
  • “অসাধারণ ত্রুটিগুলি পর্যবেক্ষণ করুন”।
  • স্বয়ংক্রিয় ক্ষতি ট্র্যাকিং অ্যালগরিদম অপ্টিমাইজ করুন।
  • মেশিন লার্নিংকে উন্নত করার জন্য একটি কৌশল বিবেচনা করুন।

সারসংক্ষেপ

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

কৌশল সোর্স কোড
/*backtest
start: 2023-09-24 00:00:00
end: 2023-10-24 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
// Learn more about Autoview and how you can automate strategies like this one here: https://autoview.with.pink/
// strategy("Autoview Build-a-bot - 5m chart", "Strategy", overlay=true, pyramiding=2000, default_qty_value=10000)
// study("Autoview Build-a-bot", "Alerts")

///////////////////////////////////////////////
//* Backtesting Period Selector | Component *//
///////////////////////////////////////////////

//* https://www.tradingview.com/script/eCC1cvxQ-Backtesting-Period-Selector-Component *//
//* https://www.tradingview.com/u/pbergden/ *//
//* Modifications made *//

testStartYear = input(1, "Backtest Start Year") 
testStartMonth = input(11, "Backtest Start Month")
testStartDay = input(10, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(77777777, "Backtest Stop Year")
testStopMonth = input(11, "Backtest Stop Month")
testStopDay = input(15, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

testPeriod() => true

/////////////////////////////////////
//* Put your strategy logic below *//
/////////////////////////////////////
RSIlength = input(1,title="RSI Period Length") 
price = close
vrsi = (rsi(price, RSIlength))
src = close
len = input(2, minval=1, title="Length")

up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

rsin = input(12)
sn = 100 - rsin
ln = 0 + rsin

// Put your long and short rules here
longLocic = crossunder(rsi, ln)
shortLogic = crossover(rsi, sn)

//////////////////////////
//* Strategy Component *//
//////////////////////////

isLong = input(true, "Longs Only")
isShort = input(false, "Shorts Only")
isFlip = input(false, "Flip the Opens")

long = longLocic
short = shortLogic

if isFlip
    long := shortLogic
    short := longLocic
else
    long := longLocic
    short := shortLogic

if isLong
    long := long
    short := na

if isShort
    long := na
    short := short
    
////////////////////////////////
//======[ Signal Count ]======//
////////////////////////////////

sectionLongs = 0
sectionLongs := nz(sectionLongs[1])
sectionShorts = 0
sectionShorts := nz(sectionShorts[1])

if long
    sectionLongs := sectionLongs + 1
    sectionShorts := 0

if short
    sectionLongs := 0
    sectionShorts := sectionShorts + 1

//////////////////////////////
//======[ Pyramiding ]======//
//////////////////////////////

pyrl = input(2, "Pyramiding less than") // If your count is less than this number
pyre = input(1, "Pyramiding equal to") // If your count is equal to this number
pyrg = input(1000000, "Pyramiding greater than") // If your count is greater than this number

longCondition = long and sectionLongs <= pyrl or long and sectionLongs >= pyrg or long and sectionLongs == pyre ? 1 : 0 and vrsi < 20
shortCondition = short and sectionShorts <= pyrl or short and sectionShorts >= pyrg or short and sectionShorts == pyre ? 1 : 0

////////////////////////////////
//======[ Entry Prices ]======//
////////////////////////////////

last_open_longCondition = na
last_open_shortCondition = na
last_open_longCondition := longCondition ? close : nz(last_open_longCondition[1])
last_open_shortCondition := shortCondition ? close : nz(last_open_shortCondition[1])

////////////////////////////////////
//======[ Open Order Count ]======//
////////////////////////////////////

sectionLongConditions = 0
sectionLongConditions := nz(sectionLongConditions[1])
sectionShortConditions = 0
sectionShortConditions := nz(sectionShortConditions[1])

if longCondition
    sectionLongConditions := sectionLongConditions + 1
    sectionShortConditions := 0

if shortCondition
    sectionLongConditions := 0
    sectionShortConditions := sectionShortConditions + 1
    
///////////////////////////////////////////////
//======[ Position Check (long/short) ]======//
///////////////////////////////////////////////

last_longCondition = na
last_shortCondition = na
last_longCondition := longCondition ? time : nz(last_longCondition[1])
last_shortCondition := shortCondition ? time : nz(last_shortCondition[1])

in_longCondition = last_longCondition > last_shortCondition
in_shortCondition = last_shortCondition > last_longCondition

/////////////////////////////////////
//======[ Position Averages ]======//
/////////////////////////////////////

totalLongs = 0.0
totalLongs := nz(totalLongs[1])
totalShorts = 0.0
totalShorts := nz(totalShorts[1])
averageLongs = 0.0
averageLongs := nz(averageLongs[1])
averageShorts = 0.0
averageShorts := nz(averageShorts[1]) 

if longCondition
    totalLongs := totalLongs + last_open_longCondition
    totalShorts := 0.0

if shortCondition
    totalLongs := 0.0
    totalShorts := totalShorts + last_open_shortCondition

averageLongs := totalLongs / sectionLongConditions
averageShorts := totalShorts / sectionShortConditions

/////////////////////////////////
//======[ Trailing Stop ]======//
/////////////////////////////////

isTS = input(false, "Trailing Stop")
tsi = input(100, "Activate Trailing Stop Price (%). Divided by 100 (1 = 0.01%)") / 100 
ts = input(100, "Trailing Stop (%). Divided by 100 (1 = 0.01%)") / 100

last_high = na
last_low = na
last_high_short = na
last_low_short = na
last_high := not in_longCondition ? na : in_longCondition and (na(last_high[1]) or high > nz(last_high[1])) ? high : nz(last_high[1])
last_high_short := not in_shortCondition ? na : in_shortCondition and (na(last_high[1]) or high > nz(last_high[1])) ? high : nz(last_high[1])
last_low := not in_shortCondition ? na : in_shortCondition and (na(last_low[1]) or low < nz(last_low[1])) ? low : nz(last_low[1])
last_low_short := not in_longCondition ? na : in_longCondition and (na(last_low[1]) or low < nz(last_low[1])) ? low : nz(last_low[1])

long_ts = isTS and not na(last_high) and low <= last_high - last_high / 100 * ts and longCondition == 0 and last_high >= averageLongs + averageLongs / 100 * tsi
short_ts = isTS and not na(last_low) and high >= last_low + last_low / 100 * ts and shortCondition == 0 and last_low <= averageShorts - averageShorts/ 100 * tsi

///////////////////////////////
//======[ Take Profit ]======//
///////////////////////////////

isTP = input(true, "Take Profit")
tp = input(125, "Take Profit (%). Divided by 100 (1 = 0.01%)") / 100
long_tp = isTP and close > averageLongs + averageLongs / 100 * tp and not longCondition
short_tp = isTP and close < averageShorts - averageShorts / 100 * tp and not shortCondition

/////////////////////////////
//======[ Stop Loss ]======//
/////////////////////////////

isSL = input(true, "Stop Loss")
sl = input(140, "Stop Loss (%). Divided by 100 (1 = 0.01%)") / 100
long_sl = isSL and close < averageLongs - averageLongs / 100 * sl and longCondition == 0
short_sl = isSL and close > averageShorts + averageShorts / 100 * sl and shortCondition == 0

/////////////////////////////////
//======[ Close Signals ]======//
/////////////////////////////////

longClose = long_tp or long_sl or long_ts ? 1 : 0
shortClose = short_tp or short_sl or short_ts ? 1: 0

///////////////////////////////
//======[ Plot Colors ]======//
///////////////////////////////

longCloseCol = na
shortCloseCol = na
longCloseCol := long_tp ? purple : long_sl ? maroon : long_ts ? blue : longCloseCol[1]
shortCloseCol := short_tp ? purple : short_sl ? maroon : short_ts ? blue : shortCloseCol[1]
tpColor = isTP and in_longCondition ? purple : isTP and in_shortCondition ? purple : white
slColor = isSL and in_longCondition ? red : isSL and in_shortCondition ? red : white

//////////////////////////////////
//======[ Strategy Plots ]======//
//////////////////////////////////

plot(isTS and in_longCondition ? averageLongs + averageLongs / 100 * tsi : na, "Long Trailing Activate", blue, style=3, linewidth=2)
plot(isTS and in_longCondition and last_high >= averageLongs +  averageLongs / 100 * tsi ? last_high - last_high / 100 * ts : na, "Long Trailing", fuchsia, style=2, linewidth=3)
plot(isTS and in_shortCondition ? averageShorts - averageShorts/ 100 * tsi : na, "Short Trailing Activate", blue, style=3, linewidth=2)
plot(isTS and in_shortCondition and last_low <= averageShorts - averageShorts/ 100 * tsi ? last_low + last_low / 100 * ts : na, "Short Trailing", fuchsia, style=2, linewidth=3)
plot(isTP and in_longCondition and last_high < averageLongs + averageLongs / 100 * tp ? averageLongs + averageLongs / 100 * tp : na, "Long TP", tpColor, style=3, linewidth=2)
plot(isTP and in_shortCondition and last_low > averageShorts - averageShorts / 100 * tp ? averageShorts - averageShorts / 100 * tp : na, "Short TP", tpColor, style=3, linewidth=2)
plot(isSL and in_longCondition and last_low_short > averageLongs - averageLongs / 100 * sl ? averageLongs - averageLongs / 100 * sl : na, "Long SL", slColor, style=3, linewidth=2)
plot(isSL and in_shortCondition and last_high_short < averageShorts + averageShorts / 100 * sl ? averageShorts + averageShorts / 100 * sl : na, "Short SL", slColor, style=3, linewidth=2)

///////////////////////////////
//======[ Alert Plots ]======//
///////////////////////////////

// plot(longCondition, "Long", green)
// plot(shortCondition, "Short", red)
// plot(longClose, "Long Close", longCloseCol)
// plot(shortClose, "Short Close", shortCloseCol)

///////////////////////////////////
//======[ Reset Variables ]======//
///////////////////////////////////

if longClose or not in_longCondition
    averageLongs := 0
    totalLongs := 0.0
    sectionLongs := 0
    sectionLongConditions := 0

if shortClose or not in_shortCondition
    averageShorts := 0
    totalShorts := 0.0
    sectionShorts := 0
    sectionShortConditions := 0

////////////////////////////////////////////
//======[ Strategy Entry and Exits ]======//
////////////////////////////////////////////

if testPeriod()
    strategy.entry("Long", 1, when=longCondition)
    strategy.entry("Short", 0,  when=shortCondition)
    strategy.close("Long", when=longClose)
    strategy.close("Short", when=shortClose)