सरल अस्थिरता ईएमवी रणनीति

लेखक:अच्छाई, बनाया गयाः 2020-07-01 10:39:17, अद्यतन किया गयाः 2023-10-28 15:26:49

img

सारांश

अन्य तकनीकी संकेतकों के विपरीत, आसानी से चलती मूल्य मूल्य, मात्रा और लोकप्रियता में परिवर्तन को दर्शाता है। यह एक ऐसी तकनीक है जो कीमतों और मात्रा में परिवर्तन को जोड़ती है। यह इकाई मात्रा के मूल्य परिवर्तन को मापता है, मूल्य अस्थिरता संकेतक का गठन करता है। जब बाजार लोकप्रियता प्राप्त करता है और लेनदेन सक्रिय होता है, तो यह एक खरीद संकेत को प्रेरित करता है; जब व्यापारिक मात्रा कम होती है, और बाजार की ऊर्जा खत्म होने वाली है, तो यह एक बिक्री संकेत को प्रेरित करता है।

सरल अस्थिरता ईएमवी समान मात्रा चार्ट और संपीड़ित चार्ट के सिद्धांत के अनुसार डिज़ाइन किया गया है। इसकी मुख्य अवधारणा यह हैः बाजार मूल्य केवल तब बहुत अधिक ऊर्जा का उपभोग करेगा जब प्रवृत्ति बदल जाती है या बदलने के बारे में है, और बाहरी प्रदर्शन यह है कि ट्रेडिंग वॉल्यूम बड़ा हो जाता है। जब कीमत बढ़ रही है, तो यह बढ़ावा देने के प्रभाव के कारण बहुत अधिक ऊर्जा का उपभोग नहीं करेगी। हालांकि यह विचार इस विचार के विपरीत है कि मात्रा और मूल्य दोनों बढ़ते हैं, इसकी अपनी अनूठी विशेषताएं हैं।

ईएमवी गणना सूत्र

चरण 1: mov_mid की गणना करें

इनमें TH दिन की उच्चतम कीमत, TL दिन की निम्नतम कीमत, YH पिछले दिन की उच्चतम कीमत और YL पिछले दिन की निम्नतम कीमत का प्रतिनिधित्व करता है। फिर यदि MID> 0 का अर्थ है कि आज की औसत कीमत कल की औसत कीमत से अधिक है।

img

चरण 2: अनुपात की गणना करें

इनमें से, TVOL दिन की व्यापारिक मात्रा का प्रतिनिधित्व करता है, TH दिन की उच्चतम कीमत का प्रतिनिधित्व करता है, और TL दिन की सबसे कम कीमत का प्रतिनिधित्व करता है।

img

चरण 3: ईएमवी की गणना करें

img

ईएमवी उपयोग

ईएमवी के लेखक का मानना है कि भारी वृद्धि ऊर्जा की तेजी से समाप्ति के साथ होती है, और वृद्धि अक्सर बहुत लंबे समय तक नहीं रहती है; इसके विपरीत, मध्यम मात्रा, जो कुछ मात्रा में ऊर्जा बचा सकती है, अक्सर वृद्धि को अधिक समय तक बनाती है। एक बार जब एक ऊपर की प्रवृत्ति बन जाती है, तो कम व्यापारिक मात्रा कीमतों को ऊपर धकेल सकती है, और ईएमवी का मूल्य बढ़ जाएगा। एक बार जब डाउनट्रेंड बाजार बन जाता है, तो यह अक्सर एक अनंत या छोटी गिरावट के साथ होता है, और ईएमवी का मूल्य गिर जाएगा। यदि कीमत एक अस्थिर बाजार में है या कीमतों में वृद्धि और गिरावट एक बड़ी मात्रा के साथ होती है, तो ईएमवी का मूल्य भी शून्य के करीब होगा। तो आप पाएंगे कि ईएमवी अधिकांश बाजारों में शून्य अक्ष से नीचे है, जो इस संकेतक की एक प्रमुख विशेषता भी है। एक और परिप्रेक्ष्य से, ईएमवी-मेगा-ट्रेंड्स पर्याप्त मूल्य और लाभ उत्पन्न कर सकते हैं।

