Monatliche Trendbreakout-Strategie

Schriftsteller:ChaoZhang, Datum: 23.10.2023
Tags:

img

Übersicht

Die Monatliche Trend-Breakout-Strategie ist ein TradingView-Indikator, der auf Pine Script basiert. Er kombiniert einen adaptiven gleitenden Durchschnitt, Trendline-Breakouts und den RSI-Indikator, um einmal im Monat lange Eintrittssignale zu bestimmen.

Strategie Logik

  1. Definieren Sie die Variable lastEntryMonth, um den letzten Eintragmonat zu verfolgen.

  2. Setzen Sie TRAMA adaptive MA-Parameter length=99 auf glatte Preise und bestimmen Sie den Trend.

  3. Lange, wenn der Preis über die Trendlinie bricht.

  4. Berechnen Sie den RSI-Indikator mit rsiLength=14 zur Bestimmung von Überkauf/Überverkauf.

  5. Eintrittslogik: Gehen Sie lang, wenn Sie schließen > TRAMA und schließen Sie Bruch über der oberen Trendlinie, wenn Sie im letzten Monat keinen Eintrag gemacht haben.

  6. Ausgangslogik: Long schließen, wenn der RSI > 70 (überkauft) ist.

  7. Grafik TRAMA-Linie und RSI überkauft Niveau 70.

Die Strategie kombiniert 3 wichtige technische Indikatoren, um einmal im Monat Low-Risk-Long-Einträge zu finden.

Vorteile

  1. Kombiniert mehrere Indikatoren für eine robuste Marktanalyse und höhere Genauigkeit.

  2. Limitiert die Einträge auf monatliche Zeitrahmen, um Überhandelungen zu vermeiden.

  3. Adaptive MA passt sich schnell an Trendänderungen an.

  4. Überverkauft RSI vermeidet den Kauf an den Marktspitzen und kontrolliert das Risiko.

  5. Einfache Ein- und Ausstiegsregeln sind leicht umzusetzen.

  6. Anpassbare Parameter ermöglichen eine Optimierung der Strategie.

Risiken

  1. Whipsaw-Risiko, wenn der Ausbruch fehlschlägt, Stop-Loss, wenn der Preis unter die Trendlinie fällt.

  2. Schlechtes Timing führt zu Einträgen in die Nähe der Spitzen.

  3. Schlechte Indikatorparameter verursachen irreführende Signale.

  4. Ausbrechungen können die jüngste Marktvolatilität widerspiegeln.

  5. Überlegen Sie, ob Sie nur Pullbacks handeln oder andere Bestätigungsfilter hinzufügen.

  6. Verwenden Sie höhere Zeitrahmen, um den Trend zu identifizieren, und niedrigere für den Einstieg.

  7. Backtest unter verschiedenen Marktbedingungen, Optimierung der Parameter, um die Strategie an den Markttyp anzupassen.

Optimierung

  1. Fügen Sie einen Lautstärkenanzeiger hinzu, um falsche Ausbrüche bei geringer Lautstärke zu vermeiden.

  2. Betrachten Sie einen teilweisen Gewinn, der auf RSI-Überkauf ausgeht, wobei eine teilweise Position beibehalten wird.

  3. Optimierung der MA-Parameter, um sich besser an Trendveränderungen anzupassen.

  4. Fügen Sie Zonen vor/nach dem Ausbruchpunkt hinzu, um zu vermeiden, dass Sie bei der Umkehrung direkt kaufen.

  5. Fügen Sie mehr Filter wie Kanäle hinzu, Volatilität für höhere Genauigkeit.

  6. Skalieren Sie mit zusätzlichen Ausbrüchen auf neuen Widerstandsniveaus.

Schlussfolgerung

Die Monats-Trend-Breakout-Strategie analysiert Trend, Dynamik und Extreme. Sie bestimmt den Trend auf monatlichen Zeiträumen, tritt aber auf kürzere Zeiträume ein. Der RSI überwacht das Risikomanagement. Einfache Logik identifiziert optimierte monatliche lange Einträge. Sie balanciert Trendverfolgung und Risikokontrolle. Die Parameteroptimierung passt sie an verschiedene Marktbedingungen an. Insgesamt ist dies eine einfache, aber robuste Strategie, die Benutzerfreundlichkeit und effektives Risikomanagement kombiniert.


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

//@version=5
strategy('Bannos Strategy', shorttitle='Bannos', overlay=true)

//The provided script is an indicator for TradingView written in Pine Script version 5. The indicator is used to determine entry and exit points for a trading strategy. Here's a detailed breakdown of what the script does:

// Strategy Definition:

// Bannos Strategy is the full name, with a short title Bannos.
// The overlay=true option indicates that the strategy will be overlayed on the price chart.
// Tracking Entry Month:

// A variable lastEntryMonth is set up to track the month of the last entry.
// currentMonth identifies the current month.
// Trend Regularity Adaptive Moving Average (TRAMA):

// It takes an input of length 99 as default.
// It uses adaptive calculations to track trend changes.
// Trendlines with Breaks:

// Identifies local peaks over a given period (in this case, 14) and calculates a slope based on these peaks.
// Relative Strength Index (RSI):

// Uses a length of 14 (default) to calculate the RSI.
// RSI is an oscillation indicator that indicates overbought or oversold conditions.
// Strategy Logic for Long Entry:

// A long position is opened if:
// The close price is above the TRAMA.
// There's a crossover of the close price and the upper trendline.
// The position is taken only once per month.
// Strategy Logic for Long Exit:

// The long position is closed if the RSI exceeds 70, indicating an overbought condition.
// Plotting:

// The TRAMA is plotted in red on the chart.
// A horizontal line is also drawn at 70 to indicate the RSI's overbought zone.
// In summary, this strategy aims to enter a long position when certain trend and crossover conditions are met, and close the position when the market is considered overbought as per the RSI. Additionally, it ensures entries only occur once a month.
//



// Variable pour suivre le mois de la dernière entrée
var float lastEntryMonth = na
currentMonth = month(time)

// Parameters for Trend Regularity Adaptive Moving Average (TRAMA)
length_trama = input(99)
src_trama = close
ama = 0.
hh = math.max(math.sign(ta.change(ta.highest(length_trama))), 0)
ll = math.max(math.sign(ta.change(ta.lowest(length_trama)) * -1), 0)
tc = math.pow(ta.sma(hh or ll ? 1 : 0, length_trama), 2)
ama := nz(ama[1] + tc * (src_trama - ama[1]), src_trama)

// Parameters for Trendlines with Breaks
length_trend = 14
mult = 1.0
ph = ta.pivothigh(length_trend, length_trend)
upper = 0.
slope_ph = 0.
slope_ph := ph ? mult : slope_ph
upper := ph ? ph : upper - slope_ph

// Parameters for RSI
rsiLength = 14
up = ta.rma(math.max(ta.change(close), 0), rsiLength)
down = ta.rma(-math.min(ta.change(close), 0), rsiLength)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

// Strategy Logic for Long Entry
longCondition = close > ama and ta.crossover(close, upper) and (na(lastEntryMonth) or lastEntryMonth != currentMonth)
if (longCondition)
    lastEntryMonth := currentMonth
    strategy.entry('Long', strategy.long)

// Strategy Logic for Long Exit
exitCondition = rsi > 70
if (exitCondition)
    strategy.close('Long')

// Plotting
plot(ama, 'TRAMA', color=color.red)
hline(70, 'Overbought', color=color.red)


Mehr