突破戦略

作者: リン・ハーンチャオチャン開催日:2024年1月24日11時01分
タグ:

img

概要

フォースブレークスルー戦略 (Force Breakthrough Strategy) は,移動平均値と相対強度指数 (RSI) をベースとした定量的な取引戦略である.主要移動平均値の価格ブレークスルーをモニターし,RSI指標を使用してエントリーシグナルを決定することによって市場のトレンド方向性を検出する.主なアイデアは,価格が移動平均値に突入したとき,RSI指標のオーバーバイト/オーバーセールシグナルと組み合わせて取引シグナルを発行することである.

戦略の論理

フォースブレークスルー戦略は,移動平均を2つ採用する.第"は,高速移動平均として10期間のEMAである.第2は,スロームービング平均として200期間のEMAである.高速線は現在の価格傾向を表し,スローラインは長期の価格傾向を表す.価格が上昇して10日線を超えると,それは上昇信号である.価格が落ちて10日線を下に突入すると,それは下落信号である.

この戦略は,特定のエントリー瞬間を決定するために,RSIインジケーターも組み込む.価格が上昇傾向にあり,RSIの低点が高速移動平均を下回ると (RSIが5を下回ると),ロングシグナルが起動する.価格が低下傾向にあり,RSIの高点が高速移動平均を下回ると (RSIが95を超えると),ショートシグナルが起動する.

ロング/ショートポジションを取った後のストップロスの原則は,価格が10日間の移動平均を再び破った場合,ポジションを退場することです.

利点分析

この戦略の最大の利点は,強いトレンドフォロー能力である.移動平均値自体はトレンド判断機能が優れたものである.この戦略は,速い線が短期トレンドを判断し,遅い線が長期トレンドを判断する速い線の強みを完全に利用している.速い線がスローラインの上向きの浸透性を有すると,短期的および長期的上昇トレンドの両方を示す.これは強力な購入信号である.

RSIインジケーターの追加は,戦略の優位性も高めます.RSIの高低点を組み合わせることで,過剰購入または過剰販売状況が発生した場合に効果的に取引信号を発信することができ,潜在的な逆転点への参加が実際のパフォーマンスを改善することができます.

リスク分析

戦略は比較的強いトレンド追跡能力を有しているが,いかなる技術指標戦略も完全に損失を回避することはできません.

  1. 価格が急激に変動すると 移動平均値から生じる取引信号が遅れる可能性があります

  2. RSIインジケーターは,誤ったトレード信号判断を引き起こす可能性のある差異に傾向があります.

  3. 長期運用における不適切なパラメータは 過剰な取引につながる可能性があります

リスクを軽減するために,移動平均値やRSIのようなパラメータを調整し最適化し,ストップ・ロスの範囲を合理的に緩め,ポジションサイズを適切に制御することができます.最適化されたパラメータ組み合わせは検証のために徹底的にバックテストする必要があります.

オプティマイゼーションの方向性

戦略をさらに最適化できる余地があり,主に以下に焦点を当てています.

  1. 柔軟性を高めるため,市場変動に基づいてパラメータを自動的に調整するために,適応性のある移動平均値を追加します.

  2. ボリンジャー帯のような波動性指標を組み込み 激しい市場価格変動に対応します

  3. 機械学習アルゴリズムをAIトレーニングを通じて 増やして パラメータコンボや 取引ルールを改善して 自動化を実現します

  4. 試験サンプルを多市場ポートフォリオに拡大し,市場間での有効性を検証する.

  5. マクロ政策,重大イベントなどに基づく基本分析モジュールを導入し,戦略決定を支援する.

概要

フォース・ブレークスルー戦略は,実践的な移動平均ベースの戦略である. 急速な移動平均と遅い移動平均の価格浸透によってトレンドを判断し,RSI指標の助けで正確に市場に参入する. この組み合わせは,移動平均と過剰購入/過剰販売指標の強みを完全に活用する. 戦略は,安定したリターンと制御可能なリスクを持つさまざまな市場で検証されている. これは推奨される定量的な取引戦略である.さらなる最適化は戦略のパフォーマンスを向上させる可能性がある.