ईएमवी का उपयोग काफी सरल है, बस यह देखें कि क्या ईएमवी शून्य अक्ष को पार करता है। जब ईएमवी 0 से नीचे होता है, तो यह एक कमजोर बाजार का प्रतिनिधित्व करता है; जब ईएमवी 0 से ऊपर होता है, तो यह एक मजबूत बाजार का प्रतिनिधित्व करता है। जब ईएमवी नकारात्मक से सकारात्मक में बदल जाता है, तो इसे खरीदा जाना चाहिए; जब ईएमवी सकारात्मक से नकारात्मक में बदल जाता है, तो इसे बेचा जाना चाहिए। इसकी विशेषता यह है कि यह न केवल बाजार में सदमे से बच सकता है, बल्कि ट्रेंड मार्केट शुरू होने के समय बाजार में भी प्रवेश कर सकता है। हालांकि, क्योंकि ईएमवी कीमतों में बदलाव के समय वॉल्यूम में बदलाव को दर्शाता है, इसलिए इसका केवल मध्यम से दीर्घकालिक रुझानों पर प्रभाव पड़ता है। अल्पकालिक या अपेक्षाकृत छोटे ट्रेडिंग चक्रों के लिए, ईएमवी का प्रभाव बहुत खराब है।

रणनीति का कार्यान्वयन

चरण 1: एक रणनीति ढांचा लिखें

# Strategy main function
def onTick():
     pass

# Program entry
def main():
     while True: # Enter infinite loop mode
         onTick() # execution strategy main function
         Sleep(1000) # sleep for 1 second

FMZ.COMघुमावदार प्रशिक्षण मोड को अपनाता है।mainकार्य और एकonTickकार्य।mainकार्य रणनीति का प्रवेश कार्य है, और कार्यक्रम कोड लाइन द्वारा लाइन से निष्पादित करेगाmainकार्य मेंmainकार्य, लिखेंwhileलूप और बार-बार निष्पादितonTickरणनीति का सारा कोर कोडonTick function.

चरण 2: स्थान डेटा प्राप्त करें

def get_position():
     position = 0 # The number of assigned positions is 0
     position_arr = _C(exchange.GetPosition) # Get array of positions
     if len(position_arr)> 0: # If the position array length is greater than 0
         for i in position_arr: # Traverse the array of positions
             if i['ContractType'] =='IH000': # If the position symbol is equal to the subscription symbol
                 if i['Type']% 2 == 0: # if it is long position
                     position = i['Amount'] # Assign a positive number of positions
                 else:
                     position = -i['Amount'] # Assign the number of positions to be negative
     return position # return position quantity

क्योंकि इस रणनीति में, केवल वास्तविक समय की स्थिति की संख्या का उपयोग किया जाता है, ताकि रखरखाव को आसान बनाया जा सके,get_positionपदों की मात्रा को शामिल करने के लिए प्रयोग किया जाता है. यदि वर्तमान स्थिति लंबी है, तो यह एक सकारात्मक संख्या लौटाता है, और यदि वर्तमान स्थिति छोटी है, तो यह एक नकारात्मक संख्या लौटाता है.

चरण 3: के-लाइन डेटा प्राप्त करें

exchange.SetContractType('IH000') # Subscribe to futures variety
bars_arr = exchange.GetRecords() # Get K-line array
if len(bars_arr) <10: # If the number of K lines is less than 10
     return

