
यह रणनीति एक मात्रात्मक व्यापार रणनीति है जो प्रवृत्ति ट्रैकिंग और समय निकास तंत्र को जोड़ती है। रणनीति का मूल उद्देश्य मूल्य और 60-दिवसीय चल औसत के बीच संबंध का अवलोकन करके बाजार के रुझान को समझना है, साथ ही जोखिमों को नियंत्रित करने के लिए वर्ष के अंत में अनिवार्य परिसमापन तंत्र लागू करना है। जब समापन मूल्य 60-दिवसीय चलती औसत को तोड़ता है और चलती औसत का ढलान सकारात्मक होता है, तो बाजार में प्रवेश करें और लंबे समय तक बने रहें, तथा प्रत्येक वर्ष के अंतिम कारोबारी दिन सभी पोजीशन को बंद कर दें।
यह रणनीति निम्नलिखित मुख्य तत्वों पर आधारित है:
यह रणनीति प्रवृत्ति अनुसरण और समय प्रबंधन को मिलाकर एक अपेक्षाकृत मजबूत व्यापार प्रणाली का निर्माण करती है। रणनीति का तर्क सरल और स्पष्ट है, समझने और लागू करने में आसान है, तथा इसमें अच्छी व्यावहारिकता है। उचित पैरामीटर अनुकूलन और जोखिम नियंत्रण उपायों के पूरक के माध्यम से, इस रणनीति से वास्तविक लेनदेन में स्थिर रिटर्न प्राप्त होने की उम्मीद है।
/*backtest
start: 2025-01-09 00:00:00
end: 2025-01-16 00:00:00
period: 3m
basePeriod: 3m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("Buy above 60-day MA, Sell at year-end", overlay=true, pyramiding=1)
// Define inputs for start and end dates
startDate = input(defval=timestamp("2010-01-01"), title="Start Date")
endDate = input(defval=timestamp("2024-12-31"), title="End Date")
// Define 60-day moving average
length = input.int(defval=60, title="MA Length", minval=1)
ma = ta.sma(close, length)
slope = ta.sma(ma, 14) - ta.sma(ma, 14)[1]
// Check if current bar is within the specified date range
withinDateRange = true
// Function to check if a day is a trading day (Monday to Friday)
isTradingDay(day) => true
// Check if current bar is the last trading day of the year
// Check if current bar is the last trading day of the year
isLastTradingDayOfYear = false
yearNow = year(time)
if (month == 12 and dayofmonth == 31)
isLastTradingDayOfYear := isTradingDay(time)
else if (month == 12 and dayofmonth == 30)
isLastTradingDayOfYear := isTradingDay(time) and not isTradingDay(time + 86400000)
else if (month == 12 and dayofmonth == 29)
isLastTradingDayOfYear := isTradingDay(time) and not isTradingDay(time + 86400000) and not isTradingDay(time + 86400000 * 2)
// Plot moving average
plot(ma, color=color.blue, linewidth=2)
// Buy when closing price crosses above 60-day MA and up trend
if (withinDateRange and ta.crossover(close, ma) and slope > 0)
strategy.entry("Buy", strategy.long)
// Sell all positions at the last trading day of the year
if (isLastTradingDayOfYear)
strategy.close_all(comment="Sell at year-end")
// Plot buy and sell signals
//plotshape(series=ta.crossover(close, ma), location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
//plotshape(series=isLastTradingDayOfYear, location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")