এই কৌশলটি মুভিং এভারেজ এবং অপেক্ষাকৃত শক্তিশালী সূচকগুলির সুবিধাগুলিকে পুরোপুরি ব্যবহার করে, ট্রেন্ড সনাক্তকরণ এবং ট্র্যাকিংয়ের জন্য। এটি কেবলমাত্র দুটি সূচক প্রয়োজন যা প্রবণতার বিচার করতে এবং প্রবেশ / প্রস্থানগুলির সময়কাল নির্বাচন করতে পারে। এই কৌশলটি স্বল্প-মেয়াদী বাজারের গোলমাল দ্বারা বিভ্রান্ত না হয়ে মধ্য-দীর্ঘ লাইনের দামের প্রবণতা ধরে রাখার লক্ষ্যে তৈরি করা হয়েছে।
এই কৌশলটি তিনটি ভিন্ন পিরিয়ডের ইএমএ গড় ব্যবহার করে, ইএমএ-এ পিরিয়ড সবচেয়ে ছোট, ইএমএ-বি পরবর্তী, ইএমএ-সি দীর্ঘতম। যখন সংক্ষিপ্ত পিরিয়ডের ইএমএ-এ দীর্ঘতম পিরিয়ডের ইএমএ-বি অতিক্রম করে, তখন দামটি একটি উত্থানের প্রবণতাতে থাকে, তখন এটি আরও বেশি করতে পারে; বিপরীতভাবে, যখন ইএমএ-এ ইএমএ-বি অতিক্রম করে, তখন দামটি একটি পতনের প্রবণতাতে পরিণত হয়, তখন এটি খালি করতে পারে। ত্রুটিপূর্ণ সংকেত হিসাবে, এটি দীর্ঘতম পিরিয়ডের ইএমএ-সিও প্রবর্তন করে, কেবলমাত্র যখন দাম ইএমএ-সি অতিক্রম করে তখনই প্রবেশের বিষয়টি বিবেচনা করা হয়।
এই কৌশলটি RSI সূচকগুলির সাথেও মিলিত হয় যা প্রস্থানের সময়কে চিহ্নিত করে। যখন মাল্টি-হেড অবস্থান থাকে, তখন RSI 70 লাইন অতিক্রম করলে এটি বন্ধ হয়ে যায়; যখন খালি-হেড অবস্থান থাকে, তখন RSI 30 লাইন অতিক্রম করলে এটি বন্ধ হয়ে যায়। এটি প্রবণতা লাভকে লক করতে পারে এবং ক্ষতির আরও বিস্তার রোধ করতে পারে।
RSI প্যারামিটারগুলিকে অপ্টিমাইজ করে বা অতিরিক্ত ফিল্টারিং শর্ত যুক্ত করে এই ঝুঁকিগুলি হ্রাস করা যেতে পারে। কৌশলগুলি প্রবণতা, সমর্থন এবং প্রতিরোধের মতো প্রযুক্তিগত বিশ্লেষণের পদ্ধতিগুলির সাথে একত্রিত হয়ে কৌশলটির কার্যকারিতা উন্নত করতে পারে।
এই কৌশলটি প্রবণতা ট্র্যাকিং এবং ওভারবয় ওভারসোল্ড সূচকগুলিকে একত্রিত করে, কেবলমাত্র দুটি সহজ সূচক প্রয়োজন যা প্রবণতার বিচার এবং ক্যাপচার করতে পারে। প্যারামিটার অপ্টিমাইজেশন এবং নিয়ম অপ্টিমাইজেশনের মাধ্যমে, এটি সহজ থাকার সময় কার্যকারিতা ব্যাপকভাবে বাড়িয়ে তুলতে পারে। এটি একটি খুব ব্যবহারিক প্রবণতা ট্র্যাকিং কৌশল টেমপ্লেট যা মাঝারি এবং দীর্ঘ লাইন বিনিয়োগকারীদের জন্য উপযুক্ত।
/*backtest
start: 2023-08-26 00:00:00
end: 2023-09-25 00:00:00
period: 2h
basePeriod: 15m
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/
//@author Alorse
//@version=5
// strategy(title='Tendency EMA + RSI [Alorse]', shorttitle='Tendece EMA + RSI [Alorse]', overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, initial_capital=1000, default_qty_value=20, commission_type=strategy.commission.percent, commission_value=0.01)
// Bollinger Bands
len = input.int(14, minval=1, title='Length', group='RSI')
src = input.source(close, 'Source', group='RSI')
rsi = ta.rsi(src, len)
// Moving Averages
len_a = input.int(10, minval=1, title='EMA A Length', group='Moving Averages')
out_a = ta.ema(close, len_a)
plot(out_a, title='EMA A', color=color.purple)
len_b = input.int(20, minval=1, title='EMA B Length', group='Moving Averages')
out_b = ta.ema(close, len_b)
plot(out_b, title='EMA B', color=color.orange)
len_c = input.int(100, minval=1, title='EMA C Length', group='Moving Averages')
out_c = ta.ema(close, len_c)
plot(out_c, title='EMA B', color=color.green)
// Strategy Conditions
stratGroup = 'Strategy'
showLong = input.bool(true, title='Long entries', group=stratGroup)
showShort = input.bool(false, title='Short entries', group=stratGroup)
closeAfterXBars = input.bool(true, title='Close after X # bars', tooltip='If trade is in profit', group=stratGroup)
xBars = input.int(24, title='# bars')
entryLong = ta.crossover(out_a, out_b) and out_a > out_c and close > open
exitLong = rsi > 70
entryShort = ta.crossunder(out_a, out_b) and out_a < out_c and close < open
exitShort = rsi < 30
bought = strategy.opentrades[0] == 1 and strategy.position_size[0] > strategy.position_size[1]
entry_price = ta.valuewhen(bought, open, 0)
var int nPastBars = 0
if strategy.position_size > 0
nPastBars := nPastBars + 1
nPastBars
if strategy.position_size == 0
nPastBars := 0
nPastBars
if closeAfterXBars
exitLong := nPastBars >= xBars and close > entry_price ? true : exitLong
exitLong
exitShort := nPastBars >= xBars and close < entry_price ? true : exitShort
exitShort
// Long Entry
strategy.entry('Long', strategy.long, when=entryLong and showLong)
strategy.close('Long', when=exitLong)
// Short Entry
strategy.entry('Short', strategy.short, when=entryShort and showShort)
strategy.close('Short', when=exitShort)