विशिष्ट के-लाइन डेटा प्राप्त करने से पहले आपको पहले एक विशिष्ट ट्रेडिंग अनुबंध की सदस्यता लेनी होगी,SetContractTypeकार्य सेFMZ.COM, और अनुबंध कोड में पारित. यदि आप अनुबंध के बारे में अन्य जानकारी जानना चाहते हैं, आप भी एक चर का उपयोग कर सकते हैं इन डेटा प्राप्त करने के लिए. तो उपयोगGetRecordsके-लाइन डेटा प्राप्त करने के लिए समारोह, क्योंकि लौटाया एक सरणी है, इसलिए हम चर का उपयोगbars_arrइसे स्वीकार करने के लिए।

चरण 4: ईएमवी की गणना करें

bar1 = bars_arr[-2] # Get the previous K-line data
bar2 = bars_arr[-3] # get the previous K-line data
# Calculate the value of mov_mid
mov_mid = (bar1['High'] + bar1['Low']) / 2-(bar2['High'] + bar2['Low']) / 2
if bar1['High'] != bar1['Low']: # If the dividend is not 0
     # Calculate the value of ratio
     ratio = (bar1['Volume'] / 10000) / (bar1['High']-bar1['Low'])
else:
     ratio = 0
# If the value of ratio is greater than 0
if ratio> 0:
     emv = mov_mid / ratio
else:
     emv = 0

यहां, हम ईएमवी के मूल्य की गणना करने के लिए नवीनतम मूल्य का उपयोग नहीं करते हैं, लेकिन संकेत को आउटपुट करने के लिए अपेक्षाकृत पिछड़ी वर्तमान के लाइन का उपयोग करते हैं और ऑर्डर जारी करने के लिए एक के लाइन रखते हैं। इसका उद्देश्य वास्तविक ट्रेडिंग के करीब बैकटेस्ट करना है। हम जानते हैं कि हालांकि मात्रात्मक ट्रेडिंग सॉफ्टवेयर अब बहुत उन्नत है, फिर भी वास्तविक मूल्य टिक वातावरण का पूरी तरह से अनुकरण करना मुश्किल है, खासकर जब बैकटेस्टिंग बार-स्तर के लंबे डेटा का सामना करना पड़ता है, इसलिए इस समझौता विधि का उपयोग किया जाता है।

चरण 5: ऑर्डर देना

current_price = bars_arr[-1]['Close'] # latest price
position = get_position() # Get the latest position
if position> 0: # If you are holding long positions
    if emv <0: # If the current price is less than teeth
        exchange.SetDirection("closebuy") # Set the trading direction and type
        exchange.Sell(round(current_price-0.2, 2), 1) # close long position
if position <0: # If you are holding short positions
    if emv> 0: # If the current price is greater than the teeth
        exchange.SetDirection("closesell") # Set the trading direction and type
        exchange.Buy(round(current_price + 0.2, 2), 1) # close short position
if position == 0: # If there is no holding position
    if emv> 0: # If the current price is greater than the upper lip
        exchange.SetDirection("buy") # Set the trading direction and type
        exchange.Buy(round(current_price + 0.2, 2), 1) # open long position
    if emv <0: # if the current price is smaller than the chin
        exchange.SetDirection("sell") # Set the trading direction and type
        exchange.Sell(round(current_price-0.2, 2), 1) # open short position

आदेश देने से पहले, हमें दो डेटा निर्धारित करने की आवश्यकता है, एक आदेश की कीमत है और दूसरा वर्तमान स्थिति की स्थिति है। एक आदेश रखने की कीमत बहुत सरल है, बस वर्तमान समापन मूल्य का उपयोग करने के लिए जोड़ने या विविधता के न्यूनतम परिवर्तन मूल्य को घटाने के लिए। चूंकि हमने उपयोग किया हैget_positionस्थिति को कैप्सूल करने के लिए समारोह, हम इसे सीधे यहां कॉल कर सकते हैं। अंत में, स्थिति EMV और शून्य अक्ष के बीच स्थिति संबंध के अनुसार खोला और बंद है।

रणनीति बैकटेस्ट

बैकटेस्ट कॉन्फ़िगरेशन

img

बैकटेस्ट लॉग

img img

पूंजी वक्र

