Die Strategie ist ein Multi-Bereichs-Entscheidungssystem, das auf einer Kreuzung von Moving Averages basiert. Die Strategie erlaubt die Auswahl verschiedener Arten von Moving Averages und kann langfristige Moving Average-Parameter konfigurieren, um Buy- und Sell-Signale zu erzeugen. Zusätzlich bietet die Strategie eine Trendfilteroption, die verlangt, dass die Handelssignale mit der Trendrichtung übereinstimmen.
Die Kernlogik der Strategie basiert auf der Kreuzung zweier Moving Averages, die ein Handelssignal erzeugen.
Darüber hinaus bietet die Strategie eine Auswahl aus vier Arten von Moving Averages, darunter einfache Moving Averages (SMA), Index Moving Averages (EMA), Gewichtete Moving Averages (WMA) und Quantifizierte Moving Averages (VWMA). Benutzer können die Arten von kurz- und langfristigen Moving Averages frei kombinieren.
Darüber hinaus bietet die Strategie drei Optionsmodelle: nur mehr, nur weniger und nur mehr. Dies ermöglicht dem Benutzer die Auswahl verschiedener Handelsrichtungen je nach Marktsituation.
Schließlich wurde eine Trendfilterfunktion hinzugefügt. Diese erfordert, dass das Handelssignal mit der Richtung des Trends übereinstimmt, ansonsten wird das Signal ignoriert. Insbesondere wird ein Mehrkopfsignal nur erzeugt, wenn der Preis über der Trendmittellinie liegt, wenn die Option auf die Oberfläche eingestellt ist.
Die größten Vorteile dieser Strategie liegen in ihrer parametrischen und flexiblen Funktion. Die Moving Averages werden als grundlegendste technische Indikatoren verwendet und sind in der Quantifizierung von Geschäften weit verbreitet. Die Strategie bietet ein hoch konfigurierbares Moving Average-Kreuzungssystem, das es dem Benutzer ermöglicht, die Parameter flexibel an unterschiedliche Marktumgebungen anzupassen.
Insbesondere die Vorteile der Strategie sind:
Insgesamt ist die Strategie ein sehr flexibles und anpassbares System von Moving Average Crossovers, bei dem der Benutzer sich an die Marktsituation anpassen kann, ohne sich an irgendeine feste Form zu halten.
Die Hauptrisiken dieser Strategie sind:
In Bezug auf diese Risiken bietet die Strategie folgende Lösungen:
Diese Strategie kann in folgenden Dimensionen optimiert werden:
Durch die Optimierung der oben genannten Punkte können Systeme mit besseren Risikomanagementmechanismen, höherer Stabilität und einer stärkeren Anpassungsfähigkeit an Marktveränderungen ausgestattet werden.
Die Moving Average Crossover Strategie ist eine sehr typische Trendfollowing-Strategie. Sie ist einfach, flexibel und leicht verständlich und bietet ein hoch konfigurierbares Handelssystem. Der Benutzer kann die richtige Kombination von Moving Averages wählen, die Parameter anpassen, die Multi-Bereichs-Handelsrichtung konfigurieren und so weiter, je nachdem, wie die Marktentwicklung aussieht.
/*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)))