NoroBands Momentum-Positionsstrategie

Schriftsteller:ChaoZhang, Datum: 18.01.2024
Tags:

img

Übersicht

Diese Strategie kombiniert die Bandtheorie von Noro mit quantitativen Techniken, um eine Momentum-Breakout-Strategie zu bilden.

Strategie Logik

  1. Berechnen Sie die oberen und unteren Bands unter Verwendung des durchschnittlichen wahren Bereichs. Der Preis, der durch den oberen Band bricht, zeigt ein langes Signal an, während der unteren Band bricht, ein kurzes Signal gibt.
  2. Der RSI-Indikator wird verwendet, um die Überkauf- und Überverkaufszonen zu bestimmen.
  3. Der Durchbruch der Maximal- und Minimalpreise zeigt die Kursdynamik.
  4. Farbige Balken zeigen bullische oder bärische Märkte an. Grün bedeutet "Bullmarkt für lange", während rot "Barsmarkt für kurze" bedeutet.
  5. Kombination des gleitenden Durchschnitts zur Ermittlung der Divergenz bei Handelssignalen.

Vorteile

  1. Die Kombination mehrerer Indikatoren verbessert die Genauigkeit.
  2. Die Kombination von Bandtheorie und quantitativen Techniken macht die Strategie effektiver.
  3. Durch die Kombination von Momentum-Breakout und Mean-Reversion-Trading erweitert sich der Gewinnraum.
  4. Hohe Erweiterbarkeit zur Anpassung der Parameter an die Märkte.

Risiken

  1. Parameter müssen ständig optimiert und getestet werden.
  2. Reagiert nicht rechtzeitig auf lange, kurze Schalter, verursacht Verluste wahrscheinlich.
  3. Hohe Handelsfrequenz, leicht von Gebühren und Verschiebungen betroffen.
  4. Die Parameter sollten rechtzeitig an die unterschiedlichen Zyklen angepasst werden.

Optimierung

  1. Multi-Zeitrahmen-Validierung, um die beste Parameterkombination zu finden.
  2. Hinzufügen von Stop-Loss, um Einzelverlust zu reduzieren.
  3. Größeres Positionsmanagement zur Verbesserung der Gewinneffizienz.
  4. Verbinden Sie Deep Learning für die automatische Optimierung von Parametern.

Zusammenfassung

Diese Strategie kombiniert typische quantitative Indikatoren, um einen effektiven Gewinn durch Impuls- und Mittelumkehrindikatoren zu erzielen. Sie verwendet auch die Theorie des durchschnittlichen wahren Bereichs, um angemessene Einstiegspunkte zu lokalisieren. Ein gutes Beispiel für die Kombination von Theorie und Technik. Mit Parameteroptimierung und Verbesserung der Risikokontrolle wird sie zu einer effizienten und stabilen quantitativen Strategie.


/*backtest
start: 2023-01-11 00:00:00
end: 2024-01-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/


//@version=2
strategy("Noro's Bands Strategy v1.5", shorttitle = "NoroBands str 1.5", overlay=true)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
len = input(20, defval = 20, minval = 2, maxval = 200, title = "Period")
color = input(true, defval = true, title = "Use ColorBar")
usecb = input(true, defval = true, title = "Use CryptoBottom")
usersi = input(true, defval = true, title = "Use RSI")
usemm = input(true, defval = true, title = "Use min/max")
usepyr = input(true, defval = true, title = "Use pyramiding")
needbb = input(false, defval = false, title = "Show Bands")
needbg = input(false, defval = false, title = "Show Background")
needlo = input(false, defval = false, title = "Show Locomotive")
needpy = input(false, defval = false, title = "Show Avg.price line")
src = close

//Fast RSI
fastup = rma(max(change(src), 0), 2)
fastdown = rma(-min(change(src), 0), 2)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))

//CryptoBottom
mac = sma(close, 10)
lencb = abs(close - mac)
sma = sma(lencb, 100)
max = max(open, close)
min = min(open, close)

//PriceChannel
lasthigh = highest(src, len)
lastlow = lowest(src, len)
center = (lasthigh + lastlow) / 2

//dist
dist = abs(src - center)
distsma = sma(dist, len)
hd = center + distsma
ld = center - distsma
hd2 = center + distsma * 2
ld2 = center - distsma * 2

//Trend
trend = close < ld and high < hd ? -1 : close > hd and low > ld ? 1 : trend[1]

//Lines
colo = needbb == false ? na : black
plot(hd2, color = colo, linewidth = 1, transp = 0, title = "High band 2")
plot(hd, color = colo, linewidth = 1, transp = 0, title = "High band")
plot(center, color = colo, linewidth = 1, transp = 0, title = "center")
plot(ld, color = colo, linewidth = 1, transp = 0, title = "Low band")
plot(ld2, color = colo, linewidth = 1, transp = 0, title = "Low band 2")

//Background
col = needbg == false ? na : trend == 1 ? lime : red
bgcolor(col, transp = 80)

//Signals
up = trend == 1 and ((close < open or color == false) or close < hd) and (min < min[1] or usemm == false) and (close < strategy.position_avg_price or usepyr == false or strategy.position_size <= 0) ? 1 : 0
dn = trend == -1 and ((close > open or color == false) or close > ld) and (max > max[1] or usemm == false) and (close > strategy.position_avg_price or usepyr == false or strategy.position_size >= 0) ? 1 : 0 
up2 = close < open and lencb > sma * 3 and min < min[1] and fastrsi < 10 and (close < strategy.position_avg_price or usepyr == false or strategy.position_size <= 0) ? 1 : 0 //CryptoBottom
//dn2 = close > open and len > sma * 3 and max > max[1] and fastrsi > 90 ? 1 : 0 //CryptoBottom
up3 = fastrsi < 5 and usersi == true and (close < strategy.position_avg_price or usepyr == false or strategy.position_size <= 0) ? 1 : 0
//dn3 = fastrsi > 95 and usersi = true ? 1 : 0

//Avg Price
colpy = needpy == false ? na : black
plot(strategy.position_avg_price, color = colpy)

up4 = close < strategy.position_avg_price and usepyr == true and strategy.position_size >= 0 ? 1 : 0 
dn4 = close > strategy.position_avg_price and usepyr == true and strategy.position_size <= 0 ? 1 : 0 

//Locomotive
uploco = trend == 1 and close < open and min < min[1] and close < center ? 1 : 0
plotarrow(needlo == true and uploco == 1 ? 1 : 0, colorup = black, colordown = black, transp = 0)

longCondition = up == 1 or (up2 == 1 and usecb == true) or (up3 == 1 and usersi == true) or up4 == 1
if (longCondition)
    strategy.entry("Long", strategy.long, needlong == false ? 0 : na)

shortCondition = dn == 1 or dn4 == 1
if (shortCondition)
    strategy.entry("Short", strategy.short, needshort == false ? 0 : na)

Mehr