/*backtest
start: 2024-01-16 00:00:00
end: 2024-01-23 00:00:00
period: 30m
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/
// © JoseMetal
//@version=5

//== Constantes
c_blanco              = color.rgb(255, 255, 255, 0)
c_negro               = color.rgb(0, 0, 0, 0)
c_amarillo_radiactivo = color.rgb(255, 255, 0, 0)
c_cian_radiactivo     = color.rgb(0, 255, 255, 0)
c_verde_radiactivo    = color.rgb(0, 255, 0, 0)
c_verde               = color.rgb(0, 128, 0, 0)
c_verde_oscuro        = color.rgb(0, 80, 0, 0)
c_rojo_radiactivo     = color.rgb(255, 0, 0, 0)
c_rojo                = color.rgb(128, 0, 0, 0)
c_rojo_oscuro         = color.rgb(80, 0, 0, 0) 
c_naranja_oscuro      = color.rgb(200, 120, 0, 0)
noneColor             = color.new(color.white, 100)
max_float             = 10000000000.0



//== Funciones

//== Declarar estrategia y período de testeo
strategy("Estrategia Larry Connors", shorttitle="Estrategia Larry Connors", overlay=true)
fecha_inicio     = input(timestamp("1 Jan 2000"), title="• Fecha de inicio", group="Período de pruebas", inline="periodo_de_pruebas")
vela_en_fecha    = true
posicion_abierta = strategy.position_size != 0
LONG_abierto     = strategy.position_size > 0
SHORT_abierto    = strategy.position_size < 0

GRUPO_P           = "Posiciones"
P_permitir_LONGS  = input.bool(title="LONGS", group=GRUPO_P, defval=true, inline="posiciones")
P_permitir_SHORTS = input.bool(title="SHORTS", group=GRUPO_P, defval=true, inline="posiciones")

GRUPO_general = "General"
mostrar_color_velas = input.bool(title="Colorear velas", defval=true, group=GRUPO_general)



//== Inputs de indicadores
// Medias móviles simples
GRUPO_SMAs = "SMAs"
SMA_1_fuente = input.source(title="• (Media de salida) Fuente / Long.", group=GRUPO_SMAs, defval=close, inline="sma_1")
SMA_1_length = input.int(title="", group=GRUPO_SMAs, defval=10, minval=1, inline="sma_1")
SMA_2_fuente = input.source(title="• (Media tendencial) Fuente / Long.", group=GRUPO_SMAs, defval=close, inline="sma_2")
SMA_2_length = input.int(title="", group=GRUPO_SMAs, defval=200, minval=1, inline="sma_2")
SMA_1        = ta.ema(SMA_1_fuente, SMA_1_length)
SMA_2        = ta.ema(SMA_2_fuente, SMA_2_length)

// RSI
GRUPO_RSI    = "RSI"
RSI_src      = input.source(title="• Fuente / Longitud", group=GRUPO_RSI, defval=close, inline="rsi_calc")
RSI_length   = input.int(title="", group=GRUPO_RSI, defval=2, minval=1, inline="rsi_calc")
RSI          = ta.rsi(RSI_src, RSI_length)
RSI_nivel_os = input.int(title="• Sobreventa / Sobrecompra", group=GRUPO_RSI, defval=5, minval=0, maxval=99, inline="rsi_niveles")
RSI_nivel_ob = input.int(title="", group=GRUPO_RSI, defval=95, minval=1, maxval=100, inline="rsi_niveles")


//== Cálculo de condiciones
cierre_sobre_SMA_1 = close > SMA_1
tendencia_alcista  = close > SMA_2
RSI_en_sobreventa  = RSI < RSI_nivel_os
RSI_en_sobrecompra = RSI > RSI_nivel_ob



//== Entrada (deben cumplirse todas para entrar)
LONG_condition_1    = tendencia_alcista
LONG_condition_2    = not cierre_sobre_SMA_1 // Vela con cierre bajo la media rápida
LONG_condition_3    = RSI_en_sobreventa[1] and not RSI_en_sobreventa // Sobreventa en la vela anterior y ya no en la actual
all_LONG_conditions = LONG_condition_1 and LONG_condition_2 and LONG_condition_3
entrar_en_LONG      = P_permitir_LONGS and all_LONG_conditions and vela_en_fecha and not LONG_abierto

SHORT_condition_1    = not tendencia_alcista
SHORT_condition_2    = cierre_sobre_SMA_1 // Vela con cierre sobre la media rápida
SHORT_condition_3    = RSI_en_sobrecompra[1] and not RSI_en_sobrecompra // Sobrecompra en la vela anterior y ya no en la actual
all_SHORT_conditions = SHORT_condition_1 and SHORT_condition_2 and SHORT_condition_3
entrar_en_SHORT      = P_permitir_SHORTS and all_SHORT_conditions and vela_en_fecha and not SHORT_abierto

if (entrar_en_LONG)
    strategy.entry("Abrir Long", strategy.long)

if (entrar_en_SHORT)
    strategy.entry("Abrir Short", strategy.short)



//== Salida
exit_LONG_conditions  = cierre_sobre_SMA_1
exit_SHORT_conditions = not cierre_sobre_SMA_1


if (LONG_abierto and exit_LONG_conditions)
    strategy.close("Abrir Long")

if (SHORT_abierto and exit_SHORT_conditions)
    strategy.close("Abrir Short")


//== Ploteo en pantalla
// SMAs
plot(SMA_1, "Media de salida", color=color.aqua, linewidth=2)
plot(SMA_2, "Media tendencial", color=tendencia_alcista ? color.green : color.red, linewidth=4)

// Color de fondo
bgcolor = entrar_en_LONG ? color.new(color.green, 85) : entrar_en_SHORT ? color.new(color.red, 85) : color.new(color.black, 100)
bgcolor(bgcolor)

// Color de las velas según sobrecompra/sobreventa del RSI
color_velas = mostrar_color_velas ? (RSI_en_sobreventa ? #00a800 : RSI_en_sobrecompra ? #ca0000 : na) : na
barcolor(color_velas)


もっと