মোমেন্টাম রিভার্সাল কৌশল


সৃষ্টির তারিখ: 2023-10-07 16:52:05 অবশেষে সংশোধন করুন: 2023-10-07 16:52:05
অনুলিপি: 0 ক্লিকের সংখ্যা: 673
1
ফোকাস
1617
অনুসারী

ওভারভিউ

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

কৌশল নীতি

এই কৌশলটি আরএসআই, স্টচ এবং এমএসিডি তিনটি সূচক ব্যবহার করে বর্তমান প্রবণতার দিকনির্দেশনা নির্ধারণ করে।

  • RSI (৭ তারিখ): RSI এর মান ৫০ এর বেশি হলে বাউন্স, ৫০ এর কম হলে বাউন্স
  • Stoch ((%K,14,3,3): %K এর মান 50 এর বেশি হলে বাজি, 50 এর কম হলে বাজি
  • MACD ((12,26,9): MACD হল Signal-এর চেয়ে বড়, Signal-এর চেয়ে ছোট

যখন তিনটি সূচক একই সাথে ঊর্ধ্বমুখী হয়, তখন বারটি সবুজ হয়; যখন তিনটি সূচক একই সাথে নিম্নমুখী হয়, তখন বারটি লাল হয়; যদি সূচক সংকেতগুলির মধ্যে পার্থক্য থাকে তবে এটি কালো হয়।

ট্রেডিং নিয়মগুলি নিম্নরূপ:

  • যখন বর্তমান বারটি সবুজ এবং পূর্ববর্তী বারটি কালো বা লাল হয়, তখন অতিরিক্ত প্রবেশ করুন, প্রবেশের মূল্যটি এই বারের উচ্চতম বিন্দুতে 0.01 যোগ করে
  • যখন বর্তমান বারটি লাল এবং পূর্ববর্তী বারটি কালো বা সবুজ হয়, তখন প্রবেশের মূল্যটি সেই বারটির সর্বনিম্ন বিন্দু থেকে ০.০১ কেটে নেওয়া হয়
  • যদি একটি লাল বা কালো বার দেখা যায়, তাহলে পলস পজিশন
  • খালি পজিশনের সময় যদি সবুজ বা কালো বার দেখা দেয়, তাহলে পজিশনটি খালি করে

এই কৌশলটি ATR ((7 দিনের গড়) ব্যবহার করে স্টপ লস স্টপ পজিশন সেট করে। স্টপ লস পজিশনটি ATR এর 1.5 গুণ এবং স্টপ লস পজিশনটি ATR এর 3 গুণ।

সামর্থ্য বিশ্লেষণ

এই কৌশলটির সুবিধাগুলো হলঃ

  1. একাধিক সূচক ব্যবহার করে প্রবণতা নির্ণয় করা যায়, যা ফালতু বিরতিগুলিকে কার্যকরভাবে ফিল্টার করতে পারে। যখন RSI, Stoch এবং MACD তিনটি সূচক একই সাথে উত্থান বা পতন হয়, তখন প্রবণতা বিপরীত হওয়ার সম্ভাবনা থাকে।

  2. এটিআর স্টপ লস স্টপ সেটিংটি ভাল। এটিআর কার্যকরভাবে বাজারের ওঠানামা পর্যবেক্ষণ করতে পারে, এটিআর এর বহুগুণে স্টপ লস সেটিং ব্যবহার করে, বাজার পরিস্থিতির গতিশীলতা অনুসারে স্টপ লস স্টপটি সামঞ্জস্য করতে পারে, যাতে স্টপ লস খুব স্বাচ্ছন্দ্যময় বা খুব সংকীর্ণ না হয়।

  3. ট্রেডিং লজিকটি সহজ, সহজেই বোঝা যায় এবং এটি স্বয়ংক্রিয় ট্রেডিং কৌশল হিসাবে ব্যবহার করা যেতে পারে।

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

এই কৌশলটি নিম্নলিখিত ঝুঁকিগুলিও বহন করেঃ

  1. একাধিক সূচক সংমিশ্রণ বিচারটি এমন পরিস্থিতিতে থাকতে পারে যেখানে পৃথক সূচকগুলি ভুল সংকেত দেয়, যার ফলে প্রবেশের সময়কে প্রভাবিত করে। সূচক প্যারামিটারগুলি সামঞ্জস্য করার জন্য বা অন্য সূচকগুলি যাচাই করার জন্য বিবেচনা করা যেতে পারে, যাতে ভুল সংকেত হ্রাস পায়।

  2. এটিআর আকারটি স্টপ লস থামার উপর একটি বড় প্রভাব ফেলে। যদি এটিআর সঠিকভাবে গণনা না করা হয়, তবে এটির আকারটি নিশ্চিত করার জন্য অন্যান্য সূচক যুক্ত করার বিষয়টি বিবেচনা করা যেতে পারে।

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

  4. ওভারফিট হওয়ার ঝুঁকি রয়েছে। পরামিতি এবং নিয়মের নির্ভরযোগ্যতা যাচাই করার জন্য পর্যাপ্ত ফিডব্যাক করা উচিত।

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

এই নীতিটি নিম্নলিখিত দিকগুলি থেকে উন্নত করা যেতে পারেঃ

  1. সূচকগুলিকে সামঞ্জস্য করা বা বাড়ানো, প্রবণতা বিপরীত হওয়ার সময় নির্ধারণের নির্ভুলতা বাড়ানো। যেমন, একটি বুলিন লাইন যুক্ত করা ওভারবই ওভারসোল্ড অবস্থা নির্ধারণের জন্য।

  2. এটিআর গণনা করার পদ্ধতিটি অপ্টিমাইজ করা হয়েছে যাতে এটি বাজারের অস্থিরতা আরও ভালভাবে অনুসরণ করতে পারে। যেমন এটিআর এবং দামের অনুপাত ব্যবহার করা।

  3. প্রবণতা নির্ধারণের সূচক যোগ করুন, যেমন একটি চলমান গড় প্রবণতা নির্ধারণের দিক যোগ করুন।

  4. তহবিল ব্যবস্থাপনা অপ্টিমাইজ করুন, যেমন প্রত্যাহারের ক্ষেত্রে অবস্থানের সমন্বয়।

  5. চক্র অপ্টিমাইজেশান, বিভিন্ন সময় চক্র প্যারামিটার স্থিতিশীলতা যাচাই

  6. আরও বেশি প্রজাতি এবং সময়কালের মধ্যে পুনরাবৃত্তি, কৌশলটির স্থিতিশীল নির্ভরযোগ্যতা পরীক্ষা করুন।

সারসংক্ষেপ

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

কৌশল সোর্স কোড
/*backtest
start: 2023-09-06 00:00:00
end: 2023-10-06 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/
// © jwitt98
//The PowerX strategy - based on the rules outlined in the book "The PowerX Strategy: How to Trade Stocks and Options in Only 15 Minutes a Day" by Markus Heitkoetter

//@version=5
strategy("PowerX", overlay=true)
strategy.initial_capital = 50000
longEntry = "Enter long"
shortEntry = "Enter short"
longExit = "Exit long"
shortExit = "Exit short"

//*********************************Begin inputs*********************************

//get time range inputs and set time range bool
timeRangeGroup = "Select the trading range"
startDate = input(timestamp("1 Jan 2021 00:00 +0000"), "Start date", "Select the start date for the trading range", "", timeRangeGroup)
endDate = input(timestamp("1 Jan 2050 00:00 +0000"), "End date", "Select the end date for the trading range", "", timeRangeGroup)
isInTimeRange = true

//get long/short inputs
positionsAllowedGroup = "Select the direction(s) of trades to allow"
isLongsAllowed = input.bool(true, "Allow long positions", "Check the box if you want to allow long positions", "", positionsAllowedGroup)
isShortsAllowed = input.bool(true, "Allow short positions", "Check the box if you want to allow short positions", "", positionsAllowedGroup)

//get the stop loss and profit target multiples.  Per the PowerX rules the ratio shoud be 1:2.  1.5 and 3 are defaults
adrMultuplesGroup="Select the multipliers for the stop loss and profit targets"
stopLossMultiple = input.float(1.5, "Stop loss multiple", 0.1, 10, 0.1, "The ADR is multiplied by the stop loss multiple to calculate the stop loss", group=adrMultuplesGroup)
profitTargetMultiple=input.float(3.0, "Profit target multiple", 0.1, 10, 0.1, "The ADR is multiplied by the profit target multiple to calculate the profit target", group=adrMultuplesGroup)

//get the option to use the money management stategy or not.  This is a fixed ratio type management system
moneyManagementGroup="Money management"
isUsingMoneyManagement=input.bool(false, "Use money management", "Check the box if you want to use a fixed ratio type money management system, such as the type described in PowerX", group=moneyManagementGroup)
initial_riskPercent=input.float(2.0, "Percent risk per trade", .1, 100, .1, "The percentage of capital you want to risk when starting out.  This will increase or decrease base on the money management rules.  Only applicable if money managent is used", group=moneyManagementGroup)/100
isRiskDowsideLimited=input.bool(false, "Keep risk at or above the set point", "Check the box if you don't want the risk to fall below the set \"risk per trade\" percentage, for example, when your equity is underwater. Only applicable if money management is used", "", moneyManagementGroup)
initial_riskPerTrade=initial_riskPercent * strategy.initial_capital 
riskFactor = 0.0
currentProfit = 0.0
currentRisk = 0.0

//*********************************End inputs*********************************

//*********************************Begin money management*********************************

if(isUsingMoneyManagement)
    currentProfit := strategy.equity - strategy.initial_capital
    if(currentProfit < 0)
        currentProfit:=math.abs(currentProfit)
        riskFactor := 0.5*(math.pow(1+8*currentProfit/(2*initial_riskPerTrade), 0.5)+1)
        currentRisk := 1/riskFactor * initial_riskPercent * strategy.initial_capital
        if(isRiskDowsideLimited)
            currentRisk := initial_riskPerTrade
    else
        riskFactor := 0.5*(math.pow(1+8*currentProfit/(2*initial_riskPerTrade), 0.5)+1)
        currentRisk := riskFactor * initial_riskPercent * strategy.initial_capital
        
plot(strategy.equity, "Strategy equity")
plot(currentRisk, "Current risk")
plot(riskFactor, "Risk Factor")

//*********************************End money management*********************************


//*********************************Begin indicators*********************************
//4 indicators are used in this strategy, RSI(7), Stochastics(14, 3, 3), MACD(12, 26, 9), and ADR(7)

rsiVal = ta.rsi(close, 7)//this checks out
plot(rsiVal, "RSI(7)", color.lime)

stochKVal = ta.sma(ta.sma(ta.stoch(close, high, low, 14),3),3)//this formula checks out
plot(stochKVal, "Stoch %K", color.lime)

[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)
plot(histLine, "MACD Hist", color.lime)

adr = ta.sma(high, 7) - ta.sma(low, 7)
plot(adr, "Average daily range", color.orange)


//*********************************End indicators*********************************

//*********************************Define the bar colors*********************************

greenBar = rsiVal > 50 and stochKVal > 50 and histLine > 0
redBar = rsiVal < 50 and stochKVal < 50 and histLine < 0
blackBar = not greenBar and not redBar

color currentBarColor = switch
    greenBar => color.green
    redBar => color.red
    blackBar => color.gray //because black is too hard to see in dark mmode
    => color.yellow
    
barcolor(currentBarColor)

//*********************************End defining the bar colors*********************************

//*********************************Define the entry, stop loss and profit target*********************************

longStopLimit = high + .01
longProfitTarget = high + (profitTargetMultiple * adr)
longStopLoss = high - (stopLossMultiple * adr)

shortStopLimit = low - .01
shortProfitTarget = low - (profitTargetMultiple * adr)
shortStopLoss = low + (stopLossMultiple * adr)

qtyToTrade= math.floor(currentRisk / (stopLossMultiple * adr))//only if using money management
if(qtyToTrade * high > strategy.equity)
    qtyToTrade := math.floor(strategy.equity / high)

//*********************************End defining stop loss and profit targets*********************************

//*********************************Execute trades, set rules, stop loss and profit targets*********************************

if (greenBar and not greenBar[1] and isInTimeRange and isLongsAllowed)
    if(isUsingMoneyManagement)
        strategy.order(longEntry, strategy.long, qtyToTrade, limit=longStopLimit, stop=longStopLimit)
        //strategy.order(longEntry, strategy.long, qtyToTrade, stop=longStopLimit)
    else
        strategy.order(longEntry, strategy.long, limit=longStopLimit,stop=longStopLimit)
        //strategy.order(longEntry, strategy.long, stop=longStopLimit)
    strategy.exit("Long limit/stop", from_entry=longEntry, limit=longProfitTarget, stop=longStopLoss)
    

if(blackBar or redBar)
    strategy.cancel(longEntry)
    strategy.close(longEntry, longExit)
    

if (redBar and not redBar[1] and isInTimeRange and isShortsAllowed)
    if(isUsingMoneyManagement)
        strategy.order(shortEntry, strategy.short, qtyToTrade, limit=shortStopLimit, stop=shortStopLimit)
        //strategy.order(shortEntry, strategy.short, qtyToTrade, stop=shortStopLimit)
    else
        strategy.order(shortEntry, strategy.short, limit=shortStopLimit, stop=shortStopLimit)
        //strategy.order(shortEntry, strategy.short, stop=shortStopLimit)
    strategy.exit("Short limit/stop", from_entry=shortEntry, limit=shortProfitTarget, stop=shortStopLoss)

if(blackBar or greenBar)
    strategy.cancel(shortEntry)
    strategy.close(shortEntry, shortExit)
    

//*********************************End execute trades, set rules, stop loss and profit targets*********************************