
এই কৌশলটি একাধিক প্রযুক্তিগত সূচককে একত্রিত করে একটি স্বনির্ধারিত প্রবণতা ট্র্যাকিং ট্রেডিং সিস্টেম। এটি সমান্তরাল সিস্টেম (ইএমএ), গতিশীলতা সূচক (আরএসআই), প্রবণতা সূচক (এমএসিডি) এবং সুপারট্রেন্ডকে সংকেত নিশ্চিতকরণের জন্য সংযুক্ত করে এবং স্টপ লস, স্টপ স্টপ এবং মোবাইল স্টপ লস সহ একটি উন্নত ঝুঁকি ব্যবস্থাপনার সাথে সজ্জিত। কৌশলটি বাজারের অস্থিরতাকে পুরোপুরি বিবেচনা করে এবং একাধিক সংকেত ফিল্টারিং এবং ঝুঁকি নিয়ন্ত্রণের মাধ্যমে লেনদেনের স্থায়িত্ব এবং নির্ভরযোগ্যতা বাড়ায়।
এই কৌশলটি একাধিক স্তরের সংকেত নিশ্চিতকরণ পদ্ধতি ব্যবহার করেঃ
এই কৌশলটি বহু-মাত্রিক প্রযুক্তিগত সূচকগুলির সাথে সমন্বয় করে একটি স্থিতিশীল ট্রেডিং সিস্টেম তৈরি করে। একটি উন্নত ঝুঁকি নিয়ন্ত্রণ ব্যবস্থা এবং একটি পরিষ্কার ট্রেডিং লজিক এটিকে ভাল ব্যবহারিকতা দেয়। যদিও কিছু অপ্টিমাইজেশনের জায়গা রয়েছে, তবে কৌশলটির মৌলিক কাঠামোর একটি দৃ the় তাত্ত্বিক ভিত্তি রয়েছে যা ক্রমাগত অপ্টিমাইজেশন এবং উন্নতির মাধ্যমে তার ট্রেডিং কার্যকারিতা আরও বাড়ানোর সম্ভাবনা রয়েছে।
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("Optimized BTC Trading Strategy v2", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)
// Input parameters
emaShort = ta.ema(close, 9)
emaLong = ta.ema(close, 21)
// RSI settings
rsi = ta.rsi(close, 14)
rsiBuyLevel = 40
rsiSellLevel = 60
// MACD settings
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Supertrend settings
factor = input.float(3, title="Supertrend Factor")
atrLength = input.int(10, title="ATR Length")
[superTrend, superTrendDirection] = ta.supertrend(factor, atrLength)
// Risk Management (Stop Loss & Take Profit)
stopLossPercent = 0.05 // 5%
takeProfitPercent = 0.10 // 10%
trailingStopPercent = 0.02 // 2% trailing stop for additional security
breakevenBuffer = 0.01 // 1% breakeven buffer
// Fetching average price once to avoid repeated calculations
var float avgPrice = na
if strategy.position_size != 0
avgPrice := strategy.position_avg_price
// Stop Loss & Take Profit Levels
longSL = avgPrice * (1 - stopLossPercent)
longTP = avgPrice * (1 + takeProfitPercent)
shortSL = avgPrice * (1 + stopLossPercent)
shortTP = avgPrice * (1 - takeProfitPercent)
breakevenLevel = avgPrice * (1 + breakevenBuffer)
// Entry Conditions
buyCondition = ta.crossover(emaShort, emaLong) and rsi > rsiBuyLevel and rsi < 70 and (macdLine > signalLine) and superTrendDirection == 1
sellCondition = ta.crossunder(emaShort, emaLong) and rsi < rsiSellLevel and rsi > 30 and (macdLine < signalLine) and superTrendDirection == -1
// Ensure no conflicting trades
if buyCondition and strategy.position_size <= 0
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", from_entry="Long", limit=longTP, stop=longSL, trail_points=trailingStopPercent * avgPrice)
strategy.exit("Breakeven", from_entry="Long", stop=breakevenLevel)
if sellCondition and strategy.position_size >= 0
strategy.close("Long")
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", from_entry="Short", limit=shortTP, stop=shortSL, trail_points=trailingStopPercent * avgPrice)
strategy.exit("Breakeven", from_entry="Short", stop=breakevenLevel)
// Plot Buy & Sell signals with trend-based color indicators
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY", size=size.small)
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL", size=size.small)
// Trend Indicator (for better visualization)
plot(superTrend, color=superTrendDirection == 1 ? color.green : color.red, linewidth=2, title="Supertrend")