মূল্যের পরিবর্তনের উপর ভিত্তি করে অভিযোজিত সুইং ট্রেডিং কৌশল


সৃষ্টির তারিখ: 2023-12-04 14:34:13 অবশেষে সংশোধন করুন: 2023-12-04 14:34:13
অনুলিপি: 0 ক্লিকের সংখ্যা: 672
1
ফোকাস
1619
অনুসারী

মূল্যের পরিবর্তনের উপর ভিত্তি করে অভিযোজিত সুইং ট্রেডিং কৌশল

ওভারভিউ

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

কৌশল নীতি

  1. একটি চ্যানেল সীমানা হিসাবে মূল্যের চূড়ান্ত পয়েন্ট চিহ্নিত করুন। যখন দাম একটি নতুন উচ্চ বা একটি নতুন নিম্ন তৈরি করে, তখন এই পয়েন্টটিকে একটি চ্যানেল সীমানা হিসাবে চিহ্নিত করুন।
  2. সামগ্রিক প্রবণতার দিকনির্দেশনা নির্ধারণের জন্য স্ব-অনুকূলিতকরণীয় অস্থিরতা সূচক এমএ গণনা করুন। এমএ মান যত বেশি হবে ততই এটি ঝড়ের পর্যায়ে রয়েছে।
  3. যখন দাম চ্যানেলের উপরের দিকে উঠে যায়, তখন এটি একটি ক্রয় সংকেত দেয়। যখন দাম চ্যানেলের নীচের দিকে উঠে যায়, তখন এটি একটি বিক্রয় সংকেত দেয়।
  4. স্টপ লস সেট করুন: লং পজিশনের স্টপ লস সেট করুন প্রবেশ মূল্যের ১% হিসাবে।

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

  1. মূল্য চ্যানেলগুলি স্ব-অনুকূলিতকরণযোগ্য এবং প্রবণতা পরিবর্তনের সঠিক মূল্যায়ন করতে পারে।
  2. উর্ধ্বমুখী সূচকগুলি বড় প্রবণতা নির্ধারণ করে এবং ঝাঁকুনির প্রবণতার মধ্যে বড় দিকটি মিস করা এড়ায়।
  3. বিপরীতমুখী কৌশল, মূল্যের স্বল্পমেয়াদী প্রতিক্রিয়া ধরার জন্য উপযুক্ত।

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

  1. বড় ধরনের ধারাবাহিক পতনের ক্ষেত্রে, একাধিক স্টপ পয়েন্ট ট্রিগার করা সহজ, যার ফলে বড় ক্ষতি হয়।
  2. এই পরিস্থিতিতে প্রায়ই ক্রয়-বিক্রয় এবং লেনদেনের মাধ্যমে লেনদেনের খরচ বাড়তে থাকে।
  3. এই পদ্ধতিতে, ট্রেডিংয়ের সময়টি ম্যানুয়ালি নির্ধারণ করা হয় এবং সম্পূর্ণ স্বয়ংক্রিয় ট্রেডিংয়ের ঝুঁকি রয়েছে।

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

  1. MA এর প্যারামিটারগুলিকে অপ্টিমাইজ করুন যাতে এটি সামগ্রিক প্রবণতা সম্পর্কে আরও ভাল বিচার করতে পারে।
  2. ক্যান্সার প্রতিরোধের জন্য ক্যান্সার প্রতিরোধের জন্য ক্যান্সার প্রতিরোধের জন্য ক্যান্সার প্রতিরোধের জন্য ক্যান্সার প্রতিরোধক
  3. মেশিন লার্নিং মডেল যোগ করা, প্যারামিটারগুলির গতিশীল অপ্টিমাইজেশন করা।

সারসংক্ষেপ

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

