یہ ٹریڈنگ سگنل تیار کرنے کے لئے ایک حرکت پذیر اوسط کراس اوور سسٹم ہے۔ یہ حکمت عملی مختلف قسم کے حرکت پذیر اوسط کا انتخاب کرنے اور خرید و فروخت کے سگنل تیار کرنے کے لئے قلیل مدتی اور طویل مدتی حرکت پذیر اوسط پیرامیٹرز کی تشکیل کی اجازت دیتی ہے۔ یہ رجحان کی سمت کے ساتھ تجارتی سگنل کو سیدھ کرنے کے لئے رجحان فلٹرنگ کے اختیارات بھی فراہم کرتی ہے۔
اس حکمت عملی کا بنیادی منطق تجارتی سگنل پیدا کرنے کے لئے دو حرکت پذیر اوسط کے کراس اوور پر مبنی ہے۔ خاص طور پر:
خریدنے کا اشارہ اس وقت پیدا ہوتا ہے جب قلیل مدتی حرکت پذیر اوسط طویل مدتی حرکت پذیر اوسط سے اوپر ہوتا ہے۔
فروخت کا اشارہ اس وقت پیدا ہوتا ہے جب قلیل مدتی حرکت پذیر اوسط طویل مدتی حرکت پذیر اوسط سے نیچے ہوتا ہے۔
اس کے علاوہ ، حکمت عملی میں چار اقسام کے چلتے ہوئے اوسطوں میں سے انتخاب کرنے کا اختیار فراہم کیا گیا ہے ، جن میں سادہ چلتے ہوئے اوسط (ایس ایم اے) ، تیزی سے چلتے ہوئے اوسط (ای ایم اے) ، وزن والے چلتے ہوئے اوسط (ڈبلیو ایم اے) اور حجم وزن والے چلتے ہوئے اوسط (وی ڈبلیو ایم اے) شامل ہیں۔ صارفین مختصر اور طویل مدتی چلتے ہوئے اوسط کو آزادانہ طور پر جوڑ سکتے ہیں اور تشکیل دے سکتے ہیں۔
اس کے علاوہ، حکمت عملی تین آپریشن کے طریقوں کو پیش کرتا ہے: صرف طویل، صرف مختصر اور طویل / مختصر. اس سے صارفین کو مختلف مارکیٹ کے حالات کے مطابق مناسب ٹریڈنگ سمت منتخب کرنے کی اجازت دیتا ہے.
آخر میں ، ایک رجحان فلٹرنگ آپشن شامل ہے۔ اس میں تجارتی سگنل کو رجحان کی سمت کے ساتھ سیدھ میں لانا پڑتا ہے ، ورنہ سگنل کو نظرانداز کیا جائے گا۔ خاص طور پر ، جب آپشن
اس حکمت عملی کا سب سے بڑا فائدہ یہ ہے کہ یہ پیرامیٹر اور لچکدار ہے۔ چلتی اوسط ، بنیادی تکنیکی اشارے میں سے ایک کے طور پر ، مقداری تجارت میں وسیع پیمانے پر استعمال ہوتی ہے۔ یہ حکمت عملی ایک انتہائی تشکیل پذیر چلتی اوسط کراس اوور سسٹم مہیا کرتی ہے ، تاکہ صارفین پیرامیٹرز کو مختلف مارکیٹ کے حالات کے مطابق لچکدار طریقے سے ایڈجسٹ کرسکیں۔
خاص طور پر، فوائد میں شامل ہیں:
منتخب کرنے کے لئے متعدد چلتی اوسط اقسام فراہم کرنا جو چلتی اوسط پیرامیٹرز کو ایڈجسٹ کرکے نظام کو بہتر بنانے کی اجازت دیتا ہے
مختلف مارکیٹ سائیکلوں کو اپنانے کے لئے ترتیب دینے کے قابل مختصر اور طویل مدتی چلتی اوسط مدت
غیر منقولہ یکطرفہ منڈیوں سے بچنے کے لئے اختیاری طویل / مختصر تجارتی سمتیں
رجحان کے خلاف تجارت سے بچنے کے لئے اختیاری رجحان فلٹرنگ
سادہ اور واضح حکمت عملی منطق جو سمجھنے اور بہتر بنانے میں آسان ہے
خلاصہ یہ ہے کہ یہ ایک انتہائی لچکدار اور حسب ضرورت چلتی اوسط کراس اوور سسٹم ہے۔ صارفین اسے کسی بھی فکسڈ پیٹرن کی پابندی کے بغیر پیرامیٹرز کو ایڈجسٹ کرکے اپنے مارکیٹ کے خیالات کے مطابق بنا سکتے ہیں۔
اس حکمت عملی کے اہم خطرات مندرجہ ذیل ہیں:
پسماندہ اشارے کے طور پر چلتی اوسط ابتدائی قیمت کی تبدیلیوں کو نظر انداز کرسکتے ہیں
پیرامیٹرز کے غلط مجموعے کا نتیجہ زیادہ تجارت اور کم منافع میں ہوسکتا ہے
جب مارکیٹ کا نظام بدل جاتا ہے تو مقررہ نمونوں پر قائم رہنا ناکام ہوسکتا ہے
ان خطرات سے نمٹنے کے لیے مندرجہ ذیل حل اپنائے جا سکتے ہیں:
قیمتوں میں ابتدائی تبدیلیوں کا پتہ لگانے کے لئے حجم اور اتار چڑھاؤ جیسے اہم اشارے شامل کریں
زیادہ منافع بخش اور کنٹرول تجارتی تعدد کے لئے پیرامیٹرز کو بہتر بنائیں
رجحانات اور مختلف مارکیٹوں کو اپنانے کے لئے حکمت عملی کے پیرامیٹرز کو متحرک طور پر ایڈجسٹ کریں
اس حکمت عملی کے لئے اصلاح کی اہم سمتیں یہ ہیں:
کارکردگی کو بہتر بنانے کے لئے حجم اور بولنگر بینڈ جیسے دیگر تکنیکی اشارے شامل کریں
ایک ہی تجارت کے نقصان کو کنٹرول کرنے کے لئے سٹاپ نقصان کو شامل کریں
پیرامیٹرز کو متحرک طور پر بہتر بنانے کے لئے مشین لرننگ الگورتھم کا استعمال کریں
سادہ چلتی اوسط کے بجائے مارکیٹ کی ساخت پر مبنی رجحان کی نشاندہی کریں
متحرک پوزیشن سائزنگ کے لئے اتار چڑھاؤ کے اشارے شامل کریں
ان اصلاحات کے ساتھ، نظام بہتر خطرے کے انتظام، استحکام، اور ترقی پذیر مارکیٹوں کے لئے موافقت پذیر ہو سکتا ہے.
اختتام کے طور پر ، یہ حرکت پذیر اوسط کراس اوور حکمت عملی ایک بہت ہی عام رجحان کے بعد کا نظام ہے۔ یہ آسان ، لچکدار ، سمجھنے میں آسان ہے ، اور ایک انتہائی ترتیب دینے والا فریم ورک فراہم کرتا ہے۔ صارفین مناسب حرکت پذیر اوسط کا انتخاب کرکے ، پیرامیٹرز کو ایڈجسٹ کرکے ، اور طویل / مختصر تجارت کو ترتیب دے کر اسے مارکیٹ کے حالات کے بارے میں اپنے خیالات کے مطابق بنا سکتے ہیں۔ یقینا ، وہ دوسرے تکنیکی اشارے کو شامل کرکے نظام کو بھی افزودہ کرسکتے ہیں جبکہ اس کے بنیادی رجحان کی پیروی کے فوائد کو برقرار رکھتے ہیں۔ مناسب بہتری کے ساتھ ، یہ ایک زیادہ جامع اور قابل اعتماد مقداری تجارتی حکمت عملی بن سکتی ہے۔
/*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)))