ডায়নামিক গ্লোভিং ট্রেন্ড কৌশল

লেখক:চাওঝাং, তারিখঃ ২০২৪-০২-২৯ ১১ঃ২৪ঃ১৮
ট্যাগঃ

img

সারসংক্ষেপ

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

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

  1. বাজারের অস্থিরতা পরিমাপ করার জন্য ATR গণনা করুন।
  2. বাজারের প্রবণতা চিহ্নিত করতে সুপারট্রেন্ড সূচক গণনা করুন।
  3. আপট্রেন্ড এবং ডাউনট্রেন্ডের জন্য শর্ত নির্ধারণ করুন।
  4. উর্ধ্বমুখী (উর্ধ্বমুখী) এবং নিম্নমুখী (নিম্নমুখী) গ্লোবিং চিহ্নিত করুন।
  5. স্টপ লস (এসএল) এবং টেক প্রফিট (টিপি) স্তরগুলি গ্লোফিং প্যাটার্নগুলির উপর ভিত্তি করে গণনা করুন।
  6. ট্রেডিং শুরু করুন যখন ট্রেন্ডিং প্যাটার্ন ট্রেন্ডের দিকের সাথে মিলে যায়।
  7. যখন মূল্য SL বা TP স্তরে পৌঁছায় তখন ট্রেড বন্ধ করুন।
  8. চার্টে গ্রাসের নিদর্শনগুলি চিহ্নিত করুন।

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

এই কৌশলটির সুবিধাগুলির মধ্যে রয়েছেঃ

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

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

এছাড়াও কিছু ঝুঁকি রয়েছে যা বিবেচনা করা উচিতঃ

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

এই ঝুঁকিগুলি নিম্নলিখিত উপায়ে হ্রাস করা যেতে পারেঃ

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

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

আরও অপ্টিমাইজেশনের সুযোগ রয়েছেঃ

  1. মেশিন লার্নিং প্রবণতা নির্ধারণকে উন্নত করতে পারে।
  2. নতুন প্যাটার্ন স্বীকৃতির পদ্ধতিগুলি গ্লোভিং প্যাটার্নগুলিকে আরও ভালভাবে সনাক্ত করতে পারে।
  3. সর্বশেষ স্টপ লস/টেক প্রফিট কৌশলগুলি গতিশীলভাবে স্তরগুলিকে অনুকূল করতে পারে।
  4. উচ্চ-ফ্রিকোয়েন্সির ডেটা স্বল্প-মেয়াদী সিস্টেম তৈরি করতে পারে।
  5. বিভিন্ন যন্ত্রের জন্য প্যারামিটার টিউনিং।

সিদ্ধান্ত

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


/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
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/
// © Malikdrajat


//@version=4
strategy("Engulfing with Trend", overlay=true)

Periods = input(title="ATR Period", type=input.integer, defval=10)
src = input(hl2, title="Source")
Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true)
showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true)
highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true)

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

upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green, transp=0)
plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red, transp=0)
plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white
shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white
fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor)
alertcondition(buySignal, title="SuperTrend Buy", message="SuperTrend Buy!")
alertcondition(sellSignal, title="SuperTrend Sell", message="SuperTrend Sell!")
changeCond = trend != trend[1]
alertcondition(changeCond, title="SuperTrend Direction Change", message="SuperTrend has changed direction!")

// Define Downtrend and Uptrend conditions
downtrend = trend == -1
uptrend = trend == 1


// Engulfing 
boringThreshold = input(25, title="Boring Candle Threshold (%)", minval=1, maxval=100, step=1)
engulfingThreshold = input(50, title="Engulfing Candle Threshold (%)", minval=1, maxval=100, step=1)
stopLevel = input(200, title="Stop Level (Pips)", minval=1)


// Boring Candle (Inside Bar) and Engulfing Candlestick Conditions
isBoringCandle = abs(open[1] - close[1]) * 100 / abs(high[1] - low[1]) <= boringThreshold
isEngulfingCandle = abs(open - close) * 100 / abs(high - low) <= engulfingThreshold

// Bullish and Bearish Engulfing Conditions
bullEngulfing = uptrend and close[1] < open[1] and close > open[1] and not isBoringCandle and not isEngulfingCandle
bearEngulfing = downtrend and close[1] > open[1] and close < open[1] and not isBoringCandle and not isEngulfingCandle

// Stop Loss, Take Profit, and Entry Price Calculation
bullStop = close + (stopLevel * syminfo.mintick)
bearStop = close - (stopLevel * syminfo.mintick)
bullSL = low 
bearSL = high
bullTP = bullStop + (bullStop - low)
bearTP = bearStop - (high - bearStop)

// Entry Conditions
enterLong = bullEngulfing and uptrend
enterShort = bearEngulfing and downtrend

// Exit Conditions
exitLong = crossover(close, bullTP) or crossover(close, bullSL)
exitShort = crossover(close, bearTP) or crossover(close, bearSL)

// Check if exit conditions are met by the next candle
exitLongNextCandle = exitLong and (crossover(close[1], bullTP[1]) or crossover(close[1], bullSL[1]))
exitShortNextCandle = exitShort and (crossover(close[1], bearTP[1]) or crossover(close[1], bearSL[1]))

// Strategy Execution
strategy.entry("Buy", strategy.long, when=enterLong )
strategy.entry("Sell", strategy.short, when=enterShort )

// Exit Conditions for Long (Buy) Positions
if (bullEngulfing and not na(bullTP) and not na(bullSL))
    strategy.exit("Exit Long", from_entry="Buy", stop=bullSL, limit=bullTP)

// Exit Conditions for Short (Sell) Positions
if (bearEngulfing and not na(bearTP) and not na(bearSL))
    strategy.exit("Exit Short", from_entry="Sell", stop=bearSL, limit=bearTP)

// Plot Shapes and Labels
plotshape(bullEngulfing, style=shape.triangleup, location=location.abovebar, color=color.green)
plotshape(bearEngulfing, style=shape.triangledown, location=location.abovebar, color=color.red)

// Determine OP, SL, and TP
plot(bullEngulfing ? bullStop : na, title="Bullish Engulfing stop", color=color.red, linewidth=3, style=plot.style_linebr)
plot(bearEngulfing ? bearStop : na, title="Bearish Engulfing stop", color=color.red, linewidth=3, style=plot.style_linebr)
plot(bullEngulfing ? bullSL : na, title="Bullish Engulfing SL", color=color.red, linewidth=3, style=plot.style_linebr)
plot(bearEngulfing ? bearSL : na, title="Bearish Engulfing SL", color=color.red, linewidth=3, style=plot.style_linebr)
plot(bullEngulfing ? bullTP : na, title="Bullish Engulfing TP", color=color.green, linewidth=3, style=plot.style_linebr)
plot(bearEngulfing ? bearTP : na, title="Bearish Engulfing TP", color=color.green, linewidth=3, style=plot.style_linebr)



আরো