একাধিক সময়সীমার মধ্যে সমর্থন/প্রতিরোধ এবং গতির সূচকগুলির উপর ভিত্তি করে ট্রেন্ড অনুসরণকারী কৌশল

লেখক:চাওঝাং, তারিখঃ 2024-03-08 17:41:26
ট্যাগঃ

img

কৌশল ওভারভিউ

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

কৌশলগত নীতি

  1. প্রথমত, বর্তমান সমর্থন/প্রতিরোধের মাত্রা অর্জনের জন্য একটি নির্দিষ্ট সময়ের মধ্যে সর্বোচ্চ এবং সর্বনিম্ন মূল্যের উপর ভিত্তি করে পিভট পয়েন্টগুলি গণনা করুন।
  2. প্রবণতা নির্ধারণের জন্য সুপারট্রেন্ড সূচকটি ব্যবহার করুন। সুপারট্রেন্ড হ'ল গতিশীল সমর্থন / প্রতিরোধের স্তর থেকে গণনা করা একটি প্রবণতা অনুসরণকারী সূচক।
  3. স্টপ লসের জন্য ATR ব্যবহার করুন। এই কৌশলটি মূল সুপারট্রেন্ডের উপরে স্টপ লসের স্তর হিসাবে ATR অন্তর্ভুক্ত করে।
  4. প্রবণতা ফিল্টার হিসাবে চলমান গড় ব্যবহার করুন। শুধুমাত্র প্রবণতা আপ হয় এবং মূল্য চলমান গড় উপরে যখন দীর্ঘ যান, এবং শুধুমাত্র প্রবণতা নিচে হয় এবং মূল্য চলমান গড় নিচে যখন সংক্ষিপ্ত যান।
  5. একটি ট্রেডিং সময় উইন্ডো সেট করুন। গুরুত্বপূর্ণ সময় পয়েন্ট ট্রেডিং এড়ানোর জন্য শুধুমাত্র একটি নির্দিষ্ট সময় ব্যবধানের মধ্যে খোলা অবস্থান।
  6. লং এবং শর্ট পজিশন আলাদাভাবে পরিচালনা করুন। লং এবং শর্ট সিগন্যালগুলি তাদের নিজ নিজ খোলার এবং বন্ধের যৌক্তিকতাকে স্বাধীনভাবে ট্রিগার করে।

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

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

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

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

  1. ঘন ঘন লেনদেনের ঝুঁকিঃ এই কৌশলটি ঘন ঘন বাজারে অবস্থান খুলতে এবং বন্ধ করতে পারে, যার ফলে অত্যধিক লেনদেনের খরচ হয়।
  2. যদিও এই কৌশলটি চলমান গড় ফিল্টারিং গ্রহণ করে, যদি চলমান গড় নিজেই প্রধান প্রবণতার বিরুদ্ধে যায়, তখনও বিরোধী প্রবণতা ট্রেডিং ঘটতে পারে।
  3. প্যারামিটার অপ্টিমাইজেশান সমস্যা। কৌশলটিতে অনেকগুলি প্যারামিটার রয়েছে, যেমন সুপারট্রেন্ডের সময়কাল এবং গুণক এবং চলমান গড়ের সময়কাল। বিভিন্ন প্যারামিটারগুলি বিভিন্ন ফলাফল দেবে এবং সর্বোত্তম প্যারামিটার সংমিশ্রণ নির্বাচন করা একটি চ্যালেঞ্জ।
  4. চরম বাজারের পরিস্থিতিতে ব্যর্থ হতে পারে। চরম বাজারের পরিস্থিতিতে, যেমন তীব্র উত্থান এবং পতন, তরলতা সংকট ইত্যাদি, এই কৌশলটি সময়মতো ক্ষতি বন্ধ করতে সক্ষম নাও হতে পারে।

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

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

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

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


