牛市追跡システム

作者: リン・ハーンチャオチャン,日付: 2024-01-31 11:01:45
タグ:

img

概要

ブルマーケット・トラッキング・システム (Bull Market Tracking System) は,トレンド・トラッキングをベースとした機械的な取引システムである. 4時間チャート上のトレンド・インジケーターを使用して,トレード・シグナルをフィルタリングし,エントリー決定は15分チャートのインジケーターに基づいて行われます.主なインジケーターには,RSI,ストキャスティックス,MACDが含まれます.このシステムの利点は,複数のタイムフレームの組み合わせが誤ったシグナルを効果的にフィルタリングすることができ,短いタイムフレームのインジケーターはより正確なエントリータイミングを特定できるということです.しかし,このシステムにはオーバートレードや誤ったブレイクアウトの問題などのいくつかのリスクもあります.

原則

このシステムの基本的な論理は,トレンド方向とエントリータイミングを特定するために,異なるタイムフレームからの指標を組み合わせることです.特に,4時間のチャート上のRSI,ストーキャスティックス,EMAは,全体的なトレンド方向を決定するために一致する必要があります. これにより,騒音のほとんどを効果的にフィルタリングできます.同時に,15分チャート上のRSI,ストーキャスティックス,MACD,EMAは,正確なエントリータイミングを決定するために,上昇または下落バイアスについて合意する必要があります. これにより,良いエントリーと出口点を見つけることができます. 4時間および15分間のタイムフレームの両方の判断が基準を満たす場合にのみ,システムは取引信号を生成します.

利点

  1. 複数のタイムフレームの組み合わせは,誤った信号を効果的にフィルタリングし,主要な傾向を特定することができます
  2. 15分間の詳細な指標は,比較的正確なエントリータイミングを捉えることができます
  3. RSI,ストキャスティックス,MACDなどのメインストリーム技術指標の組み合わせは,理解し最適化することが容易です.
  4. 個々の取引のリスクを効果的に制御するために,利益,ストップ・ロース,トライリング・ストップ・ロースなど,厳格なリスク管理方法が採用されます.

リスク

  1. 過剰取引リスク. システムは短期的な時間枠に非常に敏感で,過剰取引につながる多くの取引信号を生成することがあります.
  2. 誤ったブレイクリスク 短期指標の判断は誤りになり,誤ったブレイクシグナルが生じる可能性があります
  3. インディケーターの失敗リスク テクニカルインディケーター自体には一定の限界があり,極端な市場状況下で失敗する可能性があります

したがって,システムは次の側面から最適化することができます.

  1. 異なる市場環境に適するように指標パラメータを調整する
  2. 取引頻度を減らすためにフィルター条件を増やし,過剰取引を防ぐ
  3. ストップ・プロフィットとストップ・ロスの戦略を最適化し,市場の変動範囲に適した
  4. 最適な解決法を見つけるために異なる指標の組み合わせをテストする

概要

ブルマーケット・トラッキング・システムは,機械的な取引システムに従う非常に実践的なトレンドです.市場動向と主要なエントリータイミングを特定するために,マルチタイムフレーム指標の組み合わせを使用します.合理的なパラメータ設定と継続的な最適化テストにより,システムはほとんどの市場環境に適応し,安定した利益を達成することができます.しかし,我々は潜在的なリスクのいくつかを認識し,これらのリスクを予防および軽減するために積極的な措置をとらなければなりません.


/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("Cowabunga System from babypips.com", overlay=true)
// 4 Hour Stochastics
length4 = input(162, minval=1, title="4h StochLength"), smoothK4 = input(48, minval=1, title="4h StochK"), smoothD4 = input(48, minval=1, title="4h StochD")
k4 = sma(stoch(close, high, low, length4), smoothK4)
d4 = sma(k4, smoothD4)

//15 min Stoch
length = input(10, minval=1, title="15min StochLength"), smoothK = input(3, minval=1, title="15min StochK"), smoothD = input(3, minval=1, title="15min StochD")
k = sma(stoch(close, high, low, length), smoothK)
d= sma(k, smoothD)

//4 hour RSI
src1 = close, len1 = input(240, minval=1, title="4H RSI Length")
up1 = rma(max(change(src1), 0), len1)
down1 = rma(-min(change(src1), 0), len1)
rsi4 = down1 == 0 ? 100 : up1 == 0 ? 0 : 100 - (100 / (1 + up1 / down1))

//15 min RSI
src = close, len = input(9, minval=1, title="15M RSI Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi15 = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

//MACD Settings
source = close
fastLength = input(12, minval=1, title="MACD Fast"), slowLength=input(26,minval=1, title="MACD Slow")
signalLength=input(9,minval=1, title="MACD Signal")
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
macd = fastMA - slowMA
signal = ema(macd, signalLength)

// Stops and Profit inputs
inpTakeProfit   = input(defval = 1000, title = "Take Profit", minval = 0)
inpStopLoss     = input(defval = 0, title = "Stop Loss", minval = 0)
inpTrailStop    = input(defval = 400, title = "Trailing Stop", minval = 0)
inpTrailOffset  = input(defval = 0, title = "Trailing Stop Offset", minval = 0)

// Stops and Profit Targets
useTakeProfit   = inpTakeProfit  >= 1 ? inpTakeProfit  : na
useStopLoss     = inpStopLoss    >= 1 ? inpStopLoss    : na
useTrailStop    = inpTrailStop   >= 1 ? inpTrailStop   : na
useTrailOffset  = inpTrailOffset >= 1 ? inpTrailOffset : na

//Specific Time to Trade
myspecifictradingtimes = input('0500-1600', title="My Defined Hours")

longCondition1 = time(timeframe.period, myspecifictradingtimes) != 0
longCondition2 = rsi4 <= 80
longCondition3 = k4 >= d4 and k4 <= 80
longCondition4 = ema(close, 80) >= ema(close, 162)
allLongerLongs = longCondition1 and longCondition2 and longCondition3 and longCondition4

longCondition5 = rsi15 <= 80
longCondition6 = k >= d and k <= 80 and fastMA >= slowMA
longCondition7 = ema(close, 5) >= ema(close, 10)
allLongLongs = longCondition5 and longCondition6 and longCondition7

if crossover(close, ema(close, 5)) and allLongerLongs and allLongLongs
    strategy.entry("Long", strategy.long, comment="LongEntry")

shortCondition1 = time(timeframe.period, myspecifictradingtimes) != 0
shortCondition2 = rsi4 >= 20
shortCondition3 = k4 <= d4 and k4 >= 20
shortCondition4 = ema(close, 80) <= ema(close, 162)
allShorterShorts = shortCondition1 and shortCondition2 and shortCondition3 and shortCondition4

shortCondition5 = rsi15 >= 20
shortCondition6 = k <= d and k >= 20 and fastMA <= slowMA
shortCondition7 = ema(close, 5) <= ema(close, 10)
allShortShorts = shortCondition5 and shortCondition6 and shortCondition7

if crossunder(close, ema(close,5)) and allShorterShorts and allShortShorts
    strategy.entry("Short", strategy.short, comment="ShortEntry")

strategy.exit("Exit Long", from_entry = "Long", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)
strategy.exit("Exit Short", from_entry = "Short", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)

もっと