ভোল্টেবিলিটি ফিল্টারড মার্কেট টাইমিং কৌশল

লেখক:চাওঝাং, তারিখঃ 2024-01-15 12:27:47
ট্যাগঃ

img

সারসংক্ষেপ

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

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

  1. গত ১০০ দিনের মধ্যে SPY এর ঐতিহাসিক অস্থিরতা গণনা করুন।
  2. যদি বর্তমান অস্থিরতা গত ১০০ দিনের অস্থিরতার ৯৫তম শতাংশের চেয়ে বেশি হয়, তাহলে সেই ট্রেডিং দিনটি ফিল্টার করুন, লং পজিশন বন্ধ করুন
  3. যদি অস্থিরতা ৯৫তম শতাংশের নিচে থাকে, তাহলে লং পজিশন প্রবেশ করান

সুবিধা বিশ্লেষণ

ফিল্টার ছাড়াই সহজ ক্রয় এবং হোল্ডের তুলনায়, এই কৌশলটি ২৮ বছরের ব্যাকটেস্টের সময়কালে বার্ষিক রিটার্ন উন্নত করেছে (7.95% বনাম 9.92%) এবং সর্বাধিক ড্রডাউন উল্লেখযোগ্যভাবে হ্রাস পেয়েছে (50.79% বনাম 31.57%) । এটি দেখায় যে একটি অস্থিরতা ফিল্টার যুক্ত করা রিটার্ন উন্নত করতে পারে এবং কিছু পরিমাণে ঝুঁকি হ্রাস করতে পারে।

ঝুঁকি বিশ্লেষণ

মূল ঝুঁকিগুলি উদ্বায়ীতা গণনা পদ্ধতির নির্ভুলতা এবং ফিল্টার প্যারামিটার টিউনিং থেকে আসে। যদি উদ্বায়ীতা গণনাটি ভুল হয় তবে ফিল্টারটি ব্যর্থ হবে। যদি ফিল্টার প্যারামিটারগুলি খারাপভাবে (খুব সংরক্ষণশীল বা আক্রমণাত্মক) টিউন করা হয় তবে এটি কৌশল রিটার্নকে প্রতিকূলভাবে প্রভাবিত করতে পারে। এছাড়াও, অতীতের কর্মক্ষমতা ভবিষ্যতের ফলাফলের গ্যারান্টি দেয় না।

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

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

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

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


/*backtest
start: 2023-01-08 00:00:00
end: 2024-01-14 00:00:00
period: 1d
basePeriod: 1h
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 Sunil Halai
//
// This script has been created to demonstrate the effectiveness of using market regime filters in your trading strategy, and how they can improve your returns and lower your drawdowns
//
// This strategy adds a simple filter (The historical volatility filter, which can be found on my trading profile) to a traditional buy and hold strategy of the index SPY. There are other filters
// that could also be added included a long term moving average / percentile rank filter / ADX filter etc, to improve the returns further.
//
// The filter added closes our long position during periods of volatility that exceed the 95th percentile (or in the top 5% of volatile days)
//
// Have included the back test results since 1993 which is 28 years of data at the time of writing,  Comparing  buy and hold of the SPY (S&P 500), to improved by and hold offered here.
//
// Traditional buy and hold:
//
// Return per year:     7.95   % (ex Dividends)
// Total return :       851.1  %
// Max drawdown:        50.79  %
//
// 'Modified' buy and hold (this script):
//
// Return per year:     9.92    % (ex Dividends)
// Total return:        1412.16 %
// Max drawdown:        31.57   %
//
// Feel free to use some of the market filters in my trading profile to improve and refine your strategies further, or make a copy and play around with the code yourself. This is just 
// a simple example for demo purposes.
//

//@version=4
strategy(title = "Simple way to beat the market [STRATEGY]", shorttitle = "Beat The Market [STRATEGY]", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, currency="USD", default_qty_value=100)


upperExtreme = input(title = "Upper percentile filter (Do not trade above this number)", type = input.integer, defval = 95)
lookbackPeriod = input(title = "Lookback period", type = input.integer, defval = 100)

annual = 365
per = timeframe.isintraday or timeframe.isdaily and timeframe.multiplier == 1 ? 1 : 7
hv = lookbackPeriod * stdev(log(close / close[1]), 10) * sqrt(annual / per)

filtered = hv >= percentile_nearest_rank(hv, 100, upperExtreme)

if(not(filtered))
    strategy.entry("LONG", strategy.long)
else
    strategy.close("LONG")

আরো