Эта стратегия является многопрофильной системой принятия решений, основанной на перекрестных движущихся средних. Стратегия позволяет выбирать различные типы движущихся средних и может конфигурировать долгосрочные и краткосрочные параметры движущихся средних, что приводит к сигналам покупки и продажи. Кроме того, стратегия предоставляет опцию фильтрации тенденций, которая требует, чтобы торговые сигналы соответствовали направлению тенденции.
Основная логика стратегии основана на перекрестке двух скользящих средних для получения торгового сигнала.
Кроме того, в стратегии предлагается выбор из четырех типов движущихся средних, включая простые движущиеся средние (SMA), индексные движущиеся средние (EMA), весовые движущиеся средние (WMA) и количественные движущиеся средние (VWMA). Пользователи могут свободно комбинировать и настраивать типы краткосрочных и долгосрочных средних.
Кроме того, стратегия предлагает три режима работы: только плюс, только минус и полный плюс. Это позволяет пользователям выбирать различные направления торговли в зависимости от рыночных условий.
Наконец, в стратегию добавлена функция фильтрации трендов. Эта функция требует, чтобы торговый сигнал был в соответствии с направлением тренда, в противном случае сигнал игнорируется. В частности, когда опция настроена на Above, многоголовый сигнал производится только тогда, когда цена выше средней линии тренда; когда опция настроена на Below, пустой сигнал производится только тогда, когда цена ниже средней линии тренда.
Наибольшим преимуществом данной стратегии является параметричность и гибкость. Движущаяся средняя, являющаяся наиболее фундаментальным техническим показателем, широко используется в количественных сделках. Стратегия предоставляет высококонфигурируемую систему пересечения движущихся средних, позволяя пользователю гибко регулировать параметры для различных рыночных условий.
В частности, преимущества стратегии включают в себя:
В целом, стратегия представляет собой очень гибкую и настраиваемую систему пересечения подвижных средних, которую пользователи могут корректировать в соответствии со своим суждением о рынке, не ограничиваясь какой-либо фиксированной моделью.
Основные риски этой стратегии исходят из:
В связи с вышеуказанными рисками в данной стратегии предлагаются следующие решения:
Эта стратегия может быть оптимизирована в следующих аспектах:
Оптимизация вышеперечисленных пунктов позволяет системе иметь лучшие механизмы управления рисками, более высокую стабильность и более высокую способность адаптироваться к изменениям рынка.
Это очень типичная стратегия для слежения за тенденциями. Она проста, гибкая, легко понятная и предлагает высококонфигурируемую торговую систему. Пользователь может выбрать подходящую комбинацию движущихся средних, настроить параметры, настроить многополосные торговые направления и т. Д. в зависимости от ситуации на рынке.
/*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)))