
Eine Trend-Tracking-Strategie, die sich aus einer Kombination aus schnellen und langsamen Moving Averages zusammensetzt, um eine Trendentwicklung zu ermitteln und bei einer Trendwende ein Handelssignal zu erzeugen. Die Strategie kombiniert gleichzeitig die Gleichgewichts- und die Preiskanal-Indikatoren, um Trends zu identifizieren und effektiv Marktlärm zu filtern und die Richtung zu bestimmen.
Die Trend-Tracking-Strategie mit zwei Moving Average-Indikatoren, dem Fast Moving Average (FMA) und dem Slow Moving Average (SLMA), wird verwendet. Die Fast Moving Average wird verwendet, um ein Handelssignal zu erzeugen, während die Slow Moving Average verwendet wird, um die Richtung der Markttrends zu bestimmen.
Die Strategie nutzt auch gleichzeitig die Preiskanalindikatoren, um Trends zu beurteilen. Die Preiskanäle werden durch den Moving Average der Höchst- und Tiefpreise bestimmt. Wenn der Preis die Kanäle durchbricht, bedeutet dies eine Trendwende. Die Strategie verwendet zwei Preiskanäle.
Bei der Beurteilung von Kauf- und Verkaufssignalen verlangt die Strategie, dass rote Säulen in Folge angezeigt werden (die Anzahl der Säulen, die der Benutzer einstellen kann), als zusätzliche Filterbedingung. Dies verhindert, dass falsche Signale in der Berechnungszone ausgegeben werden.
Im Allgemeinen ist die Logik der Trendbeobachtungs-Strategie für Trendbeurteilungen:
Durch mehrere Ebenen der Trendbeurteilung kann der Lärm effektiv gefiltert und die Richtung der Trends bestimmt werden.
Die Vorteile der Trend-Tracking-Strategie sind:
Insgesamt ist die Strategie insgesamt stabiler und spielt sich in stark trendigen Märkten gut ab.
Die Doppel-Linien-Trend-Tracking-Strategie birgt auch einige Risiken, vor allem:
Entsprechend können strategische Risiken durch folgende Maßnahmen verringert werden:
Es gibt noch Raum für weitere Optimierungen der Trend-Tracking-Strategie, und zwar in folgenden Bereichen:
Diese Optimierungsrichtungen können die Stabilität, Anpassungsfähigkeit und Intelligenz der Strategien weiter verbessern.
Die binäre Gleichgewichtsstrategie ist insgesamt eine robuste Trendverfolgungsstrategie. Sie kombiniert Gleichgewichtsindikatoren und Preiskanäle, um die Richtung und Stärke des Trends zu bestimmen und ein Handelssignal in einer schnellen Gleichgewichtslinie zu senden. Die zusätzlichen Pilzfilterbedingungen können auch fehlerhafte Signale weiter verhindern. Die Strategie ist anpassbar und kann sich gut an verschiedene Marktumgebungen anpassen.
/*backtest
start: 2023-12-24 00:00:00
end: 2024-01-23 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
strategy(title = "Noro's Trend MAs Strategy v1.8", shorttitle = "Trend MAs str 1.8", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value=100.0, pyramiding=0)
//Settings
needlong = input(true, "long")
needshort = input(true, "short")
needstops = input(false, "stops")
stoppercent = input(5, defval = 5, minval = 1, maxval = 50, title = "Stop, %")
useohlc4 = input(false, defval = false, title = "Use OHLC4")
usefastsma = input(true, "Use fast MA Filter")
fastlen = input(5, defval = 5, minval = 1, maxval = 50, title = "fast MA Period")
slowlen = input(21, defval = 20, minval = 2, maxval = 200, title = "slow MA Period")
bars = input(2, defval = 2, minval = 0, maxval = 3, title = "Bars Q")
needbg = input(false, defval = false, title = "Need trend Background?")
needarr = input(false, defval = false, title = "Need entry arrows?")
src = useohlc4 == true ? ohlc4 : close
fastsma = ema(src, 5)
//PriceChannel 1
lasthigh = highest(src, slowlen)
lastlow = lowest(src, slowlen)
center = (lasthigh + lastlow) / 2
//PriceChannel 2
lasthigh2 = highest(src, fastlen)
lastlow2 = lowest(src, fastlen)
center2 = (lasthigh2 + lastlow2) / 2
//Trend
//ma = type == 1 ? sma(src, len) : type == 2 ? ema(src, len) : type == 3 ? vwma(src, len) : type == 4 ? dema : type == 5 ? tema : type == 6 ? kama : type == 7 ? center : 0
//trend = low > ma and low[1] > ma[1] and low[2] > ma[2] ? 1 : high < ma and high[1] < ma[1] ? -1 : trend[1]
trend1 = low > center and low[1] > center[1] ? 1 : high < center and high[1] < center[1] ? -1 : trend1[1]
trend2 = low > center2 and low[1] > center2[1] ? 1 : high < center2 and high[1] < center2[1] ? -1 : trend1[1]
trend = trend1 == 1 and trend2 == 1 ? 1 : trend2 == -1 and trend2 == -1 ? -1 : trend[1]
//Bars
bar = close > open ? 1 : close < open ? -1 : 0
redbars = bars == 0 ? 1 : bars == 1 and bar == -1 ? 1 : bars == 2 and bar == -1 and bar[1] == -1 ? 1 : bars == 3 and bar == -1 and bar[1] == -1 and bar[2] == -1 ? 1 : 0
greenbars = bars == 0 ? 1 : bars == 1 and bar == 1 ? 1 : bars == 2 and bar == 1 and bar[1] == 1 ? 1 : bars == 3 and bar == 1 and bar[1] == 1 and bar[2] == 1 ? 1 : 0
//Signals
up = trend == 1 and (low < center2 or usefastsma == false) and (redbars == 1) ? 1 : 0
dn = trend == -1 and (high > center2 or usefastsma == false) and (greenbars == 1) ? 1 : 0
//Lines
colorfastsma = usefastsma == true ? red : na
plot(fastsma, color = colorfastsma, title = "Fast MA")
plot(center, color = blue, linewidth = 3, transp = 0, title = "Slow MA")
plot(center2, color = red, linewidth = 3, transp = 0, title = "PriceChannel 2")
//Arrows
plotarrow(up == 1 and needarr == true ? 1 : 0, colorup = black, colordown = black, transp = 0)
plotarrow(dn == 1 and needarr == true ? -1 : 0, colorup = black, colordown = black, transp = 0)
//Background
col = needbg == false ? na : trend == 1 ? lime : red
bgcolor(col, transp = 90)
//Alerts
alertcondition(up == 1, title='buy', message='Uptrend')
alertcondition(dn == 1, title='sell', message='Downtrend')
//Trading
stoplong = up == 1 and needstops == true ? close - (close / 100 * stoppercent) : stoplong[1]
stopshort = dn == 1 and needstops == true ? close + (close / 100 * stoppercent) : stopshort[1]
longCondition = up == 1
if (longCondition)
strategy.entry("Long", strategy.long, needlong == false ? 0 : na)
strategy.exit("Stop Long", "Long", stop = stoplong)
shortCondition = dn == 1
if (shortCondition)
strategy.entry("Short", strategy.short, needshort == false ? 0 : na)
strategy.exit("Stop Short", "Short", stop = stopshort)