
এই কৌশলটি চলমান গড়, RSI সূচক এবং ট্রেলিং স্টপের উপর ভিত্তি করে একটি পরিমাণগত ট্রেডিং সিস্টেম। এটি প্রযুক্তিগত বিশ্লেষণে প্রবণতা ট্র্যাকিং এবং মোমেন্টাম ইন্ডিকেটরকে একত্রিত করে কঠোর প্রবেশ এবং প্রস্থান শর্ত নির্ধারণ করে ঝুঁকি-নিয়ন্ত্রণযোগ্য ট্রেডিং অর্জন করতে। কৌশলটির মূল যুক্তি হল ঊর্ধ্বমুখী প্রবণতার সময় বাজারে প্রবেশের জন্য ওভারবিক্রীত সুযোগ সন্ধান করা এবং লাভ রক্ষা করার জন্য ট্রেলিং স্টপ ব্যবহার করা।
কৌশলটি ট্রেন্ড জাজমেন্টের জন্য বেসলাইন হিসাবে 200-দিনের সহজ মুভিং এভারেজ (SMA) ব্যবহার করে এবং ট্রেডিং সিগন্যাল তৈরি করতে আপেক্ষিক শক্তি সূচক (RSI) এর সাথে এটিকে একত্রিত করে। বিশেষভাবে:
এটি সম্পূর্ণ কাঠামো এবং স্পষ্ট যুক্তি সহ একটি পরিমাণগত ট্রেডিং কৌশল। একাধিক প্রযুক্তিগত সূচক একত্রিত করে, এটি ঝুঁকি নিয়ন্ত্রণ করার সময় স্থিতিশীল রিটার্ন অনুসরণ করে। যদিও অপ্টিমাইজেশনের জন্য কিছু জায়গা আছে, মৌলিক কাঠামোর ভাল ব্যবহারিকতা এবং মাপযোগ্যতা রয়েছে। কৌশলটি মাঝারি এবং দীর্ঘমেয়াদী বিনিয়োগকারীদের জন্য উপযুক্ত এবং বিভিন্ন বাজারের পরিবেশের সাথে ভাল অভিযোজনযোগ্যতা রয়েছে।
/*backtest
start: 2025-01-09 00:00:00
end: 2025-01-16 00:00:00
period: 15m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("200 SMA Crossover Strategy", overlay=false)
// Define inputs
smaLength = input.int(200, title="SMA Length")
rsiLength = input.int(14, title="RSI Length")
rsiThreshold = input.float(40, title="RSI Threshold")
trailStopPercent = input.float(5.0, title="Trailing Stop Loss (%)")
waitingPeriod = input.int(10, title="Waiting Period (Days)")
// Calculate 200 SMA
sma200 = ta.sma(close, smaLength)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Plot the 200 SMA and RSI
plot(sma200, color=color.blue, linewidth=2, title="200 SMA")
plot(rsi, color=color.purple, title="RSI", display=display.none)
// Define buy and sell conditions
var isLong = false
var float lastExitTime = na
var float trailStopPrice = na
// Explicitly declare timeSinceExit as float
float timeSinceExit = na(lastExitTime) ? na : (time - lastExitTime) / (24 * 60 * 60 * 1000)
canEnter = na(lastExitTime) or timeSinceExit > waitingPeriod
buyCondition = close > sma200 and rsi < rsiThreshold and canEnter
if (buyCondition and not isLong)
strategy.entry("Buy", strategy.long)
trailStopPrice := na
isLong := true
// Update trailing stop loss if long
if (isLong)
trailStopPrice := na(trailStopPrice) ? close * (1 - trailStopPercent / 100) : math.max(trailStopPrice, close * (1 - trailStopPercent / 100))
// Check for trailing stop loss or sell condition
if (isLong and (close < trailStopPrice or close < sma200))
strategy.close("Buy")
lastExitTime := time
isLong := false
// Plot buy and sell signals
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=(isLong and close < trailStopPrice) or close < sma200, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")