/*backtest
start: 2023-03-02 00:00:00
end: 2024-03-07 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@rpcoelho
// Based on © Julien_Eche "Pivot Point Supertrend" with optional EMAs ploted
//@version=4

strategy("PPS w/ EMAs", overlay=true)

prd = input(defval = 1, title="Pivot Point Period", minval = 1, maxval = 50)
Factor=input(defval = 4, title = "ATR Factor", minval = 1, step = 0.1)
Pd=input(defval = 72, title = "ATR Period", minval=1)
showpivot = input(defval = false, title="Show Pivot Points")
showlabel = input(defval = true, title="Show Buy/Sell Labels")
showcl = input(defval = false, title="Show PP Center Line")
showsr = input(defval = false, title="Show Support/Resistance")

/////////////////////////////////////////////////////////////////////////
// Switch Board
////////////////////////////////////////////////////////////////////////
// Define the switch board title as a label (since grouping is not available)
//switchboard_group = "████ Switch Board (Turn On/Off Overlay Indicators) ████"
//label.new(bar_index, high, switchboard_group, color=color.red)
// Create input controls for EMA and VWAP switches
switch_ema = input(true, title="EMA")

/////////////////////////////////////////////////////////////////////////
// EMA Selection
////////////////////////////////////////////////////////////////////////

ma_function(source, length, type) =>
    float ma = na
    if type == 'RMA'
        ma := rma(source, length)
    else if type == 'SMA'
        ma := sma(source, length)
    else if type == 'EMA'
        ma := ema(source, length)
    else if type == 'WMA'
        ma := wma(source, length)
    else if type == 'HMA'
        ma := length < 2 ? hma(source, 2) : hma(source, length)
    else
        ma := vwma(source, length)
    ma

// Moving Averages Line Title
//ma_group = "██████████ MAs Line ██████████"

// Inputs for MA 1
len1bool = input(false, title="Show MA 1")
len1 = input(13, title="Length MA 1")
ma_1_type = input("EMA", title="Type MA 1", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma1 = input(title="MA1 Source", type=input.source, defval=close)
ma_1_colour = input(color.rgb(235, 159, 238), title="Color MA 1")

// Inputs for MA 2
len2bool = input(false, title="Show MA 2")
len2 = input(17, title="Length MA 2")
ma_2_type = input("EMA", title="Type MA 2", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma2 = input(title="MA2 Source", type=input.source, defval=close)
ma_2_colour = input(color.rgb(230, 241, 65), title="Color MA 2")

// Inputs for MA 3
len3bool = input(true, title="Show MA 3")
len3 = input(34, title="Length MA 3")
ma_3_type = input("EMA", title="Type MA 3", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma3 = input(title="MA3 Source", type=input.source, defval=close)
ma_3_colour = input(#c7f887, title="Color MA 3")

// Inputs for MA 4
len4bool = input(false, title="Show MA 4")
len4 = input(72, title="Length MA 4")
ma_4_type = input("EMA", title="Type MA 4", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma4 = input(title="MA4 Source", type=input.source, defval=close)
ma_4_colour = input(#2f6999, title="Color MA 4")

// Inputs for MA 5
len5bool = input(true, title="Show MA 5")
len5 = input(144, title="Length MA 5")
ma_5_type = input("EMA", title="Type MA 5", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma5 = input(title="MA5 Source", type=input.source, defval=close)
ma_5_colour = input(color.rgb(13, 156, 37), title="Color MA 5")

// Inputs for MA 6
len6bool = input(true, title="Show MA 6")
len6 = input(610, title="Length MA 6")
ma_6_type = input("EMA", title="Type MA 6", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma6 = input(title="MA6 Source", type=input.source, defval=close)
ma_6_colour = input(color.rgb(173, 161, 152), title="Color MA 6")

// Inputs for MA 7
len7bool = input(true, title="Show MA 7")
len7 = input(8, title="Length MA 7")
ma_7_type = input("EMA", title="Type MA 7", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma7 = input(title="MA7 Source", type=input.source, defval=close)
ma_7_colour = input(color.rgb(68, 39, 231), title="Color MA 7")

// Inputs for MA 8
len8bool = input(true, title="Show MA 8")
len8 = input(21, title="Length MA 8")
ma_8_type = input("EMA", title="Type MA 8", options=["RMA", "SMA", "EMA", "WMA", "HMA", "VWMA"])
src_ma8 = input(title="MA8 Source", type=input.source, defval=close)
ma_8_colour = input(color.white, title="Color MA 8")

ema1 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma1, len1, ma_1_type))
ema2 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma2, len2, ma_2_type))
ema3 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma3, len3, ma_3_type))
ema4 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma4, len4, ma_4_type))
ema5 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma5, len5, ma_5_type))
ema6 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma6, len6, ma_6_type))
ema7 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma7, len7, ma_7_type))
ema8 = security(syminfo.tickerid, timeframe.period, ma_function(src_ma8, len8, ma_8_type))

plot(len1bool and switch_ema ? ema1:na, color=ma_1_colour, linewidth=1, title='MA 1')
plot(len2bool and switch_ema? ema2:na, color=ma_2_colour, linewidth=1, title='MA 2')
plot(len3bool and switch_ema? ema3:na, color=ma_3_colour, linewidth=1, title='MA 3')
plot(len4bool and switch_ema? ema4:na, color=ma_4_colour, linewidth=1, title='MA 4')
plot(len5bool and switch_ema? ema5:na, color=ma_5_colour, linewidth=1, title='MA 5')
plot(len6bool and switch_ema? ema6:na, color=ma_6_colour, linewidth=2, title='MA 6')
plot(len7bool and switch_ema? ema7:na, color=ma_7_colour, linewidth=1, title='MA 7')
plot(len8bool and switch_ema? ema8:na, color=ma_8_colour, linewidth=1, title='MA 8')









// get Pivot High/Low
float ph = pivothigh(prd, prd)
float pl = pivotlow(prd, prd)

// drawl Pivot Points if "showpivot" is enabled
plotshape(ph and showpivot, text="H",  style=shape.labeldown, color=na, textcolor=color.red, location=location.abovebar, transp=0, offset = -prd)
plotshape(pl and showpivot, text="L",  style=shape.labeldown, color=na, textcolor=color.lime, location=location.belowbar, transp=0, offset = -prd)

// calculate the Center line using pivot points
var float center = na
float lastpp = ph ? ph : pl ? pl : na
if lastpp
    if na(center)
        center := lastpp
    else
        //weighted calculation
        center := (center * 2 + lastpp) / 3

// upper/lower bands calculation
Up = center - (Factor * atr(Pd))
Dn = center + (Factor * atr(Pd))

// get the trend
float TUp = na
float TDown = na
Trend = 0
TUp := close[1] > TUp[1] ? max(Up, TUp[1]) : Up
TDown := close[1] < TDown[1] ? min(Dn, TDown[1]) : Dn
Trend := close > TDown[1] ? 1: close < TUp[1]? -1: nz(Trend[1], 1)
Trailingsl = Trend == 1 ? TUp : TDown

// plot the trend
linecolor = Trend == 1 and nz(Trend[1]) == 1 ? color.lime : Trend == -1 and nz(Trend[1]) == -1 ? color.red : na
plot(Trailingsl, color = linecolor ,  linewidth = 2, title = "PP SuperTrend")
 
plot(showcl ? center : na, color = showcl ? center < hl2 ? color.blue : color.red : na)

// check and plot the signals
bsignal = Trend == 1 and Trend[1] == -1
ssignal = Trend == -1 and Trend[1] == 1
plotshape(bsignal and showlabel ? Trailingsl : na, title="Buy", text="Buy", location = location.absolute, style = shape.labelup, size = size.tiny, color = color.lime, textcolor = color.black, transp = 0)
plotshape(ssignal and showlabel ? Trailingsl : na, title="Sell", text="Sell", location = location.absolute, style = shape.labeldown, size = size.tiny, color = color.red, textcolor = color.white, transp = 0)

//get S/R levels using Pivot Points
float resistance = na
float support = na
support := pl ? pl : support[1]
resistance := ph ? ph : resistance[1]

// if enabled then show S/R levels
plot(showsr and support ? support : na, color = showsr and support ? color.lime : na, style = plot.style_circles, offset = -prd)
plot(showsr and resistance ? resistance : na, color = showsr and resistance ? color.red : na, style = plot.style_circles, offset = -prd)

// Trend Filter from SuperTrend Long Strategy
Periods = input(title="ATR Period", type=input.integer, defval=3)
src = input(hlc3, title="Source")
Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=4.0)
changeATR = input(title="Change ATR Calculation Method ?", type=input.bool, defval=true)

// Combine the SuperTrend calculations
atr2 = sma(tr, Periods)
atr = changeATR ? atr(Periods) : atr2

up = src - (Multiplier * atr)
up1 = nz(up[1], up)
up := close[1] > up1 ? max(up, up1) : up

dn = src + (Multiplier * atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? min(dn, dn1) : dn

trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend

// Moving Average as Trend Filter
periodes_ma = input(title="Moving Average Period", type=input.integer, defval=20)
src_ma = input(title="Moving Average Source", type=input.source, defval=close)
ma = sma(src_ma, periodes_ma)

// Strategy Entry Conditions
FromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
FromDay   = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
FromYear  = input(defval = 2017, title = "From Year", minval = 999)
ToMonth   = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
ToDay     = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
ToYear    = input(defval = 9999, title = "To Year", minval = 999)

start     = timestamp(FromYear, FromMonth, FromDay, 00, 00)  
finish    = timestamp(ToYear, ToMonth, ToDay, 23, 59)       

window()  => true

// Combined entry conditions
longCondition = (trend == 1 and trend[1] == -1 and close > ma) or (bsignal and window())
shortCondition = (trend == -1 and trend[1] == 1 and close < ma) or (ssignal and window())

if (longCondition)
    strategy.entry("BUY", strategy.long)

if (shortCondition)
    strategy.close("BUY")
    strategy.entry("SELL", strategy.short)

buy1 = barssince((trend == 1 and trend[1] == -1 and close > ma) or (bsignal and window()))
sell1 = barssince((trend == -1 and trend[1] == 1 and close < ma) or (ssignal and window()))
color1 = buy1[1] < sell1[1] ? color.green : buy1[1] > sell1[1] ? color.red : na
barcolor(color1)


আরো