কৌশল অনুসরণ করে রোগীর প্রবণতা

লেখক:চাওঝাং, তারিখঃ 2024-01-18 12:40:11
ট্যাগঃ

img

সারসংক্ষেপ

রোগীর প্রবণতা অনুসরণ কৌশল একটি প্রবণতা অনুসরণ কৌশল। এটি প্রবণতা দিক নির্ধারণ এবং ট্রেডিং সংকেত উত্পন্ন করার জন্য সিসিআই দোলকগুলির সংমিশ্রণ ব্যবহার করে। এই কৌশলটি বড় প্রবণতা অনুসরণ করে এবং কার্যকরভাবে ব্যাপ্তি বাজারে whipsaws এড়াতে পারে।

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

কৌশলটি প্রবণতা দিক নির্ধারণের জন্য 21-পরিসরের এবং 55-পরিসরের ইএমএর সংমিশ্রণ ব্যবহার করে। যখন সংক্ষিপ্ত ইএমএ দীর্ঘ ইএমএর উপরে থাকে তখন একটি আপট্রেন্ড সংজ্ঞায়িত করা হয়। যখন সংক্ষিপ্ত ইএমএ দীর্ঘ ইএমএর নীচে থাকে তখন একটি ডাউনট্রেন্ড সংজ্ঞায়িত করা হয়।

সিসিআই সূচকটি অতিরিক্ত ক্রয় এবং অতিরিক্ত বিক্রয় পরিস্থিতি সনাক্ত করতে ব্যবহৃত হয়। -১০০ এর উপরে সিসিআই ক্রসিং নীচের ওভারসোল্ড শর্ত এবং ১০০ এর নীচে ক্রসিং শীর্ষ ওভারসোল্ড শর্তের সংকেত দেয়। সিসিআইয়ের বিভিন্ন ওভারসোল্ড এবং ওভারসোল্ড স্তরগুলি বিভিন্ন আত্মবিশ্বাসের স্তরের ট্রেডিং সংকেত উত্পাদন করে।

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

স্টপ লস সুপারট্রেন্ড লাইনে সেট করা হয়। ট্যাক লাভ হল নির্দিষ্ট সংখ্যক পিপ।

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

এই কৌশলটির প্রধান সুবিধাগুলো হল:

  1. বড় ট্রেন্ড অনুসরণ করা, হুইপস এড়ানো
  2. সিসিআই কার্যকরভাবে বিপরীত পয়েন্ট সনাক্ত করে
  3. সুপারট্রেন্ডের সাথে যুক্তিসঙ্গত স্টপ লস সেটিং
  4. স্থির স্টপ লস এবং লাভ গ্রহণ, নিয়ন্ত্রণযোগ্য ঝুঁকি

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

এই কৌশলটির প্রধান ঝুঁকিগুলি হলঃ

  1. ভুল বড় প্রবণতা নির্ধারণের সম্ভাবনা
  2. সিসিআই থেকে মিথ্যা সংকেতের সম্ভাবনা
  3. অপ্রয়োজনীয় স্টপ লস হওয়ার সম্ভাবনা
  4. ফিক্সড টেক ইয়েফের সাথে ট্রেন্ড মুনাফার অনুপস্থিতির সম্ভাবনা

এই ঝুঁকিগুলি মোকাবেলা করার জন্য, ইএমএ সময়কাল, সিসিআই সময়কাল এবং স্টপ লস / টক লাভের স্তরের মতো পরামিতিগুলি অনুকূল করা যেতে পারে। সংকেত যাচাইয়ের জন্য আরও সূচক প্রবর্তন করাও প্রয়োজনীয়।

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

অপ্টিমাইজেশনের প্রধান দিকগুলি হলঃ

  1. আরও ভাল প্রবণতা এবং সংকেত যাচাইকরণ সূচক খুঁজে পেতে আরও সূচক সংমিশ্রণ পরীক্ষা করুন।

  2. এটিআর দিয়ে গতিশীল স্টপ লস ব্যবহার করুন এবং ট্রেন্ডগুলি আরও ভালভাবে অনুসরণ করতে এবং ঝুঁকি নিয়ন্ত্রণ করতে মুনাফা নিন।

  3. প্রবণতা সম্ভাব্যতা বিচার করার জন্য ঐতিহাসিক তথ্যের উপর প্রশিক্ষিত মেশিন লার্নিং মডেল প্রবর্তন করুন।

  4. বিভিন্ন ট্রেডিং ইনস্ট্রুমেন্টের জন্য প্যারামিটার অপ্টিমাইজ করা।

