
এই কৌশলটি LazyBear এর মূল তরঙ্গ প্রবণতা কৌশল, দ্বিতীয় স্টপ ক্ষতি, একাধিক স্টপ মূল্য এবং একটি উচ্চ সময় ফ্রেম EMA ফিল্টার যুক্ত করে। এটি তরঙ্গ প্রবণতা সূচক ব্যবহার করে ট্রেডিং সংকেত উত্পন্ন করে এবং EMA ফিল্টারিং এবং স্টপ ক্ষতি স্টপ ম্যানেজমেন্টের সাথে মিলিত হয়, স্বয়ংক্রিয় প্রবণতা ট্র্যাকিংয়ের জন্য।
এই কৌশলটির কেন্দ্রীয় সূচক হল ওয়েভ ট্রেন্ড সূচক, যা তিনটি অংশ নিয়ে গঠিতঃ
AP: গড় মূল্য = (সর্বোচ্চ মূল্য + সর্বনিম্ন মূল্য + সমাপ্তি মূল্য) / 3
ESA: AP এর n1 ইস্যু EMA
CI: ((AP-ESA) / (0.015 × AP-ESA এর n1 ইএমএ) এর পরম মানের n1 ইএমএ
টিসিআইঃ সিআই এর এন 2 ইএমএ, অর্থাৎ তরঙ্গ প্রবণতা লাইন 1 ((WT1))
WT2: WT1 এর 4-চক্র SMA
যখন WT1 এর উপর দিয়ে WT2 এর মাধ্যমে গোল্ডেন ফর্ক হয়, তখন বেশি কাজ করুন; যখন WT1 এর নিচে দিয়ে WT2 এর মাধ্যমে ডেড ফর্ক হয়, তখন পজিশন খালি করুন।
উপরন্তু, কৌশলটি উচ্চ সময় ফ্রেম ইএমএকে একটি ফিল্টার হিসাবে প্রবর্তন করে, যখন দাম ইএমএর চেয়ে বেশি হয় তখনই অতিরিক্ত কাজ করা হয় এবং যখন ইএমএর চেয়ে কম হয় তখন খালি করা হয়, যার ফলে কিছু মিথ্যা সংকেত ফিল্টার করা যায়।
এই কৌশলটি ট্রেন্ড ট্র্যাকিং, ঝুঁকি নিয়ন্ত্রণ, মুনাফা সর্বাধিকীকরণের মতো একাধিক মাত্রা বিবেচনা করে, তরঙ্গ প্রবণতা সূচকের মাধ্যমে স্বয়ংক্রিয়ভাবে ট্রেন্ড ক্যাপচার করে, ইএমএ ফিল্টারের সাথে মিলিত হয় ট্রেডিং দক্ষতা বৃদ্ধি করে এবং ট্রেন্ড ক্যাপচার করার সময় ঝুঁকি নিয়ন্ত্রণ করে। এটি একটি কার্যকর এবং স্থিতিশীল ট্রেন্ড ট্র্যাকিং কৌশল। আরও প্যারামিটার অপ্টিমাইজেশন এবং বিপরীত সিদ্ধান্ত বাড়িয়ে এই কৌশলটির প্রযোজ্যতা আরও বাড়ানো যেতে পারে।
/*backtest
start: 2023-10-31 00:00:00
end: 2023-11-30 00:00:00
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/
// © undacovacobra
//@version=4
strategy("WaveTrend Strategy [LazyBear] with Secondary Stop Loss", overlay=true)
// Input parameters
n1 = input(10, "Channel Length")
n2 = input(21, "Average Length")
obLevel1 = input(60, "Over Bought Level 1")
obLevel2 = input(53, "Over Bought Level 2")
osLevel1 = input(-60, "Over Sold Level 1")
osLevel2 = input(-53, "Over Sold Level 2")
useEmaFilter = input(false, "Use EMA Filter")
emaLength = input(50, "EMA Length")
emaTimeFrame = input("60", "EMA Time Frame")
tradeMode = input("Both", "Trade Mode", options=["Long Only", "Short Only", "Both"])
useSecondarySL = input(false, "Use Secondary Stop Loss")
slPercentage = input(5.0, "Stop Loss Percentage (%)")
// WaveTrend Indicator Calculations
ap = hlc3
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
wt1 = tci
wt2 = sma(wt1, 4)
// EMA Calculation with Selected Time Frame
getEma(timeFrame) =>
security(syminfo.tickerid, timeFrame, ema(close, emaLength))
emaFilter = getEma(emaTimeFrame)
// Secondary Stop Loss Calculation
longStopPrice = strategy.position_avg_price * (1 - slPercentage / 100)
shortStopPrice = strategy.position_avg_price * (1 + slPercentage / 100)
// Long Entry and Exit Conditions with EMA Filter and Trade Mode
longEntry = crossover(wt1, wt2) and wt2 < osLevel1 and (not useEmaFilter or close > emaFilter) and (tradeMode == "Long Only" or tradeMode == "Both")
if (longEntry)
strategy.entry("Long", strategy.long)
longExit = crossunder(wt1, wt2) and wt2 > obLevel1
if (longExit)
strategy.close("Long")
if (useSecondarySL and strategy.position_size > 0 and low < longStopPrice)
strategy.close("Long", comment="SL Hit")
// Short Entry and Exit Conditions with EMA Filter and Trade Mode
shortEntry = crossunder(wt1, wt2) and wt2 > obLevel1 and (not useEmaFilter or close < emaFilter) and (tradeMode == "Short Only" or tradeMode == "Both")
if (shortEntry)
strategy.entry("Short", strategy.short)
shortExit = crossover(wt1, wt2) and wt2 < osLevel1
if (shortExit)
strategy.close("Short")
if (useSecondarySL and strategy.position_size < 0 and high > shortStopPrice)
strategy.close("Short", comment="SL Hit")
// Plotting
plot(0, color=color.gray)
plot(obLevel1, color=color.red)
plot(osLevel1, color=color.green)
plot(obLevel2, color=color.red, style=plot.style_cross)
plot(osLevel2, color=color.green, style=plot.style_cross)
plot(wt1, color=color.green)
plot(wt2, color=color.red, style=plot.style_cross)
plot(wt1-wt2, color=color.blue, style=plot.style_area, transp=80)
plot(emaFilter, color=color.blue)