উইকএন্ড রেঞ্জ ট্রেডিং কৌশল

লেখক:চাওঝাং, তারিখঃ 2023-09-13 11:53:09
ট্যাগঃ

এই কৌশলটি বিশেষভাবে পূর্বনির্ধারিত শতাংশ ব্যান্ডের উপর ভিত্তি করে দীর্ঘ / সংক্ষিপ্ত দিক নির্ধারণ করে সপ্তাহান্তে দামের ওঠানামা ট্রেড করে। এটি একটি সাধারণ ব্যাপ্তি ট্রেডিং সিস্টেম।

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

  1. পূর্ববর্তী শুক্রবারের বন্ধের উপর ভিত্তি করে শতাংশ ব্যাসার্ধ সেট করুন, উদাহরণস্বরূপ 4.5% আপ / ডাউন।

  2. যদি দাম আপসাইড ব্যান্ড অতিক্রম করে তবে শর্ট এন্ট্রি করুন, যদি ডাউনসাইড ব্যান্ডের নিচে থাকে তবে লং এন্ট্রি করুন।

  3. বিদ্যমান দিকের নতুন ব্যান্ডে পৌঁছানোর সময় অবস্থান যোগ করুন।

  4. যখন জমাকৃত লাভের সীমা পৌঁছবে, যেমন ১০% তখন মুনাফা অর্জন করুন।

  5. একসাথে সর্বোচ্চ দু'টি পজিশনের অনুমতি দিন, প্রতিটি দিক থেকে একটি। সোমবারের আগে সব বন্ধ করুন।

উপকারিতা:

  1. নির্দিষ্ট শতাংশের ব্যবধান যান্ত্রিক ব্যবসায়ের অনুমতি দেয়।

  2. মাল্টি-লেভেল এন্ট্রিগুলি আরও ভাল ব্যয়ের ভিত্তি অর্জন করে।

  3. সময়কাল স্থিতিশীল, মৌলিক দ্বারা প্রভাবিত হয় না।

ঝুঁকি:

  1. একক ট্রেড ক্ষতির আকার সীমাবদ্ধ করতে অক্ষম, বড় হারাতে ট্রেড ঝুঁকি।

  2. স্থির পরামিতিগুলি সময়ের মধ্যে পরিবর্তনশীল অস্থিরতার সাথে মানিয়ে নিতে ব্যর্থ হয়।

  3. সময়ের সাথে সাথে পর্যায়ক্রমিকতা পরিবর্তন হতে পারে, মডেলটি অবৈধ করে।

সংক্ষেপে, এই কৌশলটি প্রায়শই সপ্তাহান্তে চক্রের ব্যবসায় করে তবে ধারাবাহিকভাবে মুনাফায় লকিংয়ের চ্যালেঞ্জের মুখোমুখি হয়।


/*backtest
start: 2023-01-01 00:00:00
end: 2023-09-12 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//Copyright Boris Kozak 
// strategy("XBT Weekend Trade Strategy", overlay=true, default_qty_type=strategy.percent_of_equity,)
strategy.initial_capital=50000
leverage = input(10,"Leverage")
profitTakingPercentThreshold = input(0.10,"Profit Taking Percent Threshold")

//****Code used for setting up backtesting.****///
testStartYear = input(2017, "Backtest Start Year")
testStartMonth = input(12, "Backtest Start Month")
testStartDay = input(10, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(2025, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(30, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

// A switch to control background coloring of the test period
testPeriodBackground = input(title="Color Background?", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FFFF : na
bgcolor(testPeriodBackgroundColor, transp=50)

testPeriod() => true
    
//****END Code used for setting up backtesting.****///


//*** Main entry point is here***//
// Figure out how many days since the Friday close 
days_since_friday = if dayofweek == 6
    0
else 
    if dayofweek == 7
        1
    else
        if dayofweek == 1
            2
        else
            if dayofweek == 2
                3
            else
                if dayofweek == 3
                    4
                else
                    if dayofweek == 4
                        5
                    else
                        6
    
// Grab the Friday close price
fridaycloseprice = security(syminfo.ticker,'D',close[days_since_friday])
plot(fridaycloseprice)

// Only perform backtesting during the window specified 
if testPeriod()
    // If we've reached out profit threshold, exit all positions 
    if ((strategy.openprofit/strategy.initial_capital) > profitTakingPercentThreshold)
        strategy.close_all()
    // Only execute this trade on saturday and sunday (UTC)
    if (dayofweek == 7.0 or dayofweek == 1.0)
        // Begin - Empty position (no active trades)
        if (strategy.position_size == 0)
            // If current close price > threshold, go short 
            if ((close>fridaycloseprice*1.045))
                strategy.entry("Short Entry", strategy.short, leverage)
            else
                // If current close price < threshold, go long
                if (close<(fridaycloseprice*0.955))
                    strategy.entry("Long Entry",strategy.long, leverage)
        // Begin - we already have a position
        if (abs(strategy.position_size) > 0)
            // We are short 
            if (strategy.position_size < 0)
                if ((close>strategy.position_avg_price*1.045))
                    // Add to the position
                    strategy.entry("Adding to Short Entry", strategy.short, leverage)
            else
                if ((close<strategy.position_avg_price*0.955))
                    strategy.entry("Adding to Long Entry",strategy.long,leverage)
    // On Monday, if we have any open positions, close them 
    if (dayofweek==2.0)
        strategy.close_all()
 






আরো