
समय-सीमा शक्ति खरीद और बिक्री रणनीति एक रणनीति है जो एक दिन में विभिन्न समय-सीमाओं में शेयरों की कीमतों के आंदोलन का उपयोग करती है। यह दिन के 48 आधे घंटे के समय-सीमा के भीतर सबसे अच्छा समय का निर्धारण करती है।
इस रणनीति का मुख्य तर्क यह है कि शेयरों में दिन के विभिन्न समय क्षेत्रों में, उनके मूल्य आंदोलन अक्सर नियमित होते हैं। रणनीति 48 और आधे घंटे के समय के अंतराल को सेट करके और प्रत्येक समय क्षेत्र में निर्णय लेने के लिए तीन विकल्पों का निर्णय करती है। जब समय एक क्षेत्र में प्रवेश करता है, तो यदि सेट किया जाता है, तो स्थिति को खोला जाता है; यदि सेट किया जाता है, तो स्थिति को खोला जाता है। क्षेत्र के अंत में, अगले समय क्षेत्र के संचालन के प्रकार की जांच की जाती है, यदि यह वर्तमान के समान है, तो स्थिति को जारी रखें; यदि यह अलग है, तो क्षेत्र के अंत से पहले स्थिति को खाली कर दिया जाएगा।
उदाहरण के लिए, यदि 6:30 से 7 बजे के बीच अधिक करने के लिए सेट किया गया है, तो रणनीति 6:30 पर अधिक होगी; यदि 7 बजे से 7:30 बजे के बीच कम करने के लिए सेट किया गया है, तो रणनीति 7 बजे से पहले पहले के कई आदेशों को खत्म कर देगी, और फिर 7 बजे के लिए स्थिति खोलेगी।
इस रणनीति का लाभ यह है कि यह एक दिन में शेयरों की कीमतों में परिवर्तन के नियम को पकड़ सकता है। जोखिम यह है कि मूल्य परिवर्तन के नियम समय के साथ बदल सकते हैं, जिससे रणनीति विफल हो जाती है।
इस रणनीति का सबसे बड़ा लाभ यह है कि यह शेयरों की कीमतों की सही विशेषता का उपयोग करता है, जो कि कीमतों में अलग-अलग औसत और अंतर है। यह रणनीति को अधिक उतार-चढ़ाव के समय में एक सीमा व्यापार रणनीति का उपयोग करने और कम उतार-चढ़ाव के समय में एक प्रवृत्ति रणनीति का उपयोग करने और बाजार में बदलाव के लिए लचीलापन प्रदान करने की अनुमति देता है।
एक और लाभ पैरामीटर सेटिंग की लचीलापन है। आप विभिन्न शेयरों की विशेषताओं के आधार पर पैरामीटर के इष्टतम संयोजन का चयन कर सकते हैं, आंशिक अनिश्चितता जोखिम को कवर कर सकते हैं।
मुख्य जोखिम परिकल्पना की अस्थिरता से आता है। यदि एक दिन के भीतर शेयर की कीमतों में बदलाव की प्रथा बदल जाती है, तो रणनीति की लाभप्रदता की उम्मीद प्रभावित हो जाती है। यह परिवर्तन स्टॉक के मूलभूत तत्वों से या बड़े परिवेश के काले रंग की घटनाओं से उत्पन्न हो सकता है।
इसके अलावा, बहुत अधिक लेनदेन से लेनदेन शुल्क का जोखिम भी होता है। यदि पर्याप्त लेनदेन की मात्रा का समर्थन नहीं किया जाता है, तो लेनदेन शुल्क का संचय भी अंतिम आय को प्रभावित करेगा।
उदाहरण के लिए, एलएसटीएम मॉडल को प्रशिक्षित करने के लिए, अगले समय अवधि के लिए स्टॉक की कीमतों की भविष्यवाणी करने के लिए, और इसके आधार पर अधिक रिक्तियों के लिए पैरामीटर को समायोजित करने के लिए।
या, आप स्टॉक के साथ बुनियादी संकेतकों का उपयोग करके यह पता लगाने की कोशिश कर सकते हैं कि क्या मूल्य परिवर्तन नियम में बदलाव की संभावना है, ताकि रणनीति शुरू करने का समय निर्धारित किया जा सके।
समय सीमा शक्ति खरीद और बिक्री रणनीति एक दिन के भीतर शेयरों की कीमत में परिवर्तन के नियमों का विश्लेषण करके, अल्फा प्राप्त करने के लिए विभिन्न समय सीमाओं में इष्टतम कार्रवाई करना। यह एक उच्च दक्षता वाले एल्गोरिथ्म ट्रेडिंग रणनीति है जो पैरामीटर को समायोजित करने के लिए लचीला, जोखिम-नियंत्रित है। भविष्य के अनुकूलन दिशा में, मशीन सीखने के मॉडल को पेश करने पर विचार किया जा सकता है, या मौलिक निर्णय के साथ मिलकर, रणनीति को अधिक लाभप्रद बनाने के लिए, जोखिम प्रतिरोधी क्षमता को मजबूत करना।
/*backtest
start: 2023-10-23 00:00:00
end: 2023-11-22 00:00:00
period: 1h
basePeriod: 15m
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/
//@version=4
strategy("Timeframe Time of Day Buying and Selling Strategy", overlay=true)
frommonth = input(defval = 6, minval = 01, maxval = 12, title = "From Month")
fromday = input(defval = 14, minval = 01, maxval = 31, title = "From day")
fromyear = input(defval = 2021, minval = 1900, maxval = 2100, title = "From Year")
tomonth = input(defval = 12, minval = 01, maxval = 12, title = "To Month")
today = input(defval = 31, minval = 01, maxval = 31, title = "To day")
toyear = input(defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
timeframes = array.new_string(48, '')
timeframes_options = array.new_string(49, 'None')
array.set(timeframes,0,'2330-0000')
array.set(timeframes_options,0, input(defval='None', options=['Long','Short','None'], title='0000-0030'))
array.set(timeframes,1,'0000-0030')
array.set(timeframes_options,1, input(defval='Long', options=['Long','Short','None'], title='0030-0100'))
array.set(timeframes,2,'0030-0100')
array.set(timeframes_options,2, input(defval='Long', options=['Long','Short','None'], title='0100-0130'))
array.set(timeframes,3,'0100-0130')
array.set(timeframes_options,3, input(defval='Long', options=['Long','Short','None'], title='0130-0200'))
array.set(timeframes,4,'0130-0200')
array.set(timeframes_options,4, input(defval='Long', options=['Long','Short','None'], title='0200-0230'))
array.set(timeframes,5,'0200-0230')
array.set(timeframes_options,5, input(defval='None', options=['Long','Short','None'], title='0230-0300'))
array.set(timeframes,6,'0230-0300')
array.set(timeframes_options,6, input(defval='None', options=['Long','Short','None'], title='0300-0330'))
array.set(timeframes,7,'0300-0330')
array.set(timeframes_options,7, input(defval='None', options=['Long','Short','None'], title='0330-0400'))
array.set(timeframes,8,'0330-0400')
array.set(timeframes_options,8, input(defval='None', options=['Long','Short','None'], title='0400-0430'))
array.set(timeframes,9,'0400-0430')
array.set(timeframes_options,9, input(defval='None', options=['Long','Short','None'], title='0430-0500'))
array.set(timeframes,10,'0430-0500')
array.set(timeframes_options,10, input(defval='None', options=['Long','Short','None'], title='0500-0530'))
array.set(timeframes,11,'0500-0530')
array.set(timeframes_options,11, input(defval='None', options=['Long','Short','None'], title='0530-0600'))
array.set(timeframes,12,'0530-0600')
array.set(timeframes_options,12, input(defval='None', options=['Long','Short','None'], title='0600-0630'))
array.set(timeframes,13,'0600-0630')
array.set(timeframes_options,13, input(defval='None', options=['Long','Short','None'], title='0630-0700'))
array.set(timeframes,14,'0630-0700')
array.set(timeframes_options,14, input(defval='None', options=['Long','Short','None'], title='0700-0730'))
array.set(timeframes,15,'0700-0730')
array.set(timeframes_options,15, input(defval='None', options=['Long','Short','None'], title='0730-0800'))
array.set(timeframes,16,'0730-0800')
array.set(timeframes_options,16, input(defval='None', options=['Long','Short','None'], title='0800-0830'))
array.set(timeframes,17,'0800-0830')
array.set(timeframes_options,17, input(defval='None', options=['Long','Short','None'], title='0830-0900'))
array.set(timeframes,18,'0830-0900')
array.set(timeframes_options,18, input(defval='None', options=['Long','Short','None'], title='0900-0930'))
array.set(timeframes,19,'0900-0930')
array.set(timeframes_options,19, input(defval='None', options=['Long','Short','None'], title='0930-1000'))
array.set(timeframes,20,'0930-1000')
array.set(timeframes_options,20, input(defval='None', options=['Long','Short','None'], title='1000-1030'))
array.set(timeframes,21,'1000-1030')
array.set(timeframes_options,21, input(defval='None', options=['Long','Short','None'], title='1030-1100'))
array.set(timeframes,22,'1030-1100')
array.set(timeframes_options,22, input(defval='None', options=['Long','Short','None'], title='1100-1130'))
array.set(timeframes,23,'1100-1130')
array.set(timeframes_options,23, input(defval='None', options=['Long','Short','None'], title='1130-1200'))
array.set(timeframes,24,'1130-1200')
array.set(timeframes_options,24, input(defval='None', options=['Long','Short','None'], title='1200-1230'))
array.set(timeframes,25,'1200-1230')
array.set(timeframes_options,25, input(defval='None', options=['Long','Short','None'], title='1230-1300'))
array.set(timeframes,26,'1230-1300')
array.set(timeframes_options,26, input(defval='None', options=['Long','Short','None'], title='1300-1330'))
array.set(timeframes,27,'1300-1330')
array.set(timeframes_options,27, input(defval='None', options=['Long','Short','None'], title='1330-1400'))
array.set(timeframes,28,'1330-1400')
array.set(timeframes_options,28, input(defval='None', options=['Long','Short','None'], title='1400-1430'))
array.set(timeframes,29,'1400-1430')
array.set(timeframes_options,29, input(defval='None', options=['Long','Short','None'], title='1430-1500'))
array.set(timeframes,30,'1430-1500')
array.set(timeframes_options,30, input(defval='None', options=['Long','Short','None'], title='1500-1530'))
array.set(timeframes,31,'1500-1530')
array.set(timeframes_options,31, input(defval='None', options=['Long','Short','None'], title='1530-1600'))
array.set(timeframes,32,'1530-1600')
array.set(timeframes_options,32, input(defval='None', options=['Long','Short','None'], title='1600-1630'))
array.set(timeframes,33,'1600-1630')
array.set(timeframes_options,33, input(defval='None', options=['Long','Short','None'], title='1630-1700'))
array.set(timeframes,34,'1630-1700')
array.set(timeframes_options,34, input(defval='None', options=['Long','Short','None'], title='1700-1730'))
array.set(timeframes,35,'1700-1730')
array.set(timeframes_options,35, input(defval='None', options=['Long','Short','None'], title='1730-1800'))
array.set(timeframes,36,'1730-1800')
array.set(timeframes_options,36, input(defval='None', options=['Long','Short','None'], title='1800-1830'))
array.set(timeframes,37,'1800-1830')
array.set(timeframes_options,37, input(defval='None', options=['Long','Short','None'], title='1830-1900'))
array.set(timeframes,38,'1830-1900')
array.set(timeframes_options,38, input(defval='None', options=['Long','Short','None'], title='1900-0930'))
array.set(timeframes,39,'1900-0930')
array.set(timeframes_options,39, input(defval='None', options=['Long','Short','None'], title='1930-2000'))
array.set(timeframes,40,'1930-2000')
array.set(timeframes_options,40, input(defval='None', options=['Long','Short','None'], title='2000-2030'))
array.set(timeframes,41,'2000-2030')
array.set(timeframes_options,41, input(defval='None', options=['Long','Short','None'], title='2030-2100'))
array.set(timeframes,42,'2030-2100')
array.set(timeframes_options,42, input(defval='None', options=['Long','Short','None'], title='2100-2130'))
array.set(timeframes,43,'2100-2130')
array.set(timeframes_options,43, input(defval='None', options=['Long','Short','None'], title='2130-2200'))
array.set(timeframes,44,'2130-2200')
array.set(timeframes_options,44, input(defval='None', options=['Long','Short','None'], title='2200-2230'))
array.set(timeframes,45,'2200-2230')
array.set(timeframes_options,45, input(defval='None', options=['Long','Short','None'], title='2230-2300'))
array.set(timeframes,46,'2230-2300')
array.set(timeframes_options,46, input(defval='None', options=['Long','Short','None'], title='2300-2330'))
array.set(timeframes,47,'2300-2330')
array.set(timeframes_options,47, input(defval='None', options=['Long','Short','None'], title='2330-0000'))
string_hour = hour<10?'0'+tostring(hour):tostring(hour)
string_minute = minute<10?'0'+tostring(minute):tostring(minute)
current_time = string_hour+string_minute
f_strLeft(_str, _n) =>
string[] _chars = str.split(_str, "")
int _len = array.size(_chars)
int _end = min(_len, max(0, _n))
string[] _substr = array.new_string(0)
if _end <= _len
_substr := array.slice(_chars, 0, _end)
string _return = array.join(_substr, "")
f_strRight(_str, _n) =>
string[] _chars = str.split(_str, "")
int _len = array.size(_chars)
int _beg = max(0, _len - _n)
string[] _substr = array.new_string(0)
if _beg < _len
_substr := array.slice(_chars, _beg, _len)
string _return = array.join(_substr, "")
for i = 0 to array.size(timeframes) - 1
start_time = f_strLeft(array.get(timeframes, i), 4)
end_time = f_strRight(array.get(timeframes, i), 4)
if current_time == end_time and array.get(timeframes_options, i)!='None' and array.get(timeframes_options, i) != array.get(timeframes_options, i==47?0:i+1) and timestamp(toyear, tomonth, today, 00, 00)
strategy.close_all()
if current_time == start_time and array.get(timeframes_options, i)!='None' and array.get(timeframes_options, i) != array.get(timeframes_options, i==0?47:i-1)
if array.get(timeframes_options, i) == 'Long'
strategy.entry("Long", strategy.long, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 00, 00)))
else if array.get(timeframes_options, i) == 'Short'
strategy.entry("Short", strategy.short, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 00, 00)))