モメントブレイク・トレード戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-18 21:28:22
タグ:

概要

この戦略は,動力指標ブリーンの帯を介してブレイク取引を行い,主に価格がブリーンの帯を突破するか否かを判断し,買い売り信号を発信します.

原則

この戦略は主にブリンズ帯指標の傾向判断方向に基づいている.ブリンズ帯は移動平均線とその標準差で構成される帯状区域である.ブリンズ帯の中央線はn日移動平均線であり,上向きは中央線+2倍標準差,下向きは中央線+2倍標準差である.価格は上向きに近づくとオーバーバイ,下向きに近づくとオーバーセールである.

具体的には,戦略は,まずn日間の最高価格,最低価格を計算し,中間価格を計算する (最高価格+最低価格) /2);その後,閉店価格と中間価格の距離加重移動平均を計算し,ブリンズ帯の中央線を構成し,中央線に2倍もの標準差を足して,上下線を構成する.

閉店価格が上線を突破した場合,上昇傾向を示し,下線を突破した場合,下線傾向を示します.

さらに,戦略は反向開場メカニズムも導入した.価格がブリンズ帯を突破して軌道に乗ると,MACDが下落している場合,反向市場操作を空にする.

利点

  1. ブリン帯を用いてトレンド方向を判断し,一定のトレンド追跡能力を有する.

  2. 逆向投資は,逆向投資で利益を得ることができます.

  3. ブリン帯周期,標準差倍数などのパラメータをカスタマイズし,異なる周期への取引に適応できます.

  4. リスクを減らすため,逆向の開設を閉鎖できます.

リスクと対策

  1. ブリンズ帯は,しばしば高波動性のある株式に使用され,周期長資源や指数などの品種には適さない可能性がある.

  2. 突破信号は偽突破が発生する可能性があります. 他の要因と組み合わせてシグナルをフィルターすることができます.

  3. 逆向入札は損失をさらに拡大させる可能性がある.逆向入札モジュールを閉鎖することができます.

  4. 撤回は大きいかもしれない. ポジションの規模は適切に調整できます.

優化方向

  1. 市場が不安定な方向に動いていることを避けるために,トレンドフィルターを追加することを検討してください.

  2. ブリンズ帯標準差の倍数をテストして,より適切なパラメータを探します.

  3. 損失を抑えるために,停止損失戦略を導入できます.

  4. 取引信号がより明確になるように,開場と加仓の論理を最適化できます.

概要

この戦略は,価格傾向の破綻を判断するためにブリンズ帯の基礎指標を用いて取引する.単純なパラメータ設定を使用して基本的なトレンド追跡戦略を実現することができる.しかし,特定の破綻リスクが存在し,他の指標と協力してフィルタリングする必要がある.パラメータ設定,停止損失戦略などのリスクを制御するためにさらに最適化することができる.

概要

この戦略では,ブレイクアウト取引の際にボリンジャーバンドスモメントインジケーターを使用し,主に価格がトレード信号の上下ボリンジャーバンドスを通過するかどうかを判断します.

原則

戦略は主にトレンド方向を決定するためのボリンジャーバンド指標に基づいている.ボリンジャーバンドは,移動平均値と標準偏差によって定義される上下帯をベースとした中間帯で構成される.中間帯はn期移動平均値,上部帯は中間帯+2標準偏差,下部帯は中間帯−2標準偏差である.価格が上部帯に近づくと過買い状態を示し,下部帯に近づくと過売り状態をシグナルする.

特に,この戦略は,最初に過去 n 期間の最高値と最低値,そして中間値 ((最高値 + 最低値) /2) を計算し,その後,閉値と中間値間の距離を計算し,中間帯を形成するために距離の指数関数移動平均を使用し,上と下の標準偏差の 2 倍を足し/減算して上と下の帯を形成します.

閉じる価格が上帯を突破すると上昇傾向が示され,下帯を突破すると下降傾向が示される.上帯が突破されたときストラテジーは長くなり,下帯が突破されたときショートになる.

さらに,この戦略には反トレンドメカニズムが含まれています.価格が上部帯を突破し,MACDが下がっている場合,反トレンドショートポジションを取ります.

利点

  1. 傾向の方向性を決定するためにボリンジャーバンドを使用すると,特定の傾向を追跡する能力が提供されます.

  2. 逆トレンドデザインは逆転から利益を得ることを可能にします

  3. 期間や標準偏差の倍数のような 調整可能なパラメータにより 異なる取引期間に対応できます

  4. リスクを減らすために反トレンド取引を無効にする.

