ডাবল এমএসিডি স্টকআরএসআই ট্রেডিং কৌশল

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

সারসংক্ষেপ

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

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

ট্রেডিং সিগন্যালগুলি নিম্নলিখিত বিষয়গুলির উপর ভিত্তি করেঃ

  • ডুয়াল এমএসিডিঃ দ্রুত এমএসিডি স্বল্প লুকব্যাক পিরিয়ড ব্যবহার করে, ধীর এমএসিডি মসৃণ প্রভাবের জন্য দীর্ঘ লুকব্যাক পিরিয়ড ব্যবহার করে।

  • স্টকআরএসআইঃ অতিরিক্ত ক্রয়/অতিরিক্ত বিক্রয়ের আরএসআই স্তরগুলি সনাক্ত করার জন্য আরএসআই উচ্চ / নিম্ন পরিসীমা গণনা করে।

প্রবেশের নিয়ম:

  • লংঃ দ্রুত এমএসিডি শূন্য রেখার উপরে ক্রস করে এবং ধীর এমএসিডি শূন্য রেখার উপরে ক্রস করে। স্টকআরএসআই ওভারসোল্ড এবং কে ডি এর উপরে ক্রস করে। আপট্রেন্ডে।

  • সংক্ষিপ্তঃ দ্রুত এমএসিডি শূন্য রেখার নীচে ক্রস করে এবং ধীর এমএসিডি শূন্য রেখার নীচে ক্রস করে। স্টকআরএসআই ওভারকোপড এবং কে ডি এর নীচে ক্রস করে। ডাউনট্রেন্ডে।

সুবিধা

  • ডাবল এমএসিডি উচ্চতর সংকেত মানের জন্য মিথ্যা ব্রেকআউট এড়ায়।

  • স্টোকআরএসআই অতিরিক্ত ক্রয়/অতিরিক্ত বিক্রয়ের মাত্রা চিহ্নিত করে যাতে তাড়া এড়ানো যায়।

  • সামগ্রিক প্রবণতা দিক বিবেচনা করে প্রতি-প্রবণতা ক্ষতি হ্রাস।

  • ক্রস-টাইমফ্রেম ভ্যালিডেশন সিগন্যালের কার্যকারিতা উন্নত করে।

  • স্টপ লস ঝুঁকি নিয়ন্ত্রণ করে।

ঝুঁকি

  • এমএসিডি মিথ্যা সংকেত প্রবণ, আরও যাচাইয়ের প্রয়োজন।

  • দুর্বল স্টকআরএসআই প্যারামিটার ট্রেড মিস করতে পারে।

  • স্টপ লস লেভেল খুব সংরক্ষণশীল বা আক্রমণাত্মক হতে পারে।

  • ডায়নামিক স্টপগুলির জন্য অবস্থানের ব্যবস্থাপনা নেই।

উন্নতিঃ

  1. ভলিউম বা এমএ ঢালের মত ফিল্টার যোগ করুন।

  2. অপ্টিমাইজ করুন অথবা অন্যান্য দোলক যোগ করুন।

  3. গতিশীল স্টপ লস ট্র্যাকিং।

  4. পারফরম্যান্সের উপর ভিত্তি করে অবস্থানের আকার যোগ করুন।

অপ্টিমাইজেশন

অপ্টিমাইজ করার জন্য প্রধান ক্ষেত্রঃ

  1. সূচক প্যারামিটার অপ্টিমাইজ করুন।

  2. মিথ্যা সংকেত দূর করার জন্য ফিল্টার যোগ করুন।

  3. ডায়নামিক ট্রেইলিংয়ের জন্য স্টপ অপ্টিমাইজ করুন।

  4. কৌশল কর্মক্ষমতা উপর ভিত্তি করে অবস্থান আকার অন্তর্ভুক্ত করুন।

  5. অটো অপ্টিমাইজেশনের জন্য মেশিন লার্নিং যোগ করুন।

সংক্ষিপ্তসার

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


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

//@version=2



//This strategy is an ongoing work in progress. Last updated 8/6/16.
//Feel free to modify it as you see fit, if you do borrow code then send me a link so I 
//can see and maybe borrow some of your code to improve this.
//Thanks to ChrisMoody who I stole the code for setting custom resolution from.
//
//more info in comments at end of script





strategy("MACDouble & StochRSI w/ safeties v0.3", overlay=true)

source = close
useCurrentRes = input(true, title="Uncheck to use custom res./intrv. for 2nd MACD indicator")
resCustom = input(title="Resolution/interval to use for 2nd MACD:",  defval="45")
res = useCurrentRes ? timeframe.period : resCustom

useCurrentRes2 = input(true, title="Uncheck to use custom res/intrv for StochRSI")
resCustom2 = input(title="Resolution to use for StochRSI indicator:",  defval="45")
res2 = useCurrentRes2 ? timeframe.period : resCustom2


//MACD1
fastLength = input(10, title="MACD fast length")
slowlength = input(21, title="MACD slow length")
sigLength = input(9, title="MACD signal length")

MACD = ema(source, fastLength) - ema(source, slowlength)
signal = sma(MACD, sigLength)
delta = MACD - signal



//MACD2
fastLength2 = input(31, title= "2nd MACD fast length")
slowlength2 = input(63, title= "2nd MACD slow length")
sigLength2 = input(30, title= "2nd MACD signal length")

MACD2 = ema(source, fastLength2) - ema(source, slowlength2)
signal2 = sma(MACD2, sigLength2)
delta2 = MACD2 - signal2

MACDRes = security(syminfo.tickerid, res, MACD2)
signalRes = security(syminfo.tickerid,res, signal2)
deltaRes = security(syminfo.tickerid, res, delta2)


uptrend = (close + high)/(close[1] + high[2])
downtrend = (close + low)/(close[1] + low[2])

smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(11, minval=1)
lengthStoch = input(11, minval=1)
src = close

rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
RSI_buyTrig = input(90)
RSI_sellTrig = input(20)

kRes = security(syminfo.tickerid, res2, k)
dRes = security(syminfo.tickerid, res2, d)


if (delta > 0) and (year>2012) and (deltaRes > 0) and (uptrend > 1) and (  kRes and dRes < RSI_buyTrig) and (kRes > dRes)
    strategy.entry("buy", strategy.long, comment="buy")
    

if (delta < 0) and (year>2012) and (deltaRes < 0) and (downtrend < 1) and ( kRes and dRes > RSI_sellTrig) and (kRes < dRes)
    strategy.entry("sell", strategy.short, comment="sell")
	strategy.exit("sell", loss = 9000)



//  RELEASE NOTES, ETC
//
// The core starting idea for this backtesting script came from the desire to have two traditional
//MACD indicators: one 'fast' and one 'slow'. The slow one is to pretty much smooth out noisy signals
//so that short term changes in price are ignored (ideally). 
//	A brief version history
//		v0.1 - Basic two MACD indicators script
//      v0.2 - Added StochRSI indicator
//      v0.21- Added primitive uptrend/downtrend safety condition 
//      v0.22- Added changable time resolution for MACDslow
//      v0.23- Added exit safeties conditional on loss threshold   
//      v0.3 - Added changeable resolution for StochRSI
//	Future changes planned for next release:
//		-Fine tuning exit safeties
//      -Major overhaul of trade logic/triggers (may be forked as a different script)
//
//I am more than happy to discuss any difficulties you are having, questions about the script, or improvement suggestions.
//I am not a coder and my background is actually in economics, so feel free to debug ;)
//Feel free to tip me on the indcluded bitcoin address on TV as well
// tradingview.com/u/RyanMartin 
// rjmarti2@millersville.edu


আরো