সিদ্ধান্ত

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


/*backtest
start: 2024-01-10 00:00:00
end: 2024-01-17 00:00:00
period: 1m
basePeriod: 1m
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/
// © greenmask9

//@version=4
strategy("Patient Trendfollower (7) Strategy", overlay=true)

// 21 EMA
emalength = input(21, title="Short EMA")
emashort = ema(close, emalength)
plot(emashort, color = color.purple, linewidth=1)

// 55 EMA
emalength2 = input(55, title="Long EMA")
ema = ema(close, emalength2)
plot(ema, color = color.green, linewidth=1)

//CCI calculation and inputs
lengthcci = input(20, minval=1, title="Overbought/sold detector period")
src = input(close, title="Overbought/sold detector source")
ma = sma(src, lengthcci)
ccivalue = (src - ma) / (0.015 * dev(src, lengthcci))


//CCI plotting
ccioverbought = input(defval=100, title="Overbought level 1")
ccioverbought2 = input(defval=140, title="Overbought level 2")
ccioverbought3 = input(defval=180, title="Overbought level 3")

ccioversold = input(defval=-100, title="Oversold level 1")
ccioversold2 = input(defval=-140, title="Oversold level 2")
ccioversold3 = input(defval=-180, title="Oversold level 3")

cciOB = (ccivalue >= ccioverbought and ccivalue < ccioverbought2)
plotshape(cciOB,  title= "Overbought", location=location.abovebar, color=color.lime, transp=0, style=shape.circle)
cciOS = (ccivalue <= ccioversold and ccivalue > ccioversold2)
plotshape(cciOS, title= "Oversold", location=location.belowbar, color=color.lime, transp=0, style=shape.circle)

cciOB2 = (ccivalue >= ccioverbought2 and ccivalue < ccioverbought3)
plotshape(cciOB2,  title= "Overbought", location=location.abovebar, color=color.red, transp=0, style=shape.circle)
cciOS2 = (ccivalue <= ccioversold and ccivalue > ccioversold3)
plotshape(cciOS2, title= "Oversold", location=location.belowbar, color=color.red, transp=0, style=shape.circle)

cciOB3 = (ccivalue >= ccioverbought3)
plotshape(cciOB3,  title= "Overbought", location=location.abovebar, color=color.black, transp=0, style=shape.circle)
cciOS3 = (ccivalue <= ccioversold3)
plotshape(cciOS3, title= "Oversold", location=location.belowbar, color=color.black, transp=0, style=shape.circle)

//Supertrend

length = input(title="ATR Period", type=input.integer, defval=55)
mult = input(title="ATR Multiplier", type=input.float, step=0.1, defval=5.0)
wicks = input(title="Take Wicks into Account ?", type=input.bool, defval=true)
illuminate = input(title="Illuminate Trend", type=input.bool, defval=true)

atr = mult * atr(length)

longStop = hl2 - atr
longStopPrev = nz(longStop[1], longStop)
longStop := (wicks ? low[1] : close[1]) > longStopPrev ? max(longStop, longStopPrev) : longStop

shortStop = hl2 + atr
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := (wicks ? high[1] : close[1]) < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop

dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and (wicks ? high : close) > shortStopPrev ? 1 : dir == 1 and (wicks ? low : close) < longStopPrev ? -1 : dir

longColor = color.new(color.green, 90)
shortColor = color.new(color.red, 90)
noneColor = color.new(color.white, 100)

longStopPlot = plot(dir == 1 ? longStop : na, title="Long Stop", style=plot.style_linebr, linewidth=2, color=longColor)
shortStopPlot = plot(dir == 1 ? na : shortStop, title="Short Stop", style=plot.style_linebr, linewidth=2, color=shortColor)
midPricePlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)

longFillColor = illuminate ? (dir == 1 ? longColor : noneColor) : noneColor
shortFillColor = illuminate ? (dir == -1 ? shortColor : noneColor) : noneColor
fill(midPricePlot, longStopPlot, title="Long State Filling", color=longFillColor)
fill(midPricePlot, shortStopPlot, title="Short State Filling", color=shortFillColor)

//entries
uptrend = emashort>ema and dir == 1
upsignal = ccivalue<=ccioversold and ccivalue>ccioversold2
upsignal2 = ccivalue<=ccioversold2 and ccivalue>ccioversold3
upsignal3 = ccivalue<=ccioversold3
downtrend = emashort<ema and dir == -1
downsignal = ccivalue>=ccioverbought and ccivalue<ccioverbought2
downsignal2 = ccivalue>=ccioverbought2 and ccivalue<ccioverbought3
downsignal3 = ccivalue>=ccioverbought3

//adapts to the current bar, I need to save the bars number when the condition for buy was true, static number is spread
spread = input (0.00020, title="Spread")
upstoploss = longStop - spread
downstoploss = shortStop + spread
strategy.initial_capital = 50000
ordersize=floor(strategy.initial_capital/close)
testlong = input(title="Test longs", type=input.bool, defval=true)
testshort = input(title="Test shorts", type=input.bool, defval=true)
//new
degree = input(title="Test level 1 overbought/sold levels", type=input.bool, defval=true)
degree2 = input(title="Test level 2 overbought/sold levels", type=input.bool, defval=false)
degree3 = input(title="Test level 3 overbought/sold levels", type=input.bool, defval=false)

statictarget = input(title="Use static target", type=input.bool, defval=true)
statictargetvalue = input(title="Static target in pips", type=input.integer, defval=400)

//timetrade = input(title="Open trades only withing specified time", type=input.bool, defval=true)
//timtrade = input()

//přidat možnost TP podle ATR a sl podle ATR
buy1 = uptrend and upsignal and strategy.opentrades==0 and testlong and degree
x1 = barssince (buy1)
if (buy1)
//bodlo by zakázat atrtarget v tomto případě
    if (statictarget)
        strategy.entry("Long1", strategy.long, ordersize)
        strategy.exit( "Exitlong", from_entry="Long1" , profit=statictargetvalue,stop=upstoploss[x1])
 
buy2 = uptrend and upsignal2 and strategy.opentrades==0 and testlong and degree2
x2 = barssince (buy2)
if (buy2)
//bodlo by zakázat atrtarget v tomto případě
    if (statictarget)
        strategy.entry("Long2", strategy.long, ordersize)
        strategy.exit( "Exitlong", from_entry="Long2" , profit=statictargetvalue,stop=upstoploss[x2])
  
buy3 = uptrend and upsignal3 and strategy.opentrades==0 and testlong and degree3
x3 = barssince (buy3)
if (buy3)
//bodlo by zakázat atrtarget v tomto případě
    if (statictarget)
        strategy.entry("Long3", strategy.long, ordersize)
        strategy.exit( "Exitlong", from_entry="Long3" , profit=statictargetvalue,stop=upstoploss[x3])

sell1 = downtrend and downsignal and strategy.opentrades==0 and testshort and degree
y1 = barssince (sell1)
if (sell1)
    if (statictarget)
        strategy.entry("Sell1", strategy.short, ordersize)
        strategy.exit( "Exitshort", from_entry="Sell1" , profit=statictargetvalue,stop=downstoploss[y1])

sell2 = downtrend and downsignal2 and strategy.opentrades==0 and testshort and degree2
y2 = barssince (sell2)
if (sell2)
    if (statictarget)
        strategy.entry("Sell2", strategy.short, ordersize)
        strategy.exit( "Exitshort", from_entry="Sell2" , profit=statictargetvalue,stop=downstoploss[y2])

sell3 = downtrend and downsignal3 and strategy.opentrades==0 and testshort and degree3
y3 = barssince (sell3)
if (sell3)
    if (statictarget)
        strategy.entry("Sell3", strategy.short, ordersize)
        strategy.exit( "Exitshort", from_entry="Sell3" , profit=statictargetvalue,stop=downstoploss[y3])


আরো