
এই কৌশলটি একটি সমন্বিত ট্রেডিং সিস্টেম যা সূচকীয় মুভিং এভারেজ (ইএমএ) ক্রস, ফিবোনাচি রিডাকশন স্তর, প্রবণতা বিচার এবং স্টপ লস ম্যানেজমেন্টের সাথে মিলিত। কৌশলটি 9 চক্র এবং 21 চক্রের ইএমএর ক্রস দ্বারা ট্রেডিং সংকেত নির্ধারণ করে, যখন ফিবোনাচি রিডাকশন স্তরের সাথে মিলিত হয় প্রবেশের পয়েন্ট পয়েন্টটি অপ্টিমাইজ করার জন্য এবং রিয়েল-টাইম ট্রেন্ড স্ট্যাটাস মনিটরিংয়ের মাধ্যমে ব্যবসায়ের নির্ভুলতা বাড়ানোর জন্য। সিস্টেমটি শতাংশ স্টপ লস ম্যানেজমেন্টও সংহত করে, যা কার্যকরভাবে ঝুঁকি নিয়ন্ত্রণ করে।
কৌশলটির মূল যুক্তি নিম্নলিখিত মূল উপাদানগুলির উপর ভিত্তি করে:
এই কৌশলটি বেশ কয়েকটি ক্লাসিক প্রযুক্তিগত বিশ্লেষণের সরঞ্জামকে একত্রিত করে একটি সম্পূর্ণ ট্রেডিং সিস্টেম তৈরি করে। এর সুবিধা হল সিগন্যাল স্বীকৃতির বহু মাত্রিকতা এবং ঝুঁকি পরিচালনার পদ্ধতিগতকরণ, তবে এখনও বিভিন্ন বাজার পরিবেশের জন্য অপ্টিমাইজেশন প্রয়োজন। ব্যবসায়ীদের পরামর্শ দেওয়া হয় যে তারা বাজারের নির্দিষ্ট পরিস্থিতির সাথে মিলিত প্যারামিটারগুলির জন্য অনুকূলিতকরণ করতে পারে এবং সর্বদা ঝুঁকি সম্পর্কে সতর্ক থাকতে পারে।
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-18 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"BNB_USDT"}]
*/
//@version=5
strategy("EMA Cross Strategy with TP, SL, Fibonacci Levels, and Trend", overlay=true)
// Input for stop loss and take profit percentages
stopLossPercentage = input.int(2, title="Stop Loss (%)") // Stop loss percentage
takeProfitPercentage = input.int(4, title="Take Profit (%)") // Take profit percentage
// EMA Length Inputs
fastEMALength = input.int(9, title="Fast EMA Length")
slowEMALength = input.int(21, title="Slow EMA Length")
// Compute EMAs
fastEMA = ta.ema(close, fastEMALength)
slowEMA = ta.ema(close, slowEMALength)
// Entry conditions for EMA crossover
longCondition = ta.crossover(fastEMA, slowEMA) // EMA 9 crosses above EMA 21
shortCondition = ta.crossunder(fastEMA, slowEMA) // EMA 9 crosses below EMA 21
// Plot EMAs
plot(fastEMA, color=color.blue, title="Fast EMA (9)")
plot(slowEMA, color=color.red, title="Slow EMA (21)")
// Fibonacci Retracement Levels
lookback = input.int(100, title="Lookback Period for Fibonacci Levels")
highLevel = ta.highest(high, lookback)
lowLevel = ta.lowest(low, lookback)
fib236 = lowLevel + (highLevel - lowLevel) * 0.236
fib382 = lowLevel + (highLevel - lowLevel) * 0.382
fib50 = lowLevel + (highLevel - lowLevel) * 0.5
fib618 = lowLevel + (highLevel - lowLevel) * 0.618
// Display Fibonacci levels (Left of the candle near price)
label.new(bar_index, fib236, text="Fib 23.6%: " + str.tostring(fib236, "#.##"), style=label.style_label_left, color=color.purple, textcolor=color.white, size=size.small)
label.new(bar_index, fib382, text="Fib 38.2%: " + str.tostring(fib382, "#.##"), style=label.style_label_left, color=color.blue, textcolor=color.white, size=size.small)
label.new(bar_index, fib50, text="Fib 50%: " + str.tostring(fib50, "#.##"), style=label.style_label_left, color=color.green, textcolor=color.white, size=size.small)
label.new(bar_index, fib618, text="Fib 61.8%: " + str.tostring(fib618, "#.##"), style=label.style_label_left, color=color.red, textcolor=color.white, size=size.small)
// Trend condition: Price uptrend or downtrend
trendCondition = close > fastEMA ? "Uptrending" : close < fastEMA ? "Downtrending" : "Neutral"
// Display Trend Status (Left of candle near price)
var label trendLabel = na
if (not na(trendLabel))
label.delete(trendLabel)
trendLabel := label.new(bar_index, close, text="Trend: " + trendCondition, style=label.style_label_left, color=color.blue, textcolor=color.white, size=size.small)
// Buy and Sell orders with Stop Loss and Take Profit
if (longCondition)
stopLossLevel = close * (1 - stopLossPercentage / 100)
takeProfitLevel = close * (1 + takeProfitPercentage / 100)
strategy.entry("BUY", strategy.long)
strategy.exit("Sell", "BUY", stop=stopLossLevel, limit=takeProfitLevel)
// Display TP, SL, and Buy label (Left of candle near price)
label.new(bar_index, takeProfitLevel, text="TP\n" + str.tostring(takeProfitLevel, "#.##"), style=label.style_label_left, color=color.green, textcolor=color.white, size=size.small)
label.new(bar_index, stopLossLevel, text="SL\n" + str.tostring(stopLossLevel, "#.##"), style=label.style_label_left, color=color.red, textcolor=color.white, size=size.small)
label.new(bar_index, close, text="BUY\n" + str.tostring(close, "#.##"), style=label.style_label_left, color=color.blue, textcolor=color.white, size=size.small)
if (shortCondition)
stopLossLevel = close * (1 + stopLossPercentage / 100)
takeProfitLevel = close * (1 - takeProfitPercentage / 100)
strategy.entry("SELL", strategy.short)
strategy.exit("Cover", "SELL", stop=stopLossLevel, limit=takeProfitLevel)
// Display TP, SL, and Sell label (Left of candle near price)
label.new(bar_index, takeProfitLevel, text="TP\n" + str.tostring(takeProfitLevel, "#.##"), style=label.style_label_left, color=color.green, textcolor=color.white, size=size.small)
label.new(bar_index, stopLossLevel, text="SL\n" + str.tostring(stopLossLevel, "#.##"), style=label.style_label_left, color=color.red, textcolor=color.white, size=size.small)
label.new(bar_index, close, text="SELL\n" + str.tostring(close, "#.##"), style=label.style_label_left, color=color.orange, textcolor=color.white, size=size.small)
// Plot Buy/Sell Signals
plotshape(series=longCondition, title="BUY Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="SELL Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")