यह ट्रेडिंग सिग्नल उत्पन्न करने के लिए एक चलती औसत क्रॉसओवर प्रणाली है। यह रणनीति विभिन्न प्रकार के चलती औसत का चयन करने और खरीद और बिक्री संकेतों का उत्पादन करने के लिए अल्पकालिक और दीर्घकालिक चलती औसत मापदंडों को कॉन्फ़िगर करने की अनुमति देती है। यह ट्रेडिंग संकेतों को ट्रेंड दिशा के साथ संरेखित करने के लिए ट्रेंड फ़िल्टरिंग विकल्प भी प्रदान करती है।
इस रणनीति का मूल तर्क दो चलती औसत के क्रॉसओवर पर आधारित है ताकि ट्रेडिंग सिग्नल उत्पन्न हो सके। विशेष रूप सेः
खरीद संकेत तब उत्पन्न होता है जब अल्पकालिक चलती औसत लंबी अवधि के चलती औसत से ऊपर जाती है।
एक बिक्री संकेत तब उत्पन्न होता है जब अल्पकालिक चलती औसत लंबी अवधि के चलती औसत से नीचे जाता है।
इसके अतिरिक्त, रणनीति सरल चलती औसत (एसएमए), घातीय चलती औसत (ईएमए), भारित चलती औसत (डब्ल्यूएमए) और वॉल्यूम भारित चलती औसत (वीडब्ल्यूएमए) सहित चार प्रकार के चलती औसतों में से चयन करने का विकल्प प्रदान करती है। उपयोगकर्ता स्वतंत्र रूप से अल्पकालिक और दीर्घकालिक चलती औसतों को संयोजित और कॉन्फ़िगर कर सकते हैं।
इसके अतिरिक्त, रणनीति तीन ऑपरेशन मोड प्रदान करती हैः केवल लंबी, केवल छोटी और लंबी/छोटी। यह उपयोगकर्ताओं को विभिन्न बाजार स्थितियों के अनुसार उपयुक्त व्यापार दिशा चुनने की अनुमति देती है।
अंत में, एक प्रवृत्ति फ़िल्टरिंग विकल्प शामिल है। इसके लिए ट्रेडिंग संकेतों को प्रवृत्ति दिशा के साथ संरेखित करने की आवश्यकता होती है, अन्यथा संकेत को अनदेखा कर दिया जाएगा। विशेष रूप से, जब विकल्प
इस रणनीति का सबसे बड़ा लाभ यह है कि यह पैरामीटर और लचीला है। चलती औसत, सबसे बुनियादी तकनीकी संकेतकों में से एक के रूप में, मात्रात्मक व्यापार में व्यापक रूप से उपयोग किया जाता है। यह रणनीति एक अत्यधिक विन्यस्त चलती औसत क्रॉसओवर प्रणाली प्रदान करती है, ताकि उपयोगकर्ता विभिन्न बाजार स्थितियों के अनुरूप मापदंडों को लचीले ढंग से समायोजित कर सकें।
विशेष रूप से, लाभों में शामिल हैंः
चुनने के लिए कई चलती औसत प्रकार प्रदान करना जो चलती औसत मापदंडों को समायोजित करके प्रणाली का अनुकूलन करने की अनुमति देता है
विभिन्न बाजार चक्रों के अनुकूल होने के लिए संरेखित लघु और दीर्घकालिक चलती औसत अवधि
प्रतिकूल एकतरफा बाजारों से बचने के लिए वैकल्पिक लंबी/छोटी ट्रेडिंग दिशाएं
प्रवृत्ति के विरुद्ध व्यापार से बचने के लिए वैकल्पिक प्रवृत्ति फ़िल्टरिंग
सरल और स्पष्ट रणनीति तर्क जो समझने और अनुकूलित करने में आसान है
संक्षेप में, यह एक अत्यधिक लचीला और अनुकूलन योग्य चलती औसत क्रॉसओवर प्रणाली है। उपयोगकर्ता इसे किसी भी निश्चित पैटर्न के लिए बाध्य किए बिना मापदंडों को समायोजित करके अपने स्वयं के बाजार विचारों के अनुरूप बना सकते हैं।
इस रणनीति के मुख्य जोखिम निम्नलिखित से आते हैंः
पिछड़े संकेतकों के रूप में चलती औसत शुरुआती मूल्य परिवर्तनों को याद कर सकती है
अनुचित पैरामीटर संयोजनों के परिणामस्वरूप अधिक व्यापार और कम लाभप्रदता हो सकती है
बाजार व्यवस्था में परिवर्तन होने पर निश्चित पैटर्न का पालन करना विफल हो सकता है
इन जोखिमों से निपटने के लिए निम्नलिखित समाधान अपनाए जा सकते हैंः
प्रारंभिक मूल्य परिवर्तनों का पता लगाने के लिए मात्रा और अस्थिरता जैसे प्रमुख संकेतकों को शामिल करें
उच्च लाभप्रदता और नियंत्रण व्यापार आवृत्ति के लिए मापदंडों का अनुकूलन
बाजारों के रुझानों और बदलावों के अनुकूल रणनीति मापदंडों को गतिशील रूप से समायोजित करें
इस रणनीति के लिए मुख्य अनुकूलन दिशाएं हैंः
दक्षता में सुधार के लिए वॉल्यूम और बोलिंगर बैंड जैसे अन्य तकनीकी संकेतक जोड़ें
एकल व्यापार हानि को नियंत्रित करने के लिए स्टॉप लॉस को शामिल करें
पैरामीटर को गतिशील रूप से अनुकूलित करने के लिए मशीन लर्निंग एल्गोरिदम का उपयोग करें
सरल चलती औसत के बजाय बाजार संरचनाओं के आधार पर प्रवृत्ति की पहचान करें
गतिशील स्थिति आकार के लिए अस्थिरता संकेतकों को शामिल करें
इन अनुकूलन के साथ, प्रणाली में बेहतर जोखिम प्रबंधन, मजबूती और विकसित बाजारों के लिए अनुकूलन क्षमता हो सकती है।
अंत में, यह चलती औसत क्रॉसओवर रणनीति एक बहुत ही विशिष्ट प्रवृत्ति निम्नलिखित प्रणाली है। यह सरल, लचीला, समझने में आसान है, और एक अत्यधिक विन्यास योग्य ढांचा प्रदान करता है। उपयोगकर्ता इसे उचित चलती औसत का चयन करके, मापदंडों को समायोजित करके, और लंबे / छोटे व्यापार को कॉन्फ़िगर करके बाजार की स्थितियों पर अपने विचारों के अनुरूप बना सकते हैं। बेशक, वे अपने मूल प्रवृत्ति निम्नलिखित गुणों को बनाए रखते हुए अन्य तकनीकी संकेतकों को शामिल करके प्रणाली को समृद्ध भी कर सकते हैं। उचित संवर्द्धन के साथ, यह एक अधिक व्यापक और विश्वसनीय मात्रात्मक व्यापार रणनीति बन सकती है।
/*backtest start: 2023-09-08 00:00:00 end: 2023-10-08 00:00:00 period: 3h 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/ // © GlobalMarketSignals //@version=4 strategy("GMS: Moving Average Crossover Strategy", overlay=true) LongShort = input(title="Long Only or Short Only or Both?", type=input.string, defval="Both", options=["Both", "Long Only", "Short Only"]) MAs1 = input(title="Which Moving Average? (1)", type=input.string, defval="SMA", options=["SMA", "EMA", "WMA", "VWMA"]) MAs2 = input(title="Which Moving Average? (2)", type=input.string, defval="SMA", options=["SMA", "EMA", "WMA", "VWMA"]) MA1 = input(title="Moving Average Length 1", type = input.integer ,defval=10) MAL2 = input(title="Moving Average Length 2", type = input.integer ,defval=20) AboveBelow = input(title="Trend SMA Filter?", type=input.string, defval="Above", options=["Above", "Below", "Don't Include"]) TLen = input(title="Trend SMA Length", type = input.integer ,defval=200) //////////////////////// ///////LONG ONLY//////// //////////////////////// //ABOVE if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),wma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),vwma(close,MAL2))) // BELOW if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),wma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("LONG", when = crossunder(wma(close,MA1),vwma(close,MAL2))) // DONT INCLUDE if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),sma(close,MAL2)) ) strategy.close("LONG", when = crossunder(sma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),ema(close,MAL2)) ) strategy.close("LONG", when = crossunder(sma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),vwma(close,MAL2)) ) strategy.close("LONG", when = crossunder(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),wma(close,MAL2)) ) strategy.close("LONG", when = crossunder(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),sma(close,MAL2)) ) strategy.close("LONG", when = crossunder(ema(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),ema(close,MAL2)) ) strategy.close("LONG", when = crossunder(ema(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),vwma(close,MAL2)) ) strategy.close("LONG", when = crossunder(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),wma(close,MAL2)) ) strategy.close("LONG", when = crossunder(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),vwma(close,MAL2)) ) strategy.close("LONG", when = crossunder(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),sma(close,MAL2)) ) strategy.close("LONG", when = crossunder(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),ema(close,MAL2)) ) strategy.close("LONG", when = crossunder(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),wma(close,MAL2)) ) strategy.close("LONG", when = crossunder(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),wma(close,MAL2)) ) strategy.close("LONG", when = crossunder(wma(close,MA1),wma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),sma(close,MAL2)) ) strategy.close("LONG", when = crossunder(wma(close,MA1),sma(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),ema(close,MAL2)) ) strategy.close("LONG", when = crossunder(wma(close,MA1),ema(close,MAL2))) if LongShort =="Long Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),vwma(close,MAL2)) ) strategy.close("LONG", when = crossunder(wma(close,MA1),vwma(close,MAL2))) //////////////////////// ///////SHORT ONLY/////// //////////////////////// //ABOVE if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),wma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),vwma(close,MAL2))) // BELOW if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),wma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.close("SHORT", when = crossover(wma(close,MA1),vwma(close,MAL2))) // DONT INCLUDE if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),sma(close,MAL2)) ) strategy.close("SHORT", when = crossover(sma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),ema(close,MAL2)) ) strategy.close("SHORT", when = crossover(sma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),vwma(close,MAL2)) ) strategy.close("SHORT", when = crossover(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),wma(close,MAL2)) ) strategy.close("SHORT", when = crossover(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),sma(close,MAL2)) ) strategy.close("SHORT", when = crossover(ema(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),ema(close,MAL2)) ) strategy.close("SHORT", when = crossover(ema(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),vwma(close,MAL2)) ) strategy.close("SHORT", when = crossover(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),wma(close,MAL2)) ) strategy.close("SHORT", when = crossover(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),vwma(close,MAL2)) ) strategy.close("SHORT", when = crossover(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),sma(close,MAL2)) ) strategy.close("SHORT", when = crossover(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),ema(close,MAL2)) ) strategy.close("SHORT", when = crossover(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),wma(close,MAL2)) ) strategy.close("SHORT", when = crossover(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),wma(close,MAL2)) ) strategy.close("SHORT", when = crossover(wma(close,MA1),wma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),sma(close,MAL2)) ) strategy.close("SHORT", when = crossover(wma(close,MA1),sma(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),ema(close,MAL2)) ) strategy.close("SHORT", when = crossover(wma(close,MA1),ema(close,MAL2))) if LongShort =="Short Only" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),vwma(close,MAL2)) ) strategy.close("SHORT", when = crossover(wma(close,MA1),vwma(close,MAL2))) //////////////////////// /////// BOTH /////////// //////////////////////// //ABOVE if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),wma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),wma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),sma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),ema(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Above" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),vwma(close,MAL2)) and close>sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),vwma(close,MAL2))) // BELOW if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),wma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),wma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),sma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),ema(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Below" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),vwma(close,MAL2)) and close<sma(close,TLen)) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),vwma(close,MAL2))) // DONT INCLUDE if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),sma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),ema(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),vwma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "SMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(sma(close,MA1),wma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(sma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),sma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),ema(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),vwma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "EMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(ema(close,MA1),wma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(ema(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),vwma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),vwma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),sma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),ema(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "VWMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(vwma(close,MA1),wma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(vwma(close,MA1),wma(close,MAL2))) ///--/// if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "WMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),wma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),wma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "SMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),sma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),sma(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "EMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),ema(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),ema(close,MAL2))) if LongShort =="Both" and AboveBelow == "Don't Include" and MAs1 == "WMA" and MAs2 == "VWMA" strategy.entry("LONG", true, when = crossover(wma(close,MA1),vwma(close,MAL2)) ) strategy.entry("SHORT", false, when = crossunder(wma(close,MA1),vwma(close,MAL2)))