
Es handelt sich um eine umfassende Handelsstrategie, die Brin-Band und Parallax-Linie-Wechsel-Indikator ((PSAR) kombiniert und mit einem festen Risiko-Gewinn-Verhältnis verwaltet wird. Die Strategie läuft hauptsächlich während des Tageshandels und identifiziert Handelschancen durch Preisbruch von Brin-Bändern und Graphik-Formaten, während die PSAR-Indikator zur Trendbestätigung verwendet wird. Die Strategie verwendet eine dynamische Stop-Loss- und Profit-Ziel-Einstellung, um ein Risiko-Gewinn-Verhältnis von 1:3 zu halten.
Die Strategie verwendet mehrere technische Indikatoren für die Bestätigung von Handelssignalen:
Die Strategie baut ein vollständiges Handelssystem auf, indem sie Brin-Bands, PSAR-Indikatoren und Graphik-Analysen kombiniert. Die Kernvorteile der Strategie liegen in der Synergie mehrerer technischer Indikatoren und einer strengen Risikomanagement. Obwohl einige inhärente Risiken bestehen, kann die Strategie durch die empfohlene Optimierungsrichtung die Stabilität und Profitabilität der Strategie weiter verbessern.
/*backtest
start: 2024-02-18 00:00:00
end: 2025-02-17 00:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Estrategia Bollinger con PSAR y TP Máximo/ Mínimo", overlay=true)
// Parámetros de las Bandas de Bollinger
bb_length = input.int(20, title="Periodo de Bandas de Bollinger", minval=1)
bb_stddev = input.float(2.0, title="Desviación Estándar", step=0.1)
// Parámetros del Parabolic SAR
psar_start = input.float(0.02, title="PSAR Factor Inicial", step=0.01)
psar_increment = input.float(0.02, title="PSAR Incremento", step=0.01)
psar_max = input.float(0.2, title="PSAR Máximo", step=0.01)
// Cálculo de Bandas de Bollinger
basis = ta.sma(close, bb_length)
upper_band = basis + bb_stddev * ta.stdev(close, bb_length)
lower_band = basis - bb_stddev * ta.stdev(close, bb_length)
// Cálculo del Parabolic SAR
psar = ta.sar(psar_start, psar_increment, psar_max)
// Cálculo del cuerpo de la vela
body_high = math.max(open, close)
body_low = math.min(open, close)
body_length = body_high - body_low
total_length = high - low
body_ratio = body_length / total_length
// Condiciones de Entrada
long_condition = close > upper_band and body_ratio >= 0.33
short_condition = close < lower_band and body_ratio >= 0.33
// Filtro de tiempo: Operar solo de 7:30 AM a 4:00 PM hora colombiana
start_time = timestamp("GMT-5", year, month, dayofmonth, 7, 30)
end_time = timestamp("GMT-5", year, month, dayofmonth, 16, 0)
time_condition = (time >= start_time) and (time <= end_time)
// Variables para mantener el TP máximo y mínimo
var float max_tp = na
var float min_tp = na
var float dynamic_stop = na
// Condiciones de Entrada y Salida
if (long_condition and time_condition)
entry_price = close // Precio de entrada
stop_loss = low // SL en el mínimo de la vela
take_profit = entry_price + 3 * (entry_price - stop_loss) // TP con relación 1:3
strategy.entry("Compra", strategy.long)
strategy.exit("Exit Compra", "Compra", stop=stop_loss, limit=take_profit)
// Dibujar las etiquetas para SL y TP para la operación larga
label.new(bar_index, stop_loss, text="SL: " + str.tostring(stop_loss), style=label.style_label_up, color=color.red, textcolor=color.white, size=size.small)
label.new(bar_index, take_profit, text="TP: " + str.tostring(take_profit), style=label.style_label_down, color=color.green, textcolor=color.white, size=size.small)
if (short_condition and time_condition)
entry_price = close // Precio de entrada
stop_loss = high // SL en el máximo de la vela
take_profit = entry_price - 3 * (stop_loss - entry_price) // TP con relación 1:3
strategy.entry("Venta", strategy.short)
strategy.exit("Exit Venta", "Venta", stop=stop_loss, limit=take_profit)
// Dibujar las etiquetas para SL y TP para la operación corta
label.new(bar_index, stop_loss, text="SL: " + str.tostring(stop_loss), style=label.style_label_down, color=color.red, textcolor=color.white, size=size.small)
label.new(bar_index, take_profit, text="TP: " + str.tostring(take_profit), style=label.style_label_up, color=color.green, textcolor=color.white, size=size.small)
// Dibujar Bandas de Bollinger
plot(upper_band, color=color.red, title="Banda Superior")
plot(lower_band, color=color.green, title="Banda Inferior")
plot(basis, color=color.blue, title="Media Base")
// Dibujar Parabolic SAR
plot(psar, style=plot.style_circles, color=color.orange, title="Parabolic SAR")