ノロバンドのモメンタムポジション戦略

作者: リン・ハーンチャオチャン,日付: 2024-01-18 10:58:48
タグ:

img

概要

この戦略は,Noroのバンド理論と定量的なテクニックを組み合わせてモメンタムブレークアウト戦略を形成する.バンドブレークアウト取引を実装するために,移動平均値,RSI,バンド,カラーバー,その他の指標を計算して取引信号を生成する.

戦略の論理

  1. 上部と下部帯を平均本値帯を用いて計算する. 上部帯を突破する価格は長い信号を示し,下部帯を突破する場合は短い信号を示します.
  2. RSI インディケーターを使用して,過剰購入と過剰販売のゾーンを決定します. RSI 30以下はロングを示し,70以上はショートを示します.
  3. 最低値と最低値の割引は,価格の動向方向を示します.
  4. 色のバーは上昇市場または下落市場を示します.緑は長期の牛市場を意味し,赤は短期の熊市場を意味します.
  5. 移動平均を組み合わせて,取引信号の差異を特定する.

利点

  1. 複数の指標を組み合わせることで 精度が向上します
  2. バンド理論と定量技術を組み合わせることで 戦略はより効果的になります
  3. モメントブレイクと平均逆転取引を組み合わせることで 利益の余地が広がります
  4. 市場に応じてパラメータを調整する高度な拡張性

リスク

  1. パラメータは常に最適化され テストが必要です
  2. 長短スイッチに 間に合わないので 損失を 引き起こす可能性があります
  3. 高い取引頻度で,手数料やスライプによって容易に影響を受ける.
  4. パラメータは,異なるサイクルに合わせて適度に調整する必要があります.

最適化

  1. 最適なパラメータの組み合わせを見つけるため,複数のタイムフレームを検証します.
  2. 単一の損失を減らすためにストップ損失を追加します.
  3. 利益効率を向上させるため ポジション管理を拡大する
  4. 自動パラメータ最適化のために ディープラーニングを組み合わせます

概要

この戦略は,モメンタムと平均逆転指標を通じて効果的な利益を達成するために典型的な定量指標を組み合わせます.また,合理的なエントリーポイントを特定するために平均真の範囲理論を使用します.理論と技術を組み合わせる良い例です.パラメータ最適化とリスク管理の改善により,効率的で安定した定量戦略になります.


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


//@version=2
strategy("Noro's Bands Strategy v1.5", shorttitle = "NoroBands str 1.5", overlay=true)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
len = input(20, defval = 20, minval = 2, maxval = 200, title = "Period")
color = input(true, defval = true, title = "Use ColorBar")
usecb = input(true, defval = true, title = "Use CryptoBottom")
usersi = input(true, defval = true, title = "Use RSI")
usemm = input(true, defval = true, title = "Use min/max")
usepyr = input(true, defval = true, title = "Use pyramiding")
needbb = input(false, defval = false, title = "Show Bands")
needbg = input(false, defval = false, title = "Show Background")
needlo = input(false, defval = false, title = "Show Locomotive")
needpy = input(false, defval = false, title = "Show Avg.price line")
src = close

//Fast RSI
fastup = rma(max(change(src), 0), 2)
fastdown = rma(-min(change(src), 0), 2)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))

//CryptoBottom
mac = sma(close, 10)
lencb = abs(close - mac)
sma = sma(lencb, 100)
max = max(open, close)
min = min(open, close)

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

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

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

//Signals
up = trend == 1 and ((close < open or color == false) or close < hd) and (min < min[1] or usemm == false) and (close < strategy.position_avg_price or usepyr == false or strategy.position_size <= 0) ? 1 : 0
dn = trend == -1 and ((close > open or color == false) or close > ld) and (max > max[1] or usemm == false) and (close > strategy.position_avg_price or usepyr == false or strategy.position_size >= 0) ? 1 : 0 
up2 = close < open and lencb > sma * 3 and min < min[1] and fastrsi < 10 and (close < strategy.position_avg_price or usepyr == false or strategy.position_size <= 0) ? 1 : 0 //CryptoBottom
//dn2 = close > open and len > sma * 3 and max > max[1] and fastrsi > 90 ? 1 : 0 //CryptoBottom
up3 = fastrsi < 5 and usersi == true and (close < strategy.position_avg_price or usepyr == false or strategy.position_size <= 0) ? 1 : 0
//dn3 = fastrsi > 95 and usersi = true ? 1 : 0

//Avg Price
colpy = needpy == false ? na : black
plot(strategy.position_avg_price, color = colpy)

up4 = close < strategy.position_avg_price and usepyr == true and strategy.position_size >= 0 ? 1 : 0 
dn4 = close > strategy.position_avg_price and usepyr == true and strategy.position_size <= 0 ? 1 : 0 

//Locomotive
uploco = trend == 1 and close < open and min < min[1] and close < center ? 1 : 0
plotarrow(needlo == true and uploco == 1 ? 1 : 0, colorup = black, colordown = black, transp = 0)

longCondition = up == 1 or (up2 == 1 and usecb == true) or (up3 == 1 and usersi == true) or up4 == 1
if (longCondition)
    strategy.entry("Long", strategy.long, needlong == false ? 0 : na)

shortCondition = dn == 1 or dn4 == 1
if (shortCondition)
    strategy.entry("Short", strategy.short, needshort == false ? 0 : na)

もっと