
এই কৌশলটি একটি প্রবণতা ট্র্যাকিং স্টপ লস পদ্ধতি ব্যবহার করে লম্বা লাইন ট্র্যাকিং লাভ অর্জনের জন্য প্রবণতা ট্র্যাকিং স্টপ লস পদ্ধতি ব্যবহার করে।
সম্ভাব্য বিপরীতমুখী এলাকা নির্মাণের জন্য গতিশীল প্রতিরোধের এবং সমর্থন বিটগুলিকে শতাংশের পরিসংখ্যান পদ্ধতি ব্যবহার করে গণনা করা হয়।
যখন দাম বিপরীত অঞ্চলে প্রবেশ করে, তখন ট্রেডিং সিগন্যালের জন্য সিদ্ধান্ত নেওয়া হয় যে এমএ দ্রুত লাইন বা এমএ ধীর লাইন অতিক্রম করেছে কিনা।
প্রবেশের পরে স্টপ লস ট্র্যাকিং প্রক্রিয়া চালু করুন, ডায়নামিক স্টপ লস পদ্ধতি ব্যবহার করে মুনাফা লক করুন এবং লাভের প্রবণতা অনুসরণ করুন।
যখন দাম স্টপ লস বা স্টপ পজিশন ট্রিগার করে, তখন পজিশন ছেড়ে চলে যায়।
ডায়নামিক রেসিস্ট্যান্স ব্যান্ডেজগুলি সম্ভাব্য বিপরীত অঞ্চলগুলি সনাক্ত করতে পারে, যা প্রবেশের নির্ভুলতা বাড়িয়ে তোলে।
MA গড়রেখা ক্রস করে শতভাগ চ্যানেলের সাথে, যা মিথ্যা সংকেত এড়ায়।
স্টপ লস ট্র্যাকিং পদ্ধতি কার্যকরভাবে মুনাফা লক করে এবং প্রত্যাহারের বিস্তার রোধ করে।
বিভিন্ন বাজারের পরিবেশের সাথে সামঞ্জস্য রেখে একাধিক প্যারামিটার কনফিগার করা যায়
ট্রেন্ডিংয়ের বাইরে, ভুয়া সংকেত তৈরির ঝুঁকি রয়েছে।
ভুল প্যারামিটার সেট করা হলে অতিরিক্ত উত্তেজনা সৃষ্টি হতে পারে, যথাযথভাবে শিথিল করা উচিত।
রিটার্নিং ডেটা যথাযথ কার্যক্রম চক্র আবরণ করা উচিত, সীমাবদ্ধতা এড়ানো উচিত।
শক্ত ডিস্ক প্রক্রিয়া চলাকালীন, স্টপ লস এন্টিটি যথাযথভাবে বৃদ্ধি করা উচিত, যাতে উড়ে যাওয়া এড়ানো যায়।
বিভিন্ন এমএ প্যারামিটারের সমন্বয় পরীক্ষা করা।
গতিশীল প্রতিরোধের সমর্থন প্যারামিটারগুলি সামঞ্জস্য করুন, বিপরীত-পরিচয়ের প্রভাবগুলি অনুকূলিত করুন।
বিভিন্ন স্টপ লস ট্র্যাকিং প্যারামিটারের প্রভাব কৌশলগত মুনাফা কার্ভের উপর মূল্যায়ন করা।
অন্যান্য সূচকগুলির সাথে সংযুক্ত করে ফিল্টারিং সিগন্যালের স্থায়িত্ব বাড়ানোর চেষ্টা করুন।
এই কৌশলটির সামগ্রিক ধারণাটি পরিষ্কার, গতিশীল প্রতিরোধের সমর্থনকারী ব্যান্ডটি সংকেত ফিল্টার হিসাবে সম্ভাব্য বিপরীত অঞ্চল সনাক্তকরণের জন্য ব্যবহার করা হয়, এবং এমএ সমান্তরাল ট্রেন্ডের দিকনির্দেশের জন্য ট্রেডিং সংকেত উত্পন্ন করে, স্টপ লস ট্র্যাকিং পদ্ধতিটি কার্যকরভাবে ঝুঁকি নিয়ন্ত্রণ করে, প্যারামিটার অপ্টিমাইজেশনের মাধ্যমে কৌশলটির কার্যকারিতা ক্রমাগত উন্নত করতে পারে, এটি আরও গবেষণা এবং অপ্টিমাইজেশনের জন্য উপযুক্ত।
/*backtest
start: 2022-12-12 00:00:00
end: 2023-12-18 00:00:00
period: 1d
basePeriod: 1h
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/
// © allanster
//@version=4
strategy("MA-EMA Crossover LT", shorttitle="MA-EMA XO", overlay=true)
//==================== STRATEGY CODE ======================
tradeType = input("BOTH", title="Trade Type ", options=["LONG", "SHORT", "BOTH"])
// === BACKTEST RANGE ===
FromMonth = 01//input(defval=01, title="From Month", minval=1)
FromDay = 01//input(defval=01, title="From Day", minval=1)
FromYear = input(defval=2017, title="From Year", minval=2000)
ToMonth = 12//input(defval=12, title="To Month", minval=1)
ToDay = 31//input(defval=31, title="To Day", minval=1)
ToYear = input(defval=9999, title="To Year", minval=2000)
testPeriod() =>
time > timestamp(FromYear, FromMonth, FromDay, 00, 00) and
time < timestamp(ToYear, ToMonth, ToDay, 23, 59)
stopLossPercent = input(1.00, "Stop Loss Percent")
profitPercent_long = input(3.50, "Profit Percent LONG")
profitPercent_short = input(3.0, "Profit Percent SHORT")
atr_multi_PT = input(1.50, "ATR Multiple for PT")
atr_multi_SL = input(1.50, "ATR Multiple for SL")
//////////////////////////////
isLongOpen = false
isShortOpen = false
//Order open on previous ticker?
isLongOpen := nz(isLongOpen[1])
isShortOpen := nz(isShortOpen[1])
/////////////////////
//Trailing and Profit variables
trigger = 0.0
trigger := na
profitTrigger = 0.0
profitTrigger := na
//obtain values from last ticker
entryPrice = 0.0
entryPrice := nz(entryPrice[1])
stopLossLevel = 0.0
stopLossLevel := nz(stopLossLevel[1])
profitPriceLevel = 0.0
profitPriceLevel := nz(profitPriceLevel[1])
//If in active trade, lets load with current value
if isLongOpen
profitTrigger := profitPriceLevel ? high : na
trigger := stopLossLevel ? ohlc4 : na
trigger
if isShortOpen
profitTrigger := profitPriceLevel ? low : na
trigger := stopLossLevel ? ohlc4 : na
trigger
isStopLoss = isLongOpen ? trigger < stopLossLevel :
isShortOpen ? trigger > stopLossLevel : na
isProfitCatch = isLongOpen ? profitTrigger > profitPriceLevel :
isShortOpen ? profitTrigger < profitPriceLevel : na
//=================== Optional Entry Condition ============
src = close
len = input(defval = 128, title = "DZ Length", type = input.integer, minval = 1)
// use_dz = input(false, title="Use Dynamic Zone")
pcntAbove = input(defval = 40, title = "Hi is Above X% of Sample", type = input.float, minval = 0, maxval = 100, step = 1.0)
pcntBelow = input(defval = 60, title = "Lo is Below X% of Sample", type = input.float, minval = 0, maxval = 100, step = 1.0)
smplAbove = percentile_nearest_rank(src, len, pcntAbove)
smplBelow = percentile_nearest_rank(src, len, 100 - pcntBelow)
above = plot(src > smplAbove ? src : smplAbove, title = "Above Line", color = na)
probOB = plot(smplAbove, title = "OB", color = color.green)
probOS = plot(smplBelow, title = "OS", color = color.red)
below = plot(src < smplBelow ? src : smplBelow, title = "Below Line", color = na)
fill(above, probOB, color = #00FF00, transp = 80)
fill(below, probOS, color = #FF0000, transp = 80)
// long_dz = close > smplAbove
// short_dz = close < smplBelow
//============== Entry Conditions =====================
timeframe = input("5D", title="MA16 Resolution", type=input.resolution)
_ma = sma(hlc3, 16)
ma=security(syminfo.tickerid, timeframe, _ma, barmerge.gaps_off, barmerge.lookahead_on)
_ema=ema(hlc3,7)
ema=security(syminfo.tickerid, timeframe, _ema, barmerge.gaps_off, barmerge.lookahead_on)
long = ma[1] > ema[1] ? crossover(ema, ma) : abs(ma - ema)/ma > 0.025 ? crossover(close, ema) : false
short = ma[1] < ema[1] ? crossunder(ema,ma) : abs(ma - ema)/ma > 0.025 ? crossunder(close, ema): false //:crossunder(close, ema)
longEntry = (tradeType == "LONG" or tradeType == "BOTH") and long
shortEntry = (tradeType == "SHORT" or tradeType == "BOTH") and short
//Upon Entry, do this.
if longEntry or shortEntry
entryPrice := ohlc4
entryPrice
//set price points for new orders
use_dz_sl = input(true, title="Use DZ SL")
if isLongOpen
stopLossLevel := use_dz_sl? max(smplAbove, ma) : ema - 0.25*atr_multi_PT* atr(32) //ma
profitTrail = ma + atr_multi_PT* atr(32)
profitPriceLevel := max( (1 + 0.01 * profitPercent_long) * entryPrice, profitTrail)
profitPriceLevel
if isShortOpen
stopLossLevel := use_dz_sl? min(smplBelow, ma) : ema + 0.25*atr_multi_PT* atr(32) //ma
profitTrail = ma - atr_multi_PT* atr(32)
profitPriceLevel := min( (1 - 0.01 * profitPercent_short) * entryPrice, profitTrail)
profitPriceLevel
shortExit = isShortOpen[1] and (isStopLoss or isProfitCatch or longEntry)
longExit = isLongOpen[1] and (isStopLoss or isProfitCatch or shortEntry)
if (longExit or shortExit) and not(longEntry or shortEntry)
trigger := na
profitTrigger := na
entryPrice := na
stopLossLevel := na
profitPriceLevel := na
// highest := na
// lowest := na
// lowest
if testPeriod() and (tradeType == "LONG" or tradeType == "BOTH")
strategy.entry("long", strategy.long, when=longEntry)
strategy.close("long", when=longExit)
if testPeriod() and (tradeType == "SHORT" or tradeType == "BOTH")
strategy.entry("short", strategy.short, when=shortEntry)
strategy.close("short", when=shortExit)
//If the value changed to invoke a buy, lets set it before we leave
isLongOpen := longEntry ? true : longExit == true ? false : isLongOpen
isShortOpen := shortEntry ? true : shortExit == true ? false : isShortOpen
plotshape(isShortOpen, title="Short Open", color=color.red, style=shape.triangledown, location=location.bottom)
plotshape(isLongOpen, title="Long Open", color=color.green, style=shape.triangleup, location=location.bottom)
plotshape(entryPrice ? entryPrice : na, title="Entry Level", color=color.black, style=shape.cross, location=location.absolute)
plotshape(stopLossLevel ? stopLossLevel : na, title="Stop Loss Level", color=color.orange, style=shape.xcross, location=location.absolute)
plotshape(profitPriceLevel ? profitPriceLevel : na, title="Profit Level", color=color.blue, style=shape.xcross, location=location.absolute)
plotshape(profitTrigger[1] ? isProfitCatch : na, title="Profit Exit Triggered", style=shape.diamond, location=location.abovebar, color=color.blue, size=size.small)
plotshape(trigger[1] ? isStopLoss : na, title="Stop Loss Triggered", style=shape.diamond, location=location.belowbar, color=color.orange, size=size.small)
plot(ma, title="MA 16", color=color.yellow)
plot(ema, title="EMA 7", color=color.blue)