リスクと緩和策

  1. ボリンガー帯は,高波動性株で最適で,安定した商品やインデックスには適していない可能性があります.異なる期間のパラメータをテストできます.

  2. ブレイクシグナルには 偽ブレイクシグナルがある

  3. 逆トレンド取引は損失をさらに増加させ 逆トレンドモジュールを無効にすることができます

  4. 引き下げは大きく ポジションのサイズを調整できる

増進 の 機会

  1. 傾向フィルターを追加すると,非指向市場でのウィップソウを回避できます.

  2. 最適パラメータを見つけるために 異なる標準偏差倍数をテストする.

  3. ストップ・ロスは単一のトレード・ロスを制御するために含まれます.

  4. より明確な取引信号のためにエントリーとアドオンロジックを最適化します

概要

この戦略は,ボリンジャーバンドを主要指標として使用し,トレンドブレイクに基づいた取引を行います. シンプルなパラメータにより,基本的なトレンドフォロー機能を提供します. しかし,偽ブレイクリスクは存在し,追加のフィルターが必要です. パラメータ,ストップ損失,リスク制御は強化できます. 全体的に,合理的なベースラインブレイク戦略として機能します.


/*backtest
start: 2023-08-18 00:00:00
end: 2023-09-17 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2018

//@version=2
strategy("Noro's Bands Scalper Strategy v1.6", shorttitle = "Scalper str 1.6", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100.0, pyramiding = 0)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
takepercent = input(0, defval = 0, minval = 0, maxval = 1000, title = "take, %")
needbe = input(true, defval = true, title = "Bands Entry")
needct = input(false, defval = false, title = "Counter-trend entry")
bodylen = input(10, defval = 10, minval = 0, maxval = 50, title = "Body length")
trb = input(1, defval = 1, minval = 1, maxval = 5, title = "Trend bars")
len = input(20, defval = 20, minval = 2, maxval = 200, title = "Period")
needbb = input(true, defval = true, title = "Show Bands")
needbg = input(true, defval = true, title = "Show Background")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
src = close

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

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

//Trend
chd = close > hd
cld = close < ld
uptrend = trb == 1 and chd ? 1 : trb == 2 and chd and chd[1] ? 1 : trb == 3 and chd and chd[1] and chd[2] ? 1 : trb == 4 and chd and chd[1] and chd[2] and chd[3] ? 1 : trb == 5 and chd and chd[1] and chd[2] and chd[3] and chd[4] ? 1 : 0
dntrend = trb == 1 and cld ? 1 : trb == 2 and cld and cld[1] ? 1 : trb == 3 and cld and cld[1] and cld[2] ? 1 : trb == 4 and cld and cld[1] and cld[2] and cld[3] ? 1 : trb == 5 and cld and cld[1] and cld[2] and cld[3] and cld[4] ? 1 : 0
trend = dntrend == 1 and high < center ? -1 : uptrend == 1 and low > center ? 1 : trend[1]

//trend = close < ld and high < center ? -1 : close > hd and low > center ? 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 1")
plot(center, color = colo, linewidth = 1, transp = 0, title = "center")
plot(ld, color = colo, linewidth = 1, transp = 0, title = "Low band 1")
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)

//Body
body = abs(close - open)
smabody = ema(body, 30) / 10 * bodylen

//Signals
bar = close > open ? 1 : close < open ? -1 : 0
up7 = trend == 1 and ((bar == -1 and bar[1] == -1) or (body > smabody and bar == -1)) ? 1 : 0
dn7 = trend == 1 and ((bar == 1 and bar[1] == 1) or (close > hd and needbe == true)) and close > strategy.position_avg_price * (100 + takepercent) / 100 ? 1 : 0
up8 = trend == -1 and ((bar == -1 and bar[1] == -1) or (close < ld2 and needbe == true)) and close < strategy.position_avg_price * (100 - takepercent) / 100 ? 1 : 0
dn8 = trend == -1 and ((bar == 1 and bar[1] == 1) or (body > smabody and bar == 1)) ? 1 : 0

if up7 == 1 or up8 == 1 
    strategy.entry("Long", strategy.long, needlong == false ? 0 : trend == -1 and needct == false ? 0 : na, when=(time > timestamp(fromyear, frommonth, 01, 00, 00) and time < timestamp(toyear, tomonth, 31, 00, 00)))

if dn7 == 1 or dn8 == 1
    strategy.entry("Short", strategy.short, needshort == false ? 0 : trend == 1 and needct == false ? 0 : na, when=(time > timestamp(fromyear, frommonth, 01, 00, 00) and time < timestamp(toyear, tomonth, 31, 00, 00)))
    
if time > timestamp(toyear, tomonth, 31, 00, 00)
    strategy.close_all()

もっと