Thursday 15 February 2018

ऑनलाइन - समय श्रृंखला चौरसाई - कलन विधि - विदेशी मुद्रा


मेटाट्रेडर 5 - संकेतक समय-सीमा का पूर्वानुमान एक्सपेंनेलीय स्मुटिंग (निरंतर) का उपयोग करना परिचय समयबद्धता का आकस्मिक चौरसाई का उपयोग करके 1 पूर्वानुमान ने घातीय चिकनाई मॉडल का एक संक्षिप्त सारांश दिया, मॉडल पैरामीटर अनुकूलित करने के लिए संभावित तरीकों में से एक को सचित्र किया और अंततः पूर्वानुमान सूचक का विकास किया भिगोना वाला रैखिक विकास मॉडल के आधार पर। यह लेख इस पूर्वानुमान सूचक की सटीकता में कुछ हद तक वृद्धि करने का प्रयास करता है। यह मुद्रा के उद्धरणों का अनुमान लगाने के लिए या आगे के तीन या चार चरणों के लिए काफी विश्वसनीय पूर्वानुमान प्राप्त करने के लिए जटिल है फिर भी, इस श्रृंखला के पिछले लेख के अनुसार, हम 12-कदम-आगे पूर्वानुमानों का उत्पादन करेंगे, जो स्पष्ट रूप से यह महसूस कर रहे होंगे कि इस तरह के एक लंबे क्षितिज पर संतोषजनक परिणाम प्राप्त करना असंभव होगा। संकीर्ण आत्मविश्वास के अंतराल के साथ पूर्वानुमान के पहले कुछ कदम इसलिए प्राथमिकता के लिए सबसे अधिक ध्यान दिया जाना चाहिए। 10 से 12-कदम-आगे पूर्वानुमान का उद्देश्य मुख्य रूप से विभिन्न मॉडलों और पूर्वानुमान विधियों के व्यवहार सुविधाओं के प्रदर्शन के लिए होता है। किसी भी स्थिति में, किसी भी क्षितिज के लिए प्राप्त पूर्वानुमान की सटीकता को विश्वास अंतराल सीमा का उपयोग करके मूल्यांकन किया जा सकता है। यह आलेख मूल रूप से कुछ तरीकों का प्रदर्शन करने के उद्देश्य से है, जो अनुक्रम को अपग्रेड करने में मदद कर सकते हैं, जैसा कि अनुच्छेद 1 में दिखाया गया है। संकेतक को विकसित करने में लागू किए गए कई चर के फ़ंक्शन का न्यूनतम पता लगाने के लिए एल्गोरिथ्म को पिछले लेख और इसलिए बारह बार यहाँ वर्णित नहीं किया जाएगा लेख को अधिभार नहीं डालने के लिए, सैद्धांतिक इनपुट को न्यूनतम रखा जाएगा। 1. प्रारंभिक संकेतक संकेतक एमएम 5 सूचक (आलेख 1 देखें) प्रारंभिक बिंदु के रूप में उपयोग किया जाएगा। सूचक के संकलन के लिए हमें संकेतक की आवश्यकता होगी। Mq5, CIndicator. mqh और PowellsMethod. mqh, सभी एक ही निर्देशिका में स्थित हैं। फ़ाइलों को लेख के अंत में files2.zip संग्रह में पाया जा सकता है। आइए हम इस समीकरण को रीफ़्रेश करते हैं, जो इस सूचक को विकसित करने में इस्तेमाल घातीय चिकनाई मॉडल को परिभाषित करते हैं - भिगोना वाला रैखिक विकास मॉडल। सूचक का एकमात्र इनपुट पैरामीटर अंतराल की लंबाई का निर्धारण करने वाला मान है जिसके अनुसार मॉडल पैरामीटर अनुकूलित हो जाएंगे और प्रारंभिक मूल्य (अध्ययन अंतराल) चयनित हैं किसी निर्दिष्ट अंतराल पर मॉडल पैरामीटर के इष्टतम मूल्य निर्धारण और आवश्यक गणनाओं के बाद, पूर्वानुमान, विश्वास अंतराल और एक-कदम-आगे पूर्वानुमान के अनुरूप लाइन तैयार की जाती है। प्रत्येक नए बार में, पैरामीटर अनुकूल हैं और पूर्वानुमान किया जाता है। चूंकि प्रश्न में संकेतक अपग्रेड होने जा रहा है, इसलिए हम जो परिवर्तन करेंगे, उसका प्रभाव इस लेख के अंत में स्थित Files2.zip संग्रह से परीक्षण अनुक्रमों का उपयोग करके किया जाएगा। संग्रह निर्देशिका Dataset2 में सहेजे गए EURUSD, USDCHF, USDJPY उद्धरण और यूएस डॉलर इंडेक्स DXY के साथ फ़ाइलें हैं। उनमें से प्रत्येक को तीन बार फ्रेम के लिए प्रदान किया गया है, एम 1, एच 1 और डी 1 फ़ाइलों में सहेजे गए खुले मान स्थित हैं ताकि फ़ाइल के अंत में सबसे हाल का मान हो। प्रत्येक फ़ाइल में 1200 तत्व हैं माध्य निरपेक्ष प्रतिशत त्रुटि (एमएपीई) गुणांक की गणना के द्वारा अनुमानित त्रुटियों का अनुमान लगाया जायेगा हम बारह परीक्षा अनुक्रमों में से प्रत्येक को 50 अतिव्यापी वर्गों में 80 तत्वों में विभाजित करते हैं और उनमें से प्रत्येक के लिए एमएपीई मान की गणना करते हैं। प्राप्त किए गए अनुमानों का मतलब तुलनात्मक संकेतकों के मुताबिक भविष्यवाणी त्रुटि सूचकांक के रूप में उपयोग किया जाएगा। दो- और तीन-चरण-पूर्व पूर्वानुमान त्रुटियों के लिए मानचित्र मूल्यों की गणना उसी तरीके से की जाएगी। इस तरह के औसत अनुमानों को आगे भी निरूपित किया जाएगा: एमएपीई 1 एक-कदम-आगे पूर्वानुमान त्रुटि के अनुमानित अनुमान मैपई 2 का अनुमानित अनुमान दो-कदम-आगे पूर्वानुमान त्रुटि के एमएपीई 3 औसत अनुमान तीन-कदम-आगे पूर्वानुमान त्रुटि MAPE1-3 मतलब (MAPE1MAPE2MAPE3) 3। MAPE मान की गणना करते समय, पूर्ण पूर्वानुमान त्रुटि मान अनुक्रम के वर्तमान मूल्य से विभाजित प्रत्येक चरण पर होता है। शून्य से विभाजन से बचने के लिए या ऐसा करने में नकारात्मक मूल्यों को प्राप्त करने के लिए, हमारे मामले में, इनपुट श्रृंखला केवल गैरजीरो सकारात्मक मूल्यों को लेने के लिए आवश्यक हैं। हमारे प्रारंभिक सूचक के लिए अनुमान मूल्य तालिका 1 में दिखाए गए हैं। तालिका 1. प्रारंभिक सूचक पूर्वानुमान त्रुटि अनुमान तालिका 1 में प्रदर्शित डेटा ErrorsIndicatorES. mq5 स्क्रिप्ट (लेख के अंत में स्थित files2.zip संग्रह से) का उपयोग करके प्राप्त किया जाता है। । स्क्रिप्ट को संकलित और चलाने के लिए, यह आवश्यक है कि CIndicatorES. mqh और PowellsMethod. mqh समान निर्देशिका में ErrorsIndicatorES. mq5 के रूप में स्थित हैं, और इन इनपुट अनुक्रम FilesDataset2 निर्देशिका में हैं। पूर्वानुमान त्रुटियों के शुरुआती अनुमान प्राप्त करने के बाद, हम अब सूचक को विचाराधीन करने के लिए आगे बढ़ सकते हैं। 2. ऑप्टिमाइज़ेशन मानदंड लेख में दिखाए गए प्रारंभिक सूचक में मॉडल पैरामीटर एक्सपेंनेशन चौरसाई का उपयोग करते हुए टाइम सीरीज़ पूर्वानुमान एक चरण-आगे पूर्वानुमान त्रुटि के वर्गों के योग को कम करके निर्धारित किया गया था। यह तार्किक प्रतीत होता है कि एक-कदम-आगे पूर्वानुमान के लिए मॉडल पैरामीटर इष्टतम हो सकता है कि अधिक-कदम-पूर्व पूर्वानुमान के लिए न्यूनतम त्रुटियां नहीं निकल सकेंगी यह निश्चित रूप से, 10 से 12-कदम-पूर्व अनुमान त्रुटियों को कम करने के लिए वांछनीय होगा, लेकिन विचार के तहत अनुक्रमों के लिए दी गई सीमा के अनुसार एक संतोषजनक पूर्वानुमान परिणाम प्राप्त करना एक असंभव मिशन होगा। यथार्थवादी होने के नाते, मॉडल पैरामीटर को अनुकूलित करते समय, हम अपने सूचक के पहले अपग्रेड के रूप में एक, दो और तीन-चरण-पूर्व पूर्वानुमान त्रुटियों के वर्गों के योग का उपयोग करेंगे। त्रुटियों की औसत संख्या पूर्वानुमान की पहले तीन चरणों की सीमा से कुछ हद तक कम होने की उम्मीद की जा सकती है जाहिर है, प्रारंभिक सूचक के इस तरह के अपग्रेड में इसका मुख्य संरचनात्मक सिद्धांत नहीं है लेकिन केवल पैरामीटर अनुकूलन मानदंड में परिवर्तन होता है। इसलिए हम भविष्यवाणी की सटीकता की उम्मीद नहीं कर सकते कि कई गुना बढ़े, हालांकि दो-और तीन-कदम-पूर्व पूर्वानुमान वाली त्रुटियों की संख्या थोड़ी सी गिरावट आई। पूर्वानुमान परिणामों की तुलना करने के लिए, हमने पिछली अनुक्रम में संशोधित उद्देश्य फ़ंक्शन फ़ैंक के साथ सीआईडीडीटीएर्स वर्ग के समान सीएमडी 1 कक्षा बनाई। प्रारंभिक CIndicatorES वर्ग का मजेदार कार्य: कुछ संशोधनों के बाद, फ़ंक्शन फ़ंक्शन अब निम्न प्रकार के रूप में प्रकट होता है: अब, उद्देश्य फ़ंक्शन की गणना करते समय, एक-, दो और तीन-चरण-पूर्व पूर्वानुमान त्रुटियों के वर्गों का योग उपयोग किया जाता है इसके अलावा, इस क्लास के आधार पर ErrorsMod1.mq5 स्क्रिप्ट को विकसित त्रुटियों का अनुमान लगाने के लिए विकसित किया गया था, जैसे कि पहले से ही निर्दिष्ट ErrorsIndicatorES. mq5 स्क्रिप्ट CMod1.mqh और ErrorsMod1.mq5 आलेख के अंत में files2.zip संग्रह में स्थित हैं। तालिका 2 प्रारंभिक और उन्नत संस्करणों के लिए पूर्वानुमान त्रुटि अनुमान दिखाता है तालिका 2. पूर्वानुमान त्रुटि अनुमान की तुलना जैसा कि देखा जा सकता है, त्रुटि गुणांक मैप 2 और एमएपीई 3 और औसत मूल्य एमएपीई 1-3 वास्तव में विचाराधीन अनुक्रमों के लिए थोड़ा कम होने की संभावना है। तो हमें इस संस्करण को बचाने और हमारे सूचक के आगे संशोधन करने के लिए आगे बढ़ें। 3. चौरसाई प्रक्रिया में पैरामीटर्स का समायोजन इनपुट अनुक्रम के वर्तमान मूल्यों के आधार पर चौरसाई मापदंडों को बदलने का विचार नया या मूल नहीं है और चौरसाई गुणांक को समायोजित करने की इच्छा से आता है ताकि वे किसी भी प्रकार के परिवर्तन के अनुसार इष्टतम बने रहें। इनपुट अनुक्रम की प्रकृति चिकनाई गुणांक को समायोजित करने के कुछ तरीकों को साहित्य 2, 3 में वर्णित किया गया है। संकेतक को और उन्नयन करने के लिए, हम गतिशील रूप से चौरसाई गुणांक को बदलने के साथ मॉडल का उपयोग करेंगे, जिससे उम्मीद की जा सकती है कि अनुकूली घातीय चौरसाई मॉडल का उपयोग हमें पूर्वानुमान सटीकता बढ़ाने की अनुमति देगा हमारे सूचक का दुर्भाग्य से, जब पूर्वानुमान एल्गोरिदम में इस्तेमाल किया जाता है, तो बहुसंख्यक अनुकूली विधियां हमेशा इच्छित परिणाम नहीं देते हैं। पर्याप्त अनुकूली पद्धति का चयन बहुत बोझिल और समय लेने वाली हो सकता है इसलिए हमारे मामले में हम साहित्य 4 में दिए गए निष्कर्षों का उपयोग कर सकते हैं और अनुच्छेद 5 में दिए गए चिकनी संक्रमण घातांक्य चिकनाई (एसटीईएस) दृष्टिकोण को लागू करने का प्रयास करेंगे। दृष्टिकोण के सार को स्पष्ट रूप से निर्दिष्ट लेख में उल्लिखित किया गया है, इसलिए हम इसे बाहर छोड़ देंगे और हमारे मॉडल (समष्ट लेख की शुरुआत देखें) के लिए समीकरणों पर सीधे आगे बढ़ें, अनुकूली चौरसाई गुणांक के उपयोग को ध्यान में रखते हुए। जैसा कि हम अब देख सकते हैं, चौरसाई गुणांक अल्फा का मूल्य एल्गोरिथ्म के हर चरण पर गणना की जाती है और स्क्वायर पूर्वानुमान त्रुटि पर निर्भर करता है। बी और जी गुणक के मान अल्फा मूल्य पर पूर्वानुमान त्रुटि के प्रभाव को निर्धारित करते हैं। अन्य सभी मामलों में, नियोजित मॉडल के लिए समीकरण अपरिवर्तित रहा। एसटीईएस दृष्टिकोण के उपयोग के बारे में अतिरिक्त जानकारी लेख 6 में पाई जा सकती है। जबकि पिछले संस्करणों में, हमें दिए गए इनपुट अनुक्रम पर अल्फा गुणांक का इष्टतम मूल्य निर्धारित करना पड़ा, अब दो अनुकूली गुणांक बी और जी हैं ऑप्टिमाइज़ेशन और अल्फा वैल्यू के अधीन इनपुट क्रम को चौरसाई की प्रक्रिया में गतिशील रूप से निर्धारित किया जाएगा। यह अपग्रेड CMod2 वर्ग के रूप में लागू किया गया है। प्रमुख परिवर्तन (पिछला समय के रूप में) मुख्य रूप से फ़ंक फंक्शन को संबोधित करते हैं जो अब निम्न प्रकार के रूप में दिखाई देता है। इस फ़ंक्शन को विकसित करते समय, अल्फा गुणांक मान परिभाषित समीकरण थोड़ा संशोधित किया गया था। यह क्रमशः 0.05 और 0.95 में इस गुणांक के अधिकतम और न्यूनतम स्वीकार्य मूल्य की सीमा निर्धारित करने के लिए किया गया था। पूर्वानुमान त्रुटियों का अनुमान लगाने के लिए, जैसा कि पहले किया गया था, ErrorsMod2.mq5 स्क्रिप्ट CMod2 वर्ग के आधार पर लिखा गया था। CMod2.mqh और ErrorsMod2.mq5 आलेख के अंत में files2.zip संग्रह में स्थित हैं। स्क्रिप्ट के परिणाम तालिका 3 में दिखाए गए हैं। तालिका 3. भविष्यवाणी त्रुटि अनुमानों की तुलना में तालिका 3 बताती है, अनुकूली चौरसाई गुणांक का उपयोग औसत पर हमारे परीक्षण अनुक्रमों के पूर्वानुमान पूर्वानुमान को थोड़ा कम करने की अनुमति है। इस प्रकार, दो उन्नयनों के बाद, हम लगभग दो प्रतिशत से त्रुटि गुणांक MAPE1-3 को कम करने में कामयाब रहे। इसके बजाय मामूली उन्नयन के परिणाम के बावजूद, हम परिणामस्वरूप संस्करण के साथ रहेंगे और लेख के दायरे से आगे उन्नयन छोड़ देंगे। अगले चरण के रूप में, बॉक्स-कॉक्स परिवर्तन का उपयोग करने की कोशिश करना दिलचस्प होगा। यह परिवर्तन सामान्यतः सामान्य वितरण के प्रारंभिक अनुक्रम वितरण का अनुमान लगाने के लिए उपयोग किया जाता है। हमारे मामले में, इसका उपयोग प्रारंभिक अनुक्रम को बदलने, पूर्वानुमान की गणना करने और पूर्वानुमान को उलटा-परिवर्तन करने के लिए किया जा सकता है ऐसा करने में लागू रूपांतरण गुणांक चयनित होना चाहिए ताकि परिणामस्वरूप पूर्वानुमान त्रुटि को कम किया जाए। पूर्वानुमानिक अनुक्रमों में बॉक्स-कॉक्स परिवर्तन का उपयोग करने का एक उदाहरण, अनुच्छेद 7 में पाया जा सकता है। 4. पूर्वानुमान विश्वास अंतराल प्रारंभिक संकेतकों में भविष्यवाणी का विश्वास अंतराल। एमएम 5 सूचक (पिछला लेख में उल्लिखित) विश्लेषणात्मक के अनुसार गणना की गई थी चयनित घातीय चिकनाई मॉडल के लिए व्युत्पन्न अभिव्यक्ति 8. हमारे मामले में किए गए परिवर्तनों से विचाराधीन मॉडल में बदलाव हो सकते हैं। चर चिकनी गुणांक विश्वास अंतराल के अनुमान के लिए उपर्युक्त विश्लेषणात्मक अभिव्यक्ति का उपयोग करने के लिए अनुचित बनाता है। तथ्य यह है कि पूर्व में इस्तेमाल किए गए विश्लेषणात्मक अभिव्यक्ति को धारणा के आधार पर प्राप्त किया गया था कि पूर्वानुमान त्रुटि वितरण सममित और सामान्य विश्वास अंतराल अनुमान विधि को बदलने के लिए एक अतिरिक्त कारण का गठन कर सकते हैं। ये आवश्यकताएं हमारे वर्ग के दृश्यों के लिए नहीं मिली हैं और पूर्वानुमान त्रुटि वितरण सामान्य नहीं हो सकता है और न ही सममित भी हो सकता है। प्रारंभिक सूचक में विश्वास अंतराल का आकलन करते समय, एक-कदम आगे पूर्वानुमान त्रुटि विचरण को इनपुट क्रम से पहली जगह पर गणना किया गया था, इसके बाद दो-तीन, और अधिक-चरण-आगे के लिए भिन्नता की गणना विश्लेषणात्मक अभिव्यक्तियों का उपयोग करके प्राप्त एक-चरण-आगे पूर्वानुमान त्रुटि विचरण मान के आधार पर पूर्वानुमान। विश्लेषणात्मक अभिव्यक्तियों के इस्तेमाल से बचने के लिए, एक सरल तरीका है, जिससे दो-तीन, और अधिक-कदम-पूर्व पूर्वानुमान के लिए अंतर सीधे इनपुट अनुक्रम से गणना की जाती है और एक-चरण के लिए विचरण भी होता है - छोड़ पूर्वानुमान हालांकि, इस दृष्टिकोण की एक महत्वपूर्ण खामियां हैं: लघु इनपुट अनुक्रमों में, विश्वास अंतराल का अनुमान व्यापक रूप से बिखरेगा और विचलन की गणना और मतलब चुकता त्रुटि त्रुटियों की अपेक्षित सामान्य स्थिति पर बाधाओं को दूर करने की अनुमति नहीं देगा। इस मामले में एक समाधान नॉनपारामेटिक बूटस्ट्रैप (रीसाप्लिंग) के उपयोग में पाया जा सकता है। 9. विचार की रीढ़ की हड्डी को व्यक्त किया गया है: प्रारंभिक अनुक्रम से प्रतिस्थापन के साथ एक यादृच्छिक तरीके से (समान वितरण) नमूनाकरण, इस प्रकार उत्पन्न होने वाले वितरण का वितरण कृत्रिम अनुक्रम प्रारंभिक एक के समान होगा मान लें कि हमारे पास 0, एन -1 की सीमा पर समान रूप से वितरित छद्म यादृच्छिक अनुक्रम उत्पन्न करके एन सदस्यों का एक इनपुट अनुक्रम है और प्रारंभिक सरणी से नमूना करते समय इन मानों का उपयोग करते हुए हम एक कृत्रिम अनुक्रम उत्पन्न कर सकते हैं। प्रारंभिक एक से अधिक लंबाई उस ने कहा, उत्पन्न अनुक्रम का वितरण समान (लगभग एक ही) होगा जैसा कि प्रारंभिक एक के रूप में होगा आत्मविश्वास के अंतराल के अनुमान के लिए बूटस्ट्रैप प्रक्रिया निम्नानुसार हो सकती है: संशोधन के परिणामस्वरूप प्राप्त किए जा रहे घातीय चौरसाई मॉडल के लिए इनपुट अनुक्रम से मॉडल पैरामीटर, उसके गुणांक और अनुकूली गुणांक के इष्टतम प्रारंभिक मान निर्धारित करें। इष्टतम पैरामीटर पहले की तरह, एल्गोरिथ्म का उपयोग करके निर्धारित किया गया है जो Powells खोज पद्धति को नियोजित करता है निर्धारित इष्टतम मॉडल मापदंडों का उपयोग करना, प्रारंभिक अनुक्रम के माध्यम से जाना और एक-चरण-आगे पूर्वानुमान त्रुटियों की एक सरणी का निर्माण करता है। सरणी तत्वों की संख्या इनपुट क्रम लम्बाई के बराबर होगी त्रुटि एरर के प्रत्येक तत्व से घटाकर त्रुटियों को संरेखित करें, इसका मतलब छद्म-यादृच्छिक अनुक्रम जनरेटर का उपयोग करके, 0, एन -1 की श्रेणी के भीतर सूचकांक उत्पन्न करता है और उन 99 99 तत्वों की लंबी कृत्रिम अनुक्रम बनाने के लिए इस्तेमाल करते हैं (रीसाम्पलिंग) कृत्रिम जनरेटेड त्रुटि सरणी से वर्तमान में इस्तेमाल किए गए मॉडल को परिभाषित करने वाले समीकरणों में मूल्यों को सम्मिलित करते हुए छद्म-इनपुट अनुक्रम के 99 99 मूल्यों वाली एक सरणी का निर्माण करते हैं दूसरे शब्दों में, जब कि हम पहले मॉडल समीकरणों में इनपुट अनुक्रम मूल्यों को सम्मिलित करते थे, इस प्रकार पूर्वानुमान त्रुटि की गणना करते हैं, अब व्युत्क्रम गणना की जाती है। सरणी के प्रत्येक तत्व के लिए, इनपुट मान की गणना करने के लिए त्रुटि मान डाला जाता है नतीजतन, हम 9999 तत्वों की सरणी जिसमें इनपुट अनुक्रम के रूप में एक ही वितरण के अनुक्रम वाले होते हैं, जबकि अनुमान के अनुसार आत्मविश्वास के अंतराल का अनुमान लगाने के लिए पर्याप्त लंबाई होती है। फिर पर्याप्त लंबाई के उत्पन्न अनुक्रम का उपयोग करके आत्मविश्वास अंतराल का अनुमान लें। इस प्रयोजन के लिए, हम इस तथ्य का फायदा उठाएंगे कि अगर उत्पन्न पूर्वानुमान त्रुटि एआरए आरोही क्रम में सॉर्ट किया गया है, तो 999 मानों वाली इंडेक्स के लिए इंडेक्स 249 और 974 9 के साथ सरणी कोशिकाओं के पास 95 आत्मविश्वास अंतराल 10 की सीमा के अनुरूप मूल्य होगा पूर्वानुमान अंतराल के अधिक सटीक अनुमान प्राप्त करने के लिए, सरणी लंबाई अजीब होगी। हमारे मामले में, भविष्यवाणी के विश्वास के अंतराल की सीमाओं का अनुमान निम्नानुसार है: पहले निर्धारित किए गए इष्टतम मॉडल मापदंडों का उपयोग करना, उत्पन्न अनुक्रम के माध्यम से जाना और 99 99 की एक सरणी के रूप में एक-कदम आगे पूर्वानुमान की त्रुटियों का परिणामस्वरूप क्रमबद्ध सॉर्ट करें। त्रुटि सरणी, 249 और 974 9 इंडेक्स के साथ मूल्य चुनें, जो 95 विश्वास अंतराल की सीमाओं का प्रतिनिधित्व करते हैं दो, तीन और अधिक-कदम-पूर्व पूर्वानुमान त्रुटियों के लिए चरण 1, 2 और 3 दोहराएं। आत्मविश्वास अंतरालों के आकलन के लिए इस दृष्टिकोण के पास इसके फायदे और नुकसान हैं। भविष्य के त्रुटियों के वितरण की प्रकृति के बारे में धारणाओं की अनुपस्थिति इसके फायदे में है। उन्हें सामान्य रूप से या सममितित रूप से वितरित नहीं करना पड़ता है। इसके अलावा, यह दृष्टिकोण उपयोगी हो सकता है जहां उपयोग में मॉडल के लिए विश्लेषणात्मक अभिव्यक्तियां प्राप्त करना असंभव है। गणना और आवश्यक छद्म यादृच्छिक अनुक्रम जनरेटर की गुणवत्ता पर अनुमानों की निर्भरता की आवश्यक गुंजाइश में एक नाटकीय वृद्धि इसके नुकसान को माना जा सकता है। पुनःसालन और मात्रा का उपयोग करने के विश्वास के अंतराल का अनुमान लगाने के लिए प्रस्तावित दृष्टिकोण बल्कि आदिम है और इसे सुधारने के लिए तरीकों का होना चाहिए। लेकिन चूंकि हमारे मामले में विश्वास अंतराल केवल विज़ुअल मूल्यांकन के लिए अभिप्रेत है, उपरोक्त दृष्टिकोण द्वारा प्रदान की गई सटीकता काफी पर्याप्त दिखाई दे सकती है। 5. संकेतक के संशोधित संस्करण लेख में शुरू किए गए उन्नयन को ध्यान में रखते हुए, Forecastes. mq5 सूचक विकसित किया गया था। पुनर्मुद्रण के लिए, हमने अनुच्छेद 11 में प्रस्तावित छद्म-यादृच्छिक अनुक्रम जनरेटर का इस्तेमाल किया। मानक मथ्रेंड () जनरेटर ने थोड़ा गरीब परिणाम उत्पन्न किए, शायद इस तथ्य के कारण कि 0,32767 उत्पन्न होने वाली मानों की सीमा पर्याप्त नहीं थी Forecastes. mq5 सूचक को संकलित करते समय, PowellsMethod. mqh, Coins. mqh और RNDXor128.mqh इसके साथ एक ही निर्देशिका में स्थित हो जाएगा। इन सभी फ़ाइलों को fore. zip संग्रह में पाया जा सकता है। नीचे Forecastes. mq5 सूचक का स्रोत कोड है। बेहतर प्रदर्शन के प्रयोजनों के लिए, संकेतक को सीधा रेखा के कोड के रूप में संभवतः, निष्पादित किया गया था। इसे अनुकूलन करने के दौरान कोई अनुकूलन नहीं किया गया था। आंकड़े 1 और 2 दो अलग-अलग मामलों के लिए सूचक के संचालन के परिणामों को प्रदर्शित करते हैं। चित्रा 1. Forecastes. mq5 सूचक का पहला आपरेशन उदाहरण चित्रा 2. Forecastes. mq5 सूचक का दूसरा संचालन उदाहरण चित्रा 2 स्पष्ट रूप से दिखाता है कि 95 पूर्वानुमान विश्वास अंतराल असममित है। यह इस तथ्य की वजह से है कि इनपुट अनुक्रम में काफी आउटलेयर होते हैं जिसके परिणामस्वरूप पूर्वानुमान त्रुटियों का असममित वितरण होता है। वेबसाइटों mql4 और mql5 पहले प्रदान की एक्सट्रापोलेटर संकेतक आइए हम उन में से एक - asxtrapolatorofprice. mq5 और उसके पैरामीटर मानों को चित्र 3 में दिखाए अनुसार अपने परिणामों को तुलना करने वाले सूचक द्वारा प्राप्त परिणामों के साथ तुलना करें। चित्रा 3. आइस्पेक्ट्रोलाटरोफप्रिस. एमसी 5 सूचक की सेटिंग्स इन दो संकेतकों के संचालन ने यूसुरु और यूएसडीसीएचएफ के लिए अलग-अलग समय के फ्रेम पर तुलना की तुलना की थी। सतह पर, ऐसा लगता है कि दोनों संकेतकों के पूर्वानुमान की दिशा में अधिकांश मामलों में मेल खाता है। हालांकि, लंबे समय तक टिप्पणियों में, कोई गंभीर विचलन में आ सकता है कहा जा रहा है, isxtrapolatorofprice. mq5 हमेशा एक अधिक टूटे पूर्वानुमान लाइन उत्पादन होगा Forecastes. mq5 और arextrapolatorofprice. mq5 संकेतक के साथ-साथ संचालन का एक उदाहरण चित्रा 4 में दिखाया गया है। चित्रा 4. पूर्वानुमान परिणामों की तुलना करें arextrapolatorofprice. mq5 सूचक द्वारा निर्मित पूर्वानुमान चित्रा 4 में एक ठोस नारंगी लाल रेखा के रूप में प्रदर्शित किया गया है। निष्कर्ष इस और पिछले लेख से संबंधित परिणामों का सारांश: समय श्रृंखला के पूर्वानुमान में इस्तेमाल होने वाले घातीय चिकनाई मॉडल पेश किए गए थे मॉडल के कार्यान्वयन के लिए प्रोग्रामिंग समाधान प्रस्तावित थे इष्टतम प्रारंभिक मानों और मॉडल पैरामीटर के चयन से संबंधित मुद्दों में एक त्वरित जानकारी थी दिए गए पॉवेल विधि का उपयोग करते हुए कई चर के एक फ़ंक्शन के न्यूनतम प्राप्त करने के लिए एल्गोरिथ्म का प्रोग्रामिंग कार्यान्वयन प्रदान किया गया था, इनपुट अनुक्रम का उपयोग करके पूर्वानुमानित मॉडल के पैरामीटर अनुकूलन के लिए प्रोग्रामिंग समाधान प्रदान किया गया था पूर्वानुमान अल्गोरिदम उन्नयन के कुछ सरल उदाहरणों का प्रदर्शन किया गया था अनुमान के अनुसार बूटस्ट्रैपिंग और मात्रा का उपयोग करते हुए पूर्वानुमान के अंतराल का संक्षेप संक्षेप में बताया गया था पूर्वानुमान सूचक forecastes. mq5 विकसित किया गया था जिसमें लेखों में वर्णित सभी विधियों और एल्गोरिदम शामिल हैं, लेख, पत्रिकाओं और पुस्तकों के कुछ लिंक इस विषय से संबंधित दिए गए थे। परिणामस्वरूप संकेतक forecastes. mq5 के संबंध में, यह ध्यान दिया जाना चाहिए कि Powells विधि को नियोजित करने वाले अनुकूलन एल्गोरिथ्म कुछ मामलों में किसी निश्चित सटीकता के साथ उद्देश्य फ़ंक्शन की न्यूनतम निर्धारित करने में विफल हो सकता है। यह मामला है, अधिकतम पुनरावृत्तियों की अनुमत संख्या तक पहुंच जाएगा और लॉग में एक प्रासंगिक संदेश दिखाई देगा। हालांकि इस स्थिति को संकेतक के कोड में किसी भी तरह से संसाधित नहीं किया जाता है जो लेख में निर्धारित एल्गोरिदम के प्रदर्शन के लिए काफी स्वीकार्य है। हालांकि, जब यह गंभीर आवेदन की बात आती है, तो ऐसे मामलों का निरीक्षण किया जाएगा और एक ही तरीके से या किसी अन्य पर संसाधित किया जाएगा। पूर्वानुमान संकेतक को और विकसित और बढ़ाने के लिए, हम प्रत्येक चरण में एक साथ कई अलग-अलग पूर्वानुमान वाली मॉडल का सुझाव दे सकते हैं, उदाहरण के लिए उनमें से किसी एक का चयन करने के लिए। अकाईक्स सूचना मानदंड या प्रकृति के समान कई मॉडल का उपयोग करने के मामले में, उनके पूर्वानुमान परिणामों के भारित औसत मूल्य की गणना करने के लिए इस मामले में भारित गुणांक प्रत्येक मॉडल के पूर्वानुमान त्रुटि गुणांक पर निर्भर करता है। पूर्वानुमान समय श्रृंखला का विषय इतना व्यापक है कि दुर्भाग्य से इन लेखों ने कुछ संबंधित मुद्दों की सतह को मुश्किल से खिसक दिया है। उम्मीद है कि इन प्रकाशनों में पाठकों को इस क्षेत्र में पूर्वानुमान और भविष्य के कार्यों के मुद्दों पर ध्यान आकर्षित करने में मदद मिलेगी। संदर्भ मेटाट्रेडर 5 - आंकड़े और विश्लेषण समय-सीमा का पूर्वानुमान एक्सपेंनेलीय स्मुथिंग का उपयोग करना परिचय वर्तमान में विभिन्न प्रसिद्ध पूर्वानुमान विधियों की संख्या है जो केवल एक समय अनुक्रम के अतीत के मूल्यों के विश्लेषण पर आधारित हैं, यानी तकनीकी रूप से सामान्यतः तकनीकी विश्लेषण। इन विधियों का मुख्य साधन एक्सप्रेप्लॉशन स्कीम है, जहां निश्चित समय के अंतराल पर पहचाने जाने वाले अनुक्रम गुण इसकी सीमा से परे हैं। उसी समय यह माना जाता है कि भविष्य में अनुक्रम गुण पिछले और वर्तमान समय के समान होंगे। एक अधिक जटिल एक्सट्रपलेशन योजना जिसमें पूर्वानुमान की अंतराल के भीतर ऐसी गतिशीलता के संबंध में अनुक्रम की विशेषताओं में परिवर्तन की गतिशीलता का अध्ययन शामिल है, पूर्वानुमान में कम बार उपयोग किया जाता है। एक्सट्रपलेशन के आधार पर सबसे अच्छी तरह से ज्ञात भविष्यवाणी विधियों शायद आटोमैरेजिव एकीकृत चलती औसत मॉडल (एआरआईएएए) का उपयोग कर रहे हैं। इन विधियों की लोकप्रियता मुख्यतः बॉक्स और जेनकिन्स द्वारा काम करती है जो एक एकीकृत एआरआईएएम मॉडल का प्रस्ताव और विकसित करती हैं। बक्से और जेनकिंस द्वारा पेश किए गए मॉडल के अलावा अन्य मॉडलों और पूर्वानुमान विधियां भी हैं यह आलेख संक्षिप्त रूप से अधिक सरल मॉडल को कवर करेगा - बॉक्स और जेनकिंस द्वारा काम की उपस्थिति से पहले होल्ट एंड ब्राउन द्वारा प्रस्तावित घातीय चिकनाई मॉडल। अधिक सरल और स्पष्ट गणितीय उपकरण के बावजूद, घातीय चिकनाई मॉडलों का उपयोग करने की भविष्यवाणी अक्सर परिणामस्वरूप ARIMA मॉडल के माध्यम से प्राप्त परिणामों के साथ तुलनात्मक होता है। यह शायद ही आश्चर्यजनक है कि घातीय चिकनाई मॉडल ARIMA मॉडल का एक विशेष प्रकार है। दूसरे शब्दों में, इस आलेख में अध्ययन के तहत प्रत्येक घातीय चौरसाई मॉडल का एक समान समतुल्य ARIMA मॉडल है इन समतुल्य मॉडल को लेख में नहीं माना जाएगा और केवल सूचना के लिए इसका उल्लेख किया गया है। यह ज्ञात है कि प्रत्येक विशेष मामले में पूर्वानुमान करने के लिए व्यक्तिगत दृष्टिकोण की आवश्यकता होती है और आमतौर पर कई प्रक्रियाएं शामिल होती हैं लापता मूल्यों और आउटलेरों के लिए समय अनुक्रम का विश्लेषण इन मूल्यों का समायोजन प्रवृत्ति और इसके प्रकार की पहचान अनुक्रम आवधिकता का निर्धारण अनुक्रम की कार्यक्षमता की जांच करें अनुक्रम प्रीप्रोसेटिंग विश्लेषण (लॉगरिदम, डिस्ट्रेंसिज, इत्यादि लेना)। मॉडल चयन मॉडल पैरामीटर निर्धारण। चयनित मॉडल के आधार पर पूर्वानुमान। मॉडल पूर्वानुमान सटीकता मूल्यांकन चयनित मॉडल की त्रुटियों का विश्लेषण। चयनित मॉडल की पर्याप्तता का निर्धारण और, यदि आवश्यक हो, तो मॉडल के प्रतिस्थापन और पूर्ववर्ती वस्तुओं पर वापस लौटाना। यह प्रभावी पूर्वानुमान के लिए आवश्यक कार्यों की पूरी सूची तक नहीं है। इस पर जोर दिया जाना चाहिए कि मॉडल पैरामीटर निर्धारण और पूर्वानुमान परिणाम प्राप्त करना सामान्य पूर्वानुमान प्रक्रिया का केवल एक छोटा सा हिस्सा है। लेकिन एक तरह से समस्याओं की पूरी श्रृंखला को कवर करना असंभव प्रतीत होता है या किसी एक लेख में पूर्वानुमान से संबंधित अन्य इसलिए यह लेख केवल घातीय चिकनाई मॉडल से निपटता है और परीक्षण अनुक्रम के रूप में गैर-प्रीप्रोकेड मुद्रा उद्धरणों का उपयोग करेगा। लेखों में साथ-साथ मुद्दों को पूरी तरह से टाल नहीं दिया जा सकता है, लेकिन इन्हें केवल इतने दूर तक छुआ जाएगा क्योंकि वे मॉडल की समीक्षा के लिए आवश्यक हैं। 1. स्टेशनरीयता उचित एक्सट्रपलेशन के विचार से पता चलता है कि अध्ययन के तहत भविष्य के विकास का भविष्य पिछले और वर्तमान समय के समान होगा। दूसरे शब्दों में, यह प्रक्रिया की तात्कालिकता से चिंता करता है भविष्य की स्थिति की दृष्टि से स्थिर प्रक्रिया बहुत ही आकर्षक होती है लेकिन दुर्भाग्य से वे प्रकृति में मौजूद नहीं हैं, क्योंकि किसी वास्तविक प्रक्रिया को इसके विकास के दौरान बदलना पड़ता है। वास्तविक प्रक्रियाएं समय के दौरान स्पष्ट रूप से अलग उम्मीदें, विचरण और वितरण हो सकती हैं, लेकिन जिन प्रक्रियाओं की विशेषताएं धीरे-धीरे बदलती हैं, उन्हें स्थिर प्रक्रियाओं के लिए जिम्मेदार ठहराया जा सकता है। इस मामले में बहुत धीरे धीरे इसका मतलब है कि परिमित अवलोकन अंतराल के भीतर प्रक्रिया विशेषताओं में परिवर्तन इतनी नगण्य दिखता है कि ऐसे परिवर्तनों की उपेक्षा की जा सकती है। यह स्पष्ट है कि उपलब्ध अवलोकन अंतराल (लघु नमूना) में कम, प्रक्रिया की पूर्णता के संबंध में गलत निर्णय लेने की संभावना अधिक है दूसरी तरफ, यदि हमें बाद में इस प्रक्रिया की स्थिति में अधिक रुचि है, तो एक अल्पकालिक पूर्वानुमान बनाने की योजना बना रही है, तो नमूना आकार में कमी कुछ मामलों में ऐसी पूर्वानुमान की सटीकता में वृद्धि हो सकती है। यदि परिवर्तन प्रक्रिया के अधीन है, तो अवलोकन के अंतराल के भीतर निर्धारित अनुक्रम मापदंडों, इसकी सीमाओं के बाहर अलग होगा। इस प्रकार, भविष्यवाणी की अंतराल, भविष्य की त्रुटि पर अनुक्रम विशेषताओं की परिवर्तनशीलता के प्रभाव को अधिक लंबा। इस तथ्य के कारण हमें खुद को एक अल्पकालिक पूर्वानुमान के लिए सीमित करना होगा, जो भविष्यवाणी के अंतराल में केवल एक महत्वपूर्ण कमी है, यह अपेक्षा करने की अनुमति देता है कि धीरे-धीरे बदलते अनुक्रम विशेषताओं में काफी पूर्वानुमान न होने की त्रुटियों का परिणाम नहीं होगा। इसके अलावा, अनुक्रम पैरामीटर की परिवर्तनशीलता इस तथ्य को जन्म देती है कि अवलोकन के अंतराल का अनुमान लगाते समय प्राप्त मूल्य औसतन होता है, क्योंकि पैरामीटर अंतराल के भीतर स्थिर नहीं रहे। प्राप्त पैरामीटर मान इसलिए इस अंतराल के अंतिम क्षण से संबंधित नहीं होंगे, लेकिन इसकी एक निश्चित औसत दर्शाएगा। दुर्भाग्य से, इस अप्रिय घटना को पूरी तरह से समाप्त करना असंभव है, लेकिन मॉडल पैरामीटर आकलन (अध्ययन अंतराल) में शामिल अवलोकन अंतराल की लंबाई जितनी संभव हो, उतनी ही कम हो सकती है, लेकिन इसे कम किया जा सकता है। इसी समय, अध्ययन के अंतराल को अनिश्चित काल तक छोटा नहीं किया जा सकता है क्योंकि अगर बहुत कम हो जाता है, तो निश्चित रूप से अनुक्रम पैरामीटर आकलन की सटीकता कम हो जाएगी। अध्ययन अंतराल में अत्यधिक कमी के कारण अनुक्रम विशेषताओं की परिवर्तनशीलता से जुड़े त्रुटियों के प्रभाव और त्रुटियों में वृद्धि के बीच एक समझौता करना चाहिए। उपर्युक्त सभी एक्सपेंनेशन चौरसाई मॉडल का उपयोग करके पूर्वानुमान के लिए पूरी तरह से लागू होता है क्योंकि वे प्रक्रियाओं की निष्पक्षता, जैसे एआरआईएएए मॉडल पर आधारित हैं। फिर भी, सादगी के लिए हम परंपरागत रूप से मान लेंगे कि सभी दृश्यों के मानदंडों को ध्यान में रखते हुए अवलोकन के अंतराल में भिन्नता है, लेकिन इस तरह धीमे तरीके से ये परिवर्तन उपेक्षित हो सकते हैं। इस प्रकार, लेख घातीय चिकनाई मॉडल के आधार पर धीरे धीरे बदलते विशेषताओं के साथ दृश्यों के अल्पकालिक पूर्वानुमान से संबंधित मुद्दों को संबोधित करेंगे। अल्पकालिक पूर्वानुमान इस मामले में एक वर्ष से कम की अवधि के लिए पूर्वानुमान के बजाय एक, दो या दो से अधिक समय अंतराल के लिए पूर्वानुमान करना चाहिए, क्योंकि यह आमतौर पर अर्थशास्त्र में समझा जाता है। 2. टेस्ट सीक्वेंस इस लेख को लिखने पर, पूर्व में बचाया गया यूआरआरयूआर, यूयूआरएसडी, यूएसडीजेपी और एमए, एम 5, एम 30 और एच 1 के लिए एक्सयूयूयूएसडी उद्धरण इस्तेमाल किया गया था। प्रत्येक सहेजे गई फ़ाइलों में 1100 खुली मूल्य हैं सबसे पुराना मूल्य फ़ाइल की शुरुआत में और अंत में सबसे हाल का एक है। फ़ाइल में सहेजा गया अंतिम मान उस समय से मेल खाती है जब फ़ाइल बनाई गई थी। HistoryToCSV. mq5 स्क्रिप्ट का उपयोग करते हुए परीक्षण अनुक्रम वाले फ़ाइलों को बनाया गया था। डेटा फ़ाइलें और स्क्रिप्ट जिसका उपयोग उन्होंने बनाया था, वे फ़ाइलें.ज़िप संग्रह में आलेख के अंत में स्थित हैं। जैसा कि पहले ही उल्लेख किया गया है, सहेजे गए उद्धरण इस आलेख में स्पष्ट समस्या के बावजूद पूर्वप्रक्रिया किए बिना उपयोग किए जाते हैं, जो मैं आपका ध्यान आकर्षित करना चाहता हूं। उदाहरण के लिए, दिन के दौरान यूरोआरयूआरएच 1 उद्धरण 12 से 13 बार होते हैं, शुक्रवार को एक्सएयूयूएसडी के उद्धरण में दूसरे दिन की तुलना में एक बार कम होता है। ये उदाहरण दर्शाते हैं कि उद्धरण अनियमित नमूना अंतराल के साथ उत्पन्न होते हैं यह सही समय अनुक्रमों के साथ काम करने के लिए डिज़ाइन किए गए एल्गोरिदम के लिए पूरी तरह अस्वीकार्य है जो एक समान मात्रा का अंतराल होने का सुझाव देते हैं। यहां तक ​​कि यदि लापता उद्धरण मूल्यों को एक्सट्रपलेशन का उपयोग करते हुए पुन: प्रस्तुत किया जाता है, तो सप्ताहांत पर उद्धरणों की कमी के संबंध में समस्या खुली होती है। हम यह मान सकते हैं कि सप्ताहांत में दुनिया में होने वाली घटनाओं का विश्व अर्थव्यवस्था पर सप्ताह के दिनों की घटनाओं पर समान प्रभाव पड़ता है। क्रांतियां, प्रकृति के कार्य, उच्च प्रोफ़ाइल घोटाले, सरकारी परिवर्तन और इस तरह की अन्य कम या कम बड़ी घटनाएं किसी भी समय हो सकती हैं। यदि इस तरह की घटना शनिवार को हुई थी, तो यह सप्ताह के अंत तक दुनिया के बाजारों पर कम प्रभाव पड़ेगा। यह संभवत: ये घटनाएं हैं जो उद्धरण में अंतराल की ओर बढ़ती हैं ताकि वे कार्यवाहक के अंत में अक्सर मनाया जा सके। जाहिर है, दुनिया अपने नियमों के चलते रहती है, जब भी विदेशी मुद्रा का संचालन नहीं होता है। यह अभी भी स्पष्ट नहीं है कि तकनीकी विश्लेषण के लिए लक्षित सप्ताहांत के मुकाबले उद्धरण में मूल्यों को पुन: प्रस्तुत किया जाना चाहिए और इसका लाभ क्या होगा। जाहिर है, ये मुद्दे इस लेख के दायरे से बाहर हैं, लेकिन पहली नज़र में किसी भी अंतराल के बिना अनुक्रम विश्लेषण के लिए अधिक उचित प्रतीत होता है, कम से कम चक्रीय (मौसमी) घटकों का पता लगाने के मामले में। आगे के विश्लेषण के लिए आंकड़ों की प्रारंभिक तैयारी के महत्व को शायद ही हमारे मामले में बहुत अधिक अनुमानित किया जा सकता है, यह एक प्रमुख स्वतंत्र मुद्दा है क्योंकि उद्धरण, वे टर्मिनल में जिस तरह से दिखाई देते हैं, वे आमतौर पर तकनीकी विश्लेषण के लिए वास्तव में उपयुक्त नहीं होते हैं। उपरोक्त अंतर से संबंधित मुद्दों के अलावा, अन्य समस्याओं का एक बहुत कुछ है उदाहरण के लिए, उद्धरण बनाते समय, एक निश्चित समय का समय खुले और निचले मूल्यों को निर्दिष्ट नहीं किया जाता है, इन मूल्यों को एक चयनित समय सीमा चार्ट के एक निश्चित क्षण के बजाय टिक निर्माण समय के अनुरूप होता है, जबकि यह आमतौर पर जाना जाता है कि ticks समय पर बहुत दुर्लभ हैं। Another example can be seen in complete disregard of the sampling theorem, as nobody can guarantee that the sampling rate even within a minute interval satisfies the above theorem (not to mention other, bigger intervals). Furthermore, one should bear in mind the presence of a variable spread which in some cases may be superimposed on quote values. Let us however leave these issues out of the scope of this article and get back to the primary subject. 3. Exponential Smoothing Let us first have a look at the simplest model , X(t) (simulated) process under study, L(t) variable process level, r(t) zero mean random variable. As can be seen, this model comprises the sum of two components we are particularly interested in the process level L(t) and will try to single it out. It is well-known that the averaging of a random sequence may result in decreased variance, i. e. reduced range of its deviation from the mean. We can therefore assume that if the process described by our simple model is exposed to averaging (smoothing), we may not be able to get rid of a random component r(t) completely but we can at least considerably weaken it thus singling out the target level L(t) . For this purpose, we will use a simple exponential smoothing (SES). In this well known formula, the degree of smoothing is defined by alpha coefficient which can be set from 0 to 1. If alpha is set to zero, new incoming values of the input sequence X will have no effect whatsoever on the smoothing result. Smoothing result for any time point will be a constant value. Consequently, in extreme cases like this, the nuisance random component will be fully suppressed yet the process level under consideration will be smoothed out to a straight horizontal line. If the alpha coefficient is set to one, the input sequence will not be affected by smoothing at all. The level under consideration L(t) will not be distorted in this case and the random component will not be suppressed either. It is intuitively clear that when selecting the alpha value, one has to simultaneously satisfy the conflicting requirements. On the one hand, the alpha value shall be near zero in order to effectively suppress the random component r(t) . On the other, it is advisable to set the alpha value close to unity not to distort the L(t) component we are so interested in. In order to obtain the optimal alpha value, we need to identify a criterion according to which such value can be optimized. Upon determining such criterion, remember that this article deals with forecasting and not just smoothing of sequences. In this case regarding the simple exponential smoothing model, it is customary to consider value obtained at a given time as a forecast for any number of steps ahead. Hence, the forecast of the sequence value at the time t will be a one-step-ahead forecast made at the previous step In this case, one can use a one-step-ahead forecast error as a criterion for optimization of the alpha coefficient value Thus, by minimizing the sum of squares of these errors over the entire sample, we can determine the optimal value of the alpha coefficient for a given sequence. The best alpha value will of course be the one at which the sum of squares of the errors would be minimal. Figure 1 shows a plot of the sum of squares of one-step-ahead forecast errors versus alpha coefficient value for a fragment of test sequence USDJPY M1. Figure 1. Simple exponential smoothing The minimum on the resulting plot is barely discernible and is located close to the alpha value of approximately 0.8. But such picture is not always the case with regard to the simple exponential smoothing. When trying to obtain the optimal alpha value for test sequence fragments used in the article, we will more often than not get a plot continuously falling to unity. Such high values of the smoothing coefficient suggest that this simple model is not quite adequate for the description of our test sequences (quotes). It is either that the process level L(t) changes too fast or there is a trend present in the process. Let us complicate our model a little by adding another component , It is known that linear regression coefficients can be determined by double smoothening of a sequence: For coefficients a1 and a2 obtained in this manner, the m-step-ahead forecast at the time t will be equal to It should be noted that the same alpha coefficient is used in the above formulas for the first and repeated smoothing. This model is called the additive one-parameter model of linear growth. Let us demonstrate the difference between the simple model and the model of linear growth. Suppose that for a long time the process under study represented a constant component, i. e. it appeared on the chart as a straight horizontal line but at some point a linear trend started to emerge. A forecast for this process made using the above mentioned models is shown in Figure 2. Figure 2. Model comparison As can be seen, the simple exponential smoothing model is appreciably behind the linearly varying input sequence and the forecast made using this model is moving yet further away. We can see a very a different pattern when the linear growth model is used. When the trend emerges, this model is as if trying to come up with the linearly varying sequence and its forecast is closer to the direction of varying input values. If the smoothing coefficient in the given example was higher, the linear growth model would be able to reach the input signal over the given time and its forecast would nearly coincide with the input sequence. Despite the fact that the linear growth model in the steady state gives good results in the presence of a linear trend, it is easy to see that it takes a certain time for it to catch up with the trend. Therefore there will always be a gap between the model and input sequence if the direction of a trend frequently changes. Besides, if the trend grows nonlinearly but instead follows the square law, the linear growth model will not be able to reach it. But despite these drawbacks, this model is more beneficial than the simple exponential smoothing model in the presence of a linear trend. As already mentioned, we used a one-parameter model of linear growth. In order to find the optimal value of the alpha parameter for a fragment of test sequence USDJPY M1, let us build a plot of the sum of squares of one-step-ahead forecast errors versus alpha coefficient value. This plot built on the basis of the same sequence fragment as the one in Figure 1, is displayed in Figure 3. Figure 3. Linear growth model As compared with the result in Figure 1, the optimal value of the alpha coefficient has in this case decreased to approximately 0.4. The first and second smoothing have the same coefficients in this model, although theoretically their values can be different. The linear growth model with two different smoothing coefficients will be reviewed further. Both exponential smoothing models we considered have their analogs in MetaTrader 5 where they exist in the form of indicators. These are well-known EMA and DEMA which are not designed for forecasting but for smoothing of sequence values. It should be noted that when using DEMA indicator, a value corresponding to the a1 coefficient is displayed instead of the one-step forecast value. The a2 coefficient (see the above formulas for the linear growth model) is in this case not calculated nor used. In addition, the smoothing coefficient is calculated in terms of the equivalent period n For example, alpha equal to 0.8 will correspond to n being approximately equal to 2 and if alpha is 0.4, n is equal to 4. 4. Initial Values As already mentioned, a smoothing coefficient value shall in one way or another be obtained upon application of exponential smoothing. But this appears to be insufficient. Since in exponential smoothing the current value is calculated on the basis of the previous one, there is a situation where such value does not yet exist at the time zero. In other words, initial value of S or S1 and S2 in the linear growth model shall in some way be calculated at the time zero. The problem of obtaining initial values is not always easy to solve. If (as in the case of using quotes in MetaTrader 5) we have a very long history available, the exponential smoothing curve will, had the initial values been inaccurately determined, have time to stabilize by a current point, having corrected our initial error. This will require about 10 to 200 (and sometimes even more) periods depending on the smoothing coefficient value. In this case it would be enough to roughly estimate the initial values and start the exponential smoothing process 200-300 periods before the target time period. It gets more difficult, though, when the available sample only contains e. g. 100 values. There are various recommendations in literature regarding the choice of initial values. For example, the initial value in the simple exponential smoothing can be equated to the first element in a sequence or calculated as the mean of three to four initial elements in a sequence with a view to smoothing random outliers. The initial values S1 and S2 in the linear growth model can be determined based on the assumption that the initial level of the forecasting curve shall be equal to the first element in a sequence and the slope of the linear trend shall be zero. One can find yet more recommendations in different sources regarding the choice of initial values but none of them can ensure the absence of noticeable errors at early stages of the smoothing algorithm. It is particularly noticeable with the use of low value smoothing coefficients when a great number of periods is required in order to attain a steady state. Therefore in order to minimize the impact of problems associated with the choice of initial values (especially for short sequences), we sometimes use a method which involves a search for such values that will result in the minimum forecast error. It is a matter of calculating a forecast error for the initial values varying at small increments over the entire sequence. The most appropriate variant can be selected after calculating the error within the range of all possible combinations of initial values. This method is however very laborious requiring a lot of calculations and is almost never used in its direct form. The problem described has to do with optimization or search for a minimum multi-variable function value. Such problems can be solved using various algorithms developed to considerably reduce the scope of calculations required. We will get back to the issues of optimization of smoothing parameters and initial values in forecasting a bit later. 5. Forecast Accuracy Assessment Forecasting procedure and selection of the model initial values or parameters give rise to the problem of estimating the forecast accuracy. Assessment of accuracy is also important when comparing two different models or determining the consistency of the obtained forecast. There is a great number of well-known estimates for the forecast accuracy assessment but the calculation of any of them requires the knowledge of the forecast error at every step. As already mentioned, a one-step-ahead forecast error at the time t is equal to Probably the most common forecast accuracy estimate is the mean squared error (MSE): where n is the number of elements in a sequence. Extreme sensitivity to occasional single errors of large value is sometimes pointed out as a disadvantage of MSE. It derives from the fact that the error value when calculating MSE is squared. As an alternative, it is advisable to use in this case the mean absolute error (MAE). The squared error here is replaced by the absolute value of the error. It is assumed that the estimates obtained using MAE are more stable. Both estimates are quite appropriate for e. g. assessment of forecast accuracy of the same sequence using different model parameters or different models but they appear to be of little use for comparison of the forecast results received in different sequences. Besides, the values of these estimates do not expressly suggest the quality of the forecast result. For example, we cannot say whether the obtained MAE of 0,03 or any other value is good or bad. To be able to compare the forecast accuracy of different sequences, we can use relative estimates RelMSE and RelMAE: The obtained estimates of forecast accuracy are here divided by the respective estimates obtained using the test method of forecasting. As a test method, it is suitable to use the so-called naive method suggesting that the future value of the process will be equal to the current value. If the mean of forecast errors equals the value of errors obtained using the naive method, the relative estimate value will be equal to one. If the relative estimate value is less than one, it means that, on the average, the forecast error value is less than in the naive method. In other words, the accuracy of forecast results ranks over the accuracy of the naive method. And vice versa, if the relative estimate value is more than one, the accuracy of the forecast results is, on the average, poorer than in the naive method of forecasting. These estimates are also suitable for assessment of the forecast accuracy for two or more steps ahead. A one-step forecast error in calculations just needs to be replaced with the value of forecast errors for the appropriate number of steps ahead. As an example, the below table contains one-step ahead forecast errors estimated using RelMAE in one-parameter model of linear growth. The errors were calculated using the last 200 values of each test sequence. Table 1. One-step-ahead forecast errors estimated using RelMAE RelMAE estimate allows to compare the effectiveness of a selected method when forecasting different sequences. As the results in Table 1 suggest, our forecast was never more accurate than the naive method - all RelMAE values are more than one. 6. Additive Models There was a model earlier in the article that comprised the sum of the process level, linear trend and a random variable. We will expand the list of the models reviewed in this article by adding another model which in addition to the above components includes a cyclic, seasonal component. Exponential smoothing models comprising all components as a sum are called the additive models. Apart from these models there are multiplicative models where one, more or all components are comprised as a product. Let us proceed to reviewing the group of additive models. The one-step-ahead forecast error has repeatedly been mentioned earlier in the article. This error has to be calculated in nearly any application related to forecasting based on exponential smoothing. Knowing the value of the forecast error, the formulas for the exponential smoothing models introduced above can be presented in a somewhat different form (error-correcting form). The form of the model representation we are going to use in our case contains an error in its expressions that is partially or fully added to the previously obtained values. Such representation is called the additive error model. Exponential smoothing models can also be expressed in a multiplicative error form which will however not be used in this article. Let us have a look at additive exponential smoothing models. Simple exponential smoothing: Additive linear growth model: In contrast to the earlier introduced one-parameter linear growth model, two different smoothing parameters are used here. Linear growth model with damping: The meaning of such damping is that the trend slope will recede at every subsequent forecasting step depending on the value of the damping coefficient. This effect is demonstrated in Figure 4. Figure 4. Damping coefficient effect As can be seen in the figure, when making a forecast, a decreasing value of the damping coefficient will cause the trend to be losing its strength faster, thus the linear growth will get more and more damped. By adding a seasonal component as a sum to each of these three models we will get three more models. Simple model with additive seasonality: Linear growth model with additive seasonality: Linear growth model with damping and additive seasonality: There are also ARIMA models equivalent to the models with seasonality but they will be left out here as they will hardly have any practical importance whatsoever. Notations used in the formulas provided are as follows: It is easy to see that the formulas for the last model provided include all six variants under consideration. If in the formulas for the linear growth model with damping and additive seasonality we take , the seasonality will be disregarded in forecasting. Further, where , a linear growth model will be produced and where , we will get a linear growth model with damping. The simple exponential smoothing model will correspond to . When employing the models that involve seasonality, the presence of cyclicity and period of the cycle should first be determined using any available method in order to further use this data for initialization of values of seasonal indices. We didnt manage to detect a considerable stable cyclicity in the fragments of test sequences used in our case where the forecast is made over short time intervals. Therefore in this article we will not give relevant examples and expand on the characteristics associated with seasonality. In order to determine the probability prediction intervals with regard to the models under consideration, we will use analytical derivations found in the literature 3. The mean of the sum of squares of one-step-ahead forecast errors calculated over the entire sample of size n will be used as the estimated variance of such errors. Then the following expression will be true for determination of the estimated variance in a forecast for 2 and more steps ahead for the models under consideration: Having calculated the estimated variance of the forecast for every step m, we can find the limits of the 95 prediction interval: We will agree to name such prediction interval the forecast confidence interval. Let us implement the expressions provided for the exponential smoothing models in a class written in MQL5. 7. Implementation of the AdditiveES Class The implementation of the class involved the use of the expressions for the linear growth model with damping and additive seasonality. As mentioned earlier, other models can be derived from it by an appropriate selection of parameters. Let us briefly review methods of AdditiveES class. double s - sets the initial value of the smoothed level double t - sets the initial value of the smoothed trend double alpha1 - sets the smoothing parameter for the level of the sequence double gamma0 - sets the smoothing parameter for the trend double phi1 - sets the damping parameter double delta0 - sets the smoothing parameter for seasonal indices int nses1 - sets the number of periods in the seasonal cycle. It returns a one-step-ahead forecast calculated on the basis of the initial values set. The Init method shall be called in the first place. This is required for setting the smoothing parameters and initial values. It should be noted that the Init method does not provide for initialization of seasonal indices at arbitrary values when calling this method, seasonal indices will always be set to zero. Int m - seasonal index number double is - sets the value of the seasonal index number m. The IniIs(. ) method is called when the initial values of seasonal indices need to be other than zero. Seasonal indices should be initialized right after calling the Init(. ) method. double y new value of the input sequence It returns a one-step-ahead forecast calculated on the basis of the new value of the sequence This method is designed for calculating a one-step-ahead forecast every time a new value of the input sequence is entered. It should only be called after the class initialization by the Init and, where necessary, IniIs methods. int m forecasting horizon of 1,2,3, period It returns the m-step-ahead forecast value. This method calculates only the forecast value without affecting the state of the smoothing process. It is usually called after calling the NewY method. int m forecasting horizon of 1,2,3, period It returns the coefficient value for calculating the forecast variance. This coefficient value shows the increase in the variance of a m-step-ahead forecast compared to the variance of the one-step-ahead forecast. GetS, GetT, GetF, GetIs methods These methods provide access to the protected variables of the class. GetS, GetT and GetF return values of the smoothed level, smoothed trend and a one-step-ahead forecast, respectively. GetIs method provides access to seasonal indices and requires the indication of the index number m as an input argument. The most complex model out of all we have reviewed is the linear growth model with damping and additive seasonality based on which the AdditiveES class is created. This brings up a very reasonable question - what would the remaining, simpler models be needed. Despite the fact, that more complex models should seemingly have a clear advantage over simpler ones, it is actually not always the case. Simpler models that have less parameters will in the vast majority of cases result in lesser variance of forecast errors, i. e. their operation will be more steady. This fact is employed in creating forecasting algorithms based on simultaneous parallel operation of all available models, from the simplest to the most complex ones. Once the sequence have been fully processed, a forecasting model that demonstrated the lowest error, given the number of its parameters (i. e. its complexity), is selected. There is a number of criteria developed for this purpose, e. g. Akaikes Information Criterion (AIC). It will result in selection of a model which is expected to produce the most stable forecast. To demonstrate the use of the AdditiveES class, a simple indicator was created all smoothing parameters of which are set manually. The source code of the indicator AdditiveESTest. mq5 is set forth below. A call or a repeated initialization of the indicator sets the exponential smoothing initial values There are no initial settings for seasonal indices in this indicator, their initial values are therefore always equal to zero. Upon such initialization, the influence of seasonality on the forecast result will gradually increase from zero to a certain steady value, with the introduction of new incoming values. The number of cycles required to reach a steady-state operating condition depends on the value of the smoothing coefficient for seasonal indices: the smaller the smoothing coefficient value, the more time it will require. The operation result of the AdditiveESTest. mq5 indicator with default settings is shown in Figure 5. Figure 5. The AdditiveESTest. mq5 indicator Apart from the forecast, the indicator displays an additional line corresponding to the one-step forecast for the past values of the sequence and limits of the 95 forecast confidence interval. The confidence interval is based on the estimated variance of the one-step-ahead error. To reduce the effect of inaccuracy of the selected initial values, the estimated variance is not calculated over the entire length nHist but only with regard to the last bars the number of which is specified in the input parameter nTest. Files. zip archive at the end of the article includes AdditiveES. mqh and AdditiveESTest. mq5 files. When compiling the indicator, it is necessary that the include AdditiveES. mqh file is located in the same directory as AdditiveESTest. mq5. While the problem of selecting the initial values was to some extent solved when creating the AdditiveESTest. mq5 indicator, the problem of selecting the optimal values of smoothing parameters has remained open. 8. Selection of the Optimal Parameter Values The simple exponential smoothing model has a single smoothing parameter and its optimal value can be found using the simple enumeration method. After calculating the forecast error values over the entire sequence, the parameter value is changed at a small increment and a full calculation is made again. This procedure is repeated until all possible parameter values have been enumerated. Now we only need to select the parameter value which resulted in the smallest error value. In order to find an optimal value of the smoothing coefficient in the range of 0.1 to 0.9 at 0.05 increments, the full calculation of the forecast error value will need to be made seventeen times. As can be seen, the number of calculations required is not so big. But the linear growth model with damping involves the optimization of three smoothing parameters and in this case it will take 4913 calculation runs in order to enumerate all their combinations in the same range at the same 0.05 increments. The number of full runs required for enumeration of all possible parameter values rapidly increases with the increase in the number of parameters, decrease in the increment and expansion of the enumeration range. Should it further be necessary to optimize the initial values of the models in addition to the smoothing parameters, it will be quite difficult to do using the simple enumeration method. Problems associated with finding the minimum of a function of several variables are well studied and there is quite a lot of algorithms of this kind. Description and comparison of various methods for finding the minimum of a function can be found in the literature 7. All these methods are primarily aimed at reducing the number of calls of the objective function, i. e. reducing the computational efforts in the process of finding the minimum. Different sources often contain a reference to the so-called quasi-Newton methods of optimization. Most likely this has to do with their high efficiency but the implementation of a simpler method should also be sufficient to demonstrate an approach to the optimization of forecasting. Let us opt for Powells method. Powells method does not require calculation of derivatives of the objective function and belongs to search methods. This method, like any other method, may be programmatically implemented in various ways. The search should be completed when a certain accuracy of the objective function value or the argument value is attained. Besides, a certain implementation may include the possibility of using limitations on the permissible range of function parameter changes. In our case, the algorithm for finding an unconstrained minimum using Powells method is implemented in PowellsMethod. class. The algorithm stops searching once a given accuracy of the objective function value is attained. In the implementation of this method, an algorithm found in the literature 8 was used as a prototype. Below is the source code of the PowellsMethod class. The Optimize method is the main method of the class. double ampp - array that at the input contains the initial values of parameters the optimal values of which shall be found the obtained optimal values of these parameters are at the output of the array. int n0 - number of arguments in array p. Where n0, the number of parameters is considered to be equal to the size of array p. It returns the number of iterations required for operation of the algorithm, or -1 if the maximum permissible number thereof has been reached . When searching for optimal parameter values, an iterative approximation to the minimum of the objective function occurs. The Optimize method returns the number of iterations required to reach the function minimum with a given accuracy. The objective function is called several times at every iteration, i. e. the number of calls of the objective function may be significantly (ten and even hundred times) bigger than the number of iterations returned by the Optimize method. Other methods of the class. Int n - maximum permissible number of iterations in Powells method. The default value is 200. It sets the maximum permissible number of iterations once this number is reached, the search will be over regardless of whether the minimum of the objective function with a given accuracy was found. And a relevant message will be added to the log. double er - accuracy. Should this value of deviation from the minimum value of the objective function be reached, Powells method stops searching. The default value is 1e-6. Int n - maximum permissible number of iterations for an auxiliary Brents method. The default value is 200. It sets the maximum permissible number of iterations. Once it is reached, the auxiliary Brents method will stop searching and a relevant message will be added to the log. double er accuracy. This value defines accuracy in the search of the minimum for the auxiliary Brents method. The default value is 1e-4. It returns the minimum value of the objective function obtained. It returns the number of iterations required for operation of the algorithm. Virtual function func(const double ampp) const double ampp address of the array containing the optimized parameters. The size of the array corresponds to the number of function parameters. It returns the function value corresponding to the parameters passed to it. The virtual function func() shall in every particular case be redefined in a class derived from the PowellsMethod class. The func() function is the objective function the arguments of which corresponding to the minimum value returned by the function will be found when applying the search algorithm. This implementation of Powells method employs Brents univariate parabolic interpolation method for determining the direction of search with regard to each parameter. The accuracy and maximum permissible number of iterations for these methods can be set separately by calling SetItMaxPowell, SetFtolPowell, SetItMaxBrent and SetFtolBrent. So the default characteristics of the algorithm can be changed in this manner. This may appear useful when the default accuracy set to a certain objective function turns out to be too high and the algorithm requires too many iterations in the search process. The change in the value of the required accuracy can optimize the search with regard to different categories of objective functions. Despite the seeming complexity of the algorithm that employs Powells method, it is quite simple in use. Let us review an example. Assume, we have a function and we need to find the values of parameters and at which the function will have the smallest value. Let us write a script demonstrating a solution to this problem. When writing this script, we first create the func() function as a member of the PMTest class which calculates the value of the given test function using the passed values of parameters p0 and p1. Then in the body of the OnStart() function, the initial values are assigned to the required parameters. The search will start from these values. Further, a copy of the PMTest class is created and the search for the required values of p0 and p1 starts by calling the Optimize method the methods of the parent PowellsMethod class will call the redefined func() function. Upon completion of the search, the number of iterations, function value at the minimum point and the obtained parameter values p00.5 and p16 will be added to the log. PowellsMethod. mqh and a test case PMTest. mq5 are located at the end of the article in Files. zip archive. In order to compile PMTest. mq5, it should be located in the same directory as PowellsMethod. mqh. 9. Optimization of the Model Parameter Values The previous section of the article dealt with implementation of the method for finding the function minimum and gave a simple example of its use. We will now proceed to the issues related to optimization of the exponential smoothing model parameters. For a start, let us simplify the earlier introduced AdditiveES class to the maximum by excluding from it all elements associated with the seasonal component, as the models that take into consideration seasonality are not going to be further considered in this article anyway. This will allow to make the source code of the class much easier to comprehend and reduce the number of calculations. In addition, we will also exclude all calculations related to forecasting and computations of the forecast confidence intervals for an easy demonstration of an approach to the optimization of parameters of the linear growth model with damping under consideration. The OptimizeES class derives from the PowellsMethod class and includes redefining of the virtual function func(). As mentioned earlier, the parameters whose calculated value will be minimized in the course of optimization shall be passed at the input of this function. In accordance with the maximum likelihood method, the func() function calculates the logarithm of the sum of squares of one-step-ahead forecast errors. The errors are calculated in a loop with regard to NCalc recent values of the sequence. To preserve the stability of the model, we should impose limitations on the range of changes in its parameters. This range for Alpha and Gamma parameters will be from 0.05 to 0.95, and for Phi parameter - from 0.05 to 1.0. But for optimization in our case, we use a method for finding an unconstrained minimum which does not imply the use of limitations on the arguments of the objective function. We will try to turn the problem of finding the minimum of the multi-variable function with limitations into a problem of finding an unconstrained minimum, to be able to take into consideration all limitations imposed on the parameters without changing the search algorithm. For this purpose, the so-called penalty function method will be used. This method can easily be demonstrated for a one-dimensional case. Suppose that we have a function of a single argument (whose domain is from 2.0 to 3.0) and an algorithm which in the search process can assign any values to this function parameter. In this case, we can do as follows: if the search algorithm has passed an argument which exceeds the maximum permissible value, e. g. 3.5, the function can be calculated for the argument equal to 3.0 and the obtained result is further multiplied by a coefficient proportional to the excess of the maximum value, for example k1(3.5-3)200. If similar operations are performed with regard to argument values that turned out to be below the minimum permissible value, the resulting objective function is guaranteed to increase outside the permissible range of changes in its argument. Such artificial increase in the resulting value of the objective function allows to keep the search algorithm unaware of the fact that the argument passed to the function was in any way limited and guarantee that the minimum of the resulting function will be within the set limits of the argument. Such approach is easily applied to a function of several variables. The main method of the OptimizeES class is the Calc method. A call of this method is responsible for reading data from a file, search for optimal parameter values of a model and estimation of the forecast accuracy using RelMAE for the obtained parameter values. The number of processed values of the sequence read from a file is in this case set in the variable NCalc. Below is the example of the OptimizationTest. mq5 script that uses the OptimizeES class. Following the execution of this script, the obtained result will be as shown below. Figure 6. OptimizationTest. mq5 script result Although we can now find optimal parameter values and initial values of the model, there is yet one parameter which cannot be optimized using simple tools - the number of sequence values used in optimization. In optimization with regard to a sequence of great length, we will obtain the optimal parameter values that, on the average, ensure a minimum error over the entire length of the sequence. However if the nature of the sequence varied within this interval, the obtained values for some of its fragments will no longer be optimal. On the other hand, if the sequence length is dramatically decreased, there is no guarantee that the optimal parameters obtained for such a short interval will be optimal over a longer time lag. OptimizeES. mqh and OptimizationTest. mq5 are located at the end of the article in Files. zip archive. When compiling, it is necessary that OptimizeES. mqh and PowellsMethod. mqh are located in the same directory as the compiled OptimizationTest. mq5. In the given example, USDJPYM11100.TXT file is used that contains the test sequence and that should be located in the directory MQL5FilesDataset. Table 2 shows the estimates of the forecast accuracy obtained using RelMAE by means of this script. Forecasting was done with regard to eight test sequences mentioned earlier in the article using the last 100, 200 and 400 values of each of these sequences. Table 2. Forecast errors estimated using RelMAE As can be seen, the forecast error estimates are close to unity but in the majority of cases the forecast for the given sequences in this model is more accurate than in the naive method. 10. The IndicatorES. mq5 Indicator The AdditiveESTest. mq5 indicator based on the AdditiveES. mqh class was mentioned earlier upon review of the class. All smoothing parameters in this indicator were set manually. Now after considering the method allowing to optimize the model parameters, we can create a similar indicator where the optimal parameter values and initial values will be determined automatically and only the processed sample length will need to be set manually. That said, we will exclude all calculations related to seasonality. The source code of the CIndiatorES class used in creating the indicator is set forth below. This class contains CalcPar and GetPar methods the first one is designed for calculation of the optimal parameter values of the model, the second one is intended for accessing those values. Besides, the CIndicatorES class comprises the redefining of the virtual function func(). The source code of the IndicatorES. mq5 indicator: With every new bar, the indicator finds the optimal values of the model parameters, makes calculations in the model for a given number of bars NHist, builds a forecast and defines the forecast confidence limits. The only parameter of the indicator is the length of the processed sequence the minimum value of which is limited to 24 bars. All calculations in the indicator are made on the basis of the open values. The forecasting horizon is 12 bars. The code of the IndicatorES. mq5 indicator and CIndicatorES. mqh file are located at the end of the article in Files. zip archive. Figure 7. Operation result of the IndicatorES. mq5 indicator An example of the operation result of the IndicatorES. mq5 indicator is shown in Figure 7. In the course of operation of the indicator, the 95 forecast confidence interval will take values corresponding to the obtained optimal parameter values of the model. The bigger the smoothing parameter values, the faster the increase in the confidence interval upon the increasing forecasting horizon. With a simple improvement, the IndicatorES. mq5 indicator can be used not only for forecasting currency quotes but also for forecasting values of various indicators or preprocessed data. Conclusion The main objective of the article was to familiarize the reader with additive exponential smoothing models used in forecasting. While demonstrating their practical use, some accompanying issues were also dealt with. However the materials provided in the article can be considered merely an introduction to the large range of problems and solutions associated with forecasting. I would like to draw your attention to the fact that the classes, functions, scripts and indicators provided were created in the process of writing the article and are primarily designed to serve as examples to the materials of the article. Therefore no serious testing for stability and errors was performed. Besides, the indicators set forth in the article should be considered to be only a demonstration of the implementation of the methods involved. The forecast accuracy of the IndicatorES. mq5 indicator introduced in the article can most likely be somewhat improved by using the modifications of the applied model which would be more adequate in terms of peculiarities of the quotes under consideration. The indicator can also be amplified by other models. But these issues fall beyond the scope of this article. In conclusion, it should be noted that exponential smoothing models can in certain cases produce forecasts of the same accuracy as the forecasts obtained by applying more complex models thus proving once again that even the most complex model is not always the best. संदर्भ

No comments:

Post a Comment