কৌশল সোর্স কোড
/*backtest
start: 2023-11-03 00:00:00
end: 2023-12-03 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// @version = 4
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TradingGroundhog



//  ||---   Cash & Date:
cash_amout = 10000
pyramid_val = 1
cash_given_per_lot = cash_amout/pyramid_val
startDate = input(title="Start Date",defval=13)
startMonth = input(title="Start Month",defval=9)
startYear = input(title="Start Year",defval=2021)
afterStartDate = (time >= timestamp(syminfo.timezone,startYear, startMonth, startDate, 0, 0))
//  ||------------------------------------------------------------------------------------------------------



//  ||---   Strategy:
strategy(title="TradingGroundhog - Strategy & Fractal V1 - Short term", overlay=true, max_bars_back = 4000, max_labels_count=500, commission_type=strategy.commission.percent, commission_value=0.00,default_qty_type=strategy.cash, default_qty_value= cash_given_per_lot, pyramiding=pyramid_val)
//  ||------------------------------------------------------------------------------------------------------



//  ||---   Fractal Recognition:
filterBW = input(true, title="filter Bill Williams Fractals:")
filterFractals = input(true, title="Filter fractals using extreme method:")
length = input(2, title="Extreme Window:")
regulartopfractal = high[4] < high[3] and high[3] < high[2] and high[2] > high[1] and high[1] > high[0]
regularbotfractal = low[4] > low[3] and low[3] > low[2] and low[2] < low[1] and low[1] < low[0]
billwtopfractal = filterBW ? false : (high[4] < high[2] and high[3] < high[2] and high[2] > high[1] and high[2] > high[0] ? true : false)
billwbotfractal = filterBW ? false : (low[4] > low[2] and low[3] > low[2] and low[2] < low[1] and low[2] < low[0] ? true : false)
ftop = filterBW ? regulartopfractal : regulartopfractal or billwtopfractal
fbot = filterBW ? regularbotfractal : regularbotfractal or billwbotfractal
topf = ftop ? high[2] >= highest(high, length) ? true : false : false
botf = fbot ? low[2] <= lowest(low, length) ? true : false : false
filteredtopf = filterFractals ? topf : ftop
filteredbotf = filterFractals ? botf : fbot
//  ||------------------------------------------------------------------------------------------------------



//  ||---   V1 : Added Swing High/Low Option
ShowSwingsHL = input(true)
highswings = filteredtopf == false ? na : valuewhen(filteredtopf == true, high[2], 2) < valuewhen(filteredtopf == true, high[2], 1) and valuewhen(filteredtopf == true, high[2], 1) > valuewhen(filteredtopf == true, high[2], 0)
lowswings = filteredbotf == false ? na : valuewhen(filteredbotf == true, low[2], 2) > valuewhen(filteredbotf == true, low[2], 1) and valuewhen(filteredbotf == true, low[2], 1) < valuewhen(filteredbotf == true, low[2], 0)
//---------------------------------------------------------------------------------------------------------



//  ||---   V2 : Plot Lines based on the fractals.
showchannel = input(true)
//---------------------------------------------------------------------------------------------------------



//  ||---   ZigZag:
showZigZag = input(true)
//----------------------------------------------------------------------------------------------------------



//  ||---   Fractal computation:
istop = filteredtopf ? true : false
isbot = filteredbotf ? true : false
topcount = barssince(istop)
botcount = barssince(isbot)
vamp = input(title="VolumeMA",  defval=2)
vam = sma(volume, vamp)
fractalup = 0.0
fractaldown = 0.0
up = high[3]>high[4] and high[4]>high[5] and high[2]<high[3] and high[1]<high[2] and volume[3]>vam[3]
down = low[3]<low[4] and low[4]<low[5] and low[2]>low[3] and low[1]>low[2] and volume[3]>vam[3]
fractalup :=  up ? high[3] : fractalup[1] 
fractaldown := down ? low[3] : fractaldown[1]
//----------------------------------------------------------------------------------------------------------



//  ||---   Fractal save:
fractaldown_save = array.new_float(0)
for i = 0 to 4000
    if array.size(fractaldown_save) < 3
        if array.size(fractaldown_save) == 0
            array.push(fractaldown_save, fractaldown[i])
        else 
            if fractaldown[i] != array.get(fractaldown_save, array.size(fractaldown_save)-1)
                array.push(fractaldown_save, fractaldown[i])
if array.size(fractaldown_save) < 3
    array.push(fractaldown_save, fractaldown)
    array.push(fractaldown_save, fractaldown)
fractalup_save = array.new_float(0)
for i = 0 to 4000
    if array.size(fractalup_save) < 3
        if array.size(fractalup_save) == 0
            array.push(fractalup_save, fractalup[i])
        else 
            if fractalup[i] != array.get(fractalup_save, array.size(fractalup_save)-1)
                array.push(fractalup_save, fractalup[i])
if array.size(fractalup_save) < 3
    array.push(fractalup_save, fractalup)
    array.push(fractalup_save, fractalup)
Bottom_1 = array.get(fractaldown_save,  0)
Bottom_2 = array.get(fractaldown_save,  1)
Bottom_3 = array.get(fractaldown_save,  2)
Top_1 = array.get(fractalup_save, 0)
Top_2 = array.get(fractalup_save, 1)
Top_3 = array.get(fractalup_save, 2)
//----------------------------------------------------------------------------------------------------------



//  ||---   Fractal Buy Sell Signal:
bool Signal_Test = false
bool Signal_Test_OUT_TEMP = false
var Signal_Test_TEMP = false
longLossPerc = input(title="Long Stop Loss (%)", minval=0.0, step=0.1, defval=0.01) * 0.01
if filteredbotf and open < Bottom_1 and (Bottom_1 - open) / Bottom_1 >= longLossPerc
    Signal_Test := true
if filteredtopf and open > Top_1
    Signal_Test_TEMP := true
if filteredtopf and Signal_Test_TEMP
    Signal_Test_TEMP := false
    Signal_Test_OUT_TEMP := true
//----------------------------------------------------------------------------------------------------------



//  ||---   Plotting:
//plotshape(filteredtopf, style=shape.triangledown, location=location.abovebar, color=color.red, text="•", offset=0)
//plotshape(filteredbotf, style=shape.triangleup, location=location.belowbar, color=color.lime, text="•", offset=0)
//plotshape(ShowSwingsHL ? highswings : na, style=shape.triangledown, location=location.abovebar, color=color.maroon, text="H", offset=0)
//plotshape(ShowSwingsHL ? lowswings : na, style=shape.triangleup, location=location.belowbar, color=color.green, text="L", offset=0)
plot(showchannel ? (filteredtopf ? high[2] : na) : na, color=color.black, offset=0)
plot(showchannel ? (filteredbotf ? low[2] : na) : na, color=color.black, offset=0)
plot(showchannel ? (highswings ? high[2] : na) : na, color=color.black, offset=-2)
plot(showchannel ? (lowswings ? low[2] : na) : na, color=color.black, offset=-2)
plotshape(Signal_Test, style=shape.flag, location=location.belowbar, color=color.yellow, offset=0)
plotshape(Signal_Test_OUT_TEMP, style=shape.flag, location=location.abovebar, color=color.white, offset=0)
//----------------------------------------------------------------------------------------------------------



//  ||---   Buy And Sell:
strategy.entry(id="Long", long=true, when = Signal_Test and afterStartDate)
strategy.close_all(when = Signal_Test_OUT_TEMP and afterStartDate)
//----------------------------------------------------------------------------------------------------------