img

पूर्ण रणनीति

# Backtest configuration
'''backtest
start: 2019-01-01 00:00:00
end: 2020-01-01 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_CTP","currency":"FUTURES"}]
'''


def get_position():
     position = 0 # The number of assigned positions is 0
     position_arr = _C(exchange.GetPosition) # Get array of positions
     if len(position_arr)> 0: # If the position array length is greater than 0
         for i in position_arr: # Traverse the array of positions
             if i['ContractType'] =='IH000': # If the position symbol is equal to the subscription symbol
                 if i['Type']% 2 == 0: # if it is long position
                     position = i['Amount'] # Assign a positive number of positions
                 else:
                     position = -i['Amount'] # Assign the number of positions to be negative
     return position # return position quantity


# Strategy main function
def onTick():
     # retrieve data
     exchange.SetContractType('IH000') # Subscribe to futures
     bars_arr = exchange.GetRecords() # Get K-line array
     if len(bars_arr) <10: # If the number of K lines is less than 10
         return

     # Calculate emv
     bar1 = bars_arr[-2] # Get the previous K-line data
     bar2 = bars_arr[-3] # get the previous K-line data
     # Calculate the value of mov_mid
     mov_mid = (bar1['High'] + bar1['Low']) / 2-(bar2['High'] + bar2['Low']) / 2
     if bar1['High'] != bar1['Low']: # If the dividend is not 0
          # Calculate the value of ratio
          ratio = (bar1['Volume'] / 10000) / (bar1['High']-bar1['Low'])
     else:
          ratio = 0
     # If the value of ratio is greater than 0
     if ratio> 0:
          emv = mov_mid / ratio
     else:
          emv = 0

     # Placing orders
     current_price = bars_arr[-1]['Close'] # latest price
     position = get_position() # Get the latest position
     if position> 0: # If you are holding long positions
          if emv <0: # If the current price is less than teeth
               exchange.SetDirection("closebuy") # Set the trading direction and type
               exchange.Sell(round(current_price-0.2, 2), 1) # close long position
     if position <0: # If you are holding short positions
          if emv> 0: # If the current price is greater than the teeth
               exchange.SetDirection("closesell") # Set the trading direction and type
               exchange.Buy(round(current_price + 0.2, 2), 1) # close short position
     if position == 0: # If there is no holding position
          if emv> 0: # If the current price is greater than the upper lip
               exchange.SetDirection("buy") # Set the trading direction and type
               exchange.Buy(round(current_price + 0.2, 2), 1) # open long position
     if emv <0: # if the current price is smaller than the chin
               exchange.SetDirection("sell") # Set the trading direction and type
               exchange.Sell(round(current_price-0.2, 2), 1) # open short position

# Program entry
def main():
     while True: # Enter infinite loop mode
         onTick() # execution strategy main function
         Sleep(1000) # sleep for 1 second

पूरी रणनीति का प्रकाशन 'स्ट्रैटेजी स्क्वायर' पर किया गया है।FMZ.COMवेबसाइट, और इसका उपयोग कॉपी पर क्लिक करके किया जा सकता है।https://www.fmz.com/strategy/213636

संक्षेप में

इस अध्ययन के माध्यम से, हम देख सकते हैं कि ईएमवी आम व्यापारियों के विपरीत है, लेकिन यह अनुचित नहीं है। क्योंकि ईएमवी मात्रा डेटा पेश करता है, यह अन्य तकनीकी संकेतकों की तुलना में अधिक प्रभावी है जो मूल्य गणना का उपयोग मूल्य के पीछे क्या है यह पता लगाने के लिए करते हैं। प्रत्येक रणनीति की अलग-अलग विशेषताएं हैं। केवल विभिन्न रणनीतियों के फायदे और नुकसान को पूरी तरह से समझकर और कचरे को हटाने और इसके सार को निकालने से हम सफलता से आगे बढ़ सकते हैं।


संबंधित

अधिक