
この戦略は,ダイナミックチャネルと均線のトレンド追跡原理に基づいて設計されている.これは,価格のダイナミックチャネルを計算し,チャネルの上下軌道によって価格トレンドの方向を判断し,均線フィルター価格散度と組み合わせて取引シグナルを生成する.この戦略は,中短線トレンド取引に適用されます.
この戦略は以下の原則に基づいています.
ダイナミック価格チャネルを計算する.チャネルの中線は,最高価格と最低価格を計算し,チャネルの上線は中線+価格分散度平均線,下線は中線-価格分散度平均線である.
トレンドの方向を判断する。上線を踏むとき,看板と定義する;下線を踏むとき,下落と定義する。
波騒音 特定の周期の価格分散度平均線を使用し,波価格のランダムな波動による騒音
取引シグナルを生成する.看板の場合,その周期の閉盘価格が開盘価格より低いときに買取シグナルを生成する.看板の場合,その周期の閉盘価格が開盘価格より高いときに売出シグナルを生成する.
この戦略の利点は以下の通りです.
この戦略には以下のリスクもあります.
対応方法:
この戦略は以下の点で最適化できます.
この戦略は,ダイナミックチャネルと均線トレンド判断を統合した考えで,中短線捕捉トレンド方向においてよく機能している.しかし,また,一定の制限があり,より多くの市場状況に対応するためにさらなるテストと最適化が必要である.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
strategy("Noro's Bands Strategy v1.0", shorttitle = "NoroBands str 1.0", 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")
len = input(20, defval = 20, minval = 2, maxval = 200, title = "Period")
color = input(true, "Color")
needbb = input(false, defval = false, title = "Show Bands")
needbg = input(false, defval = false, title = "Show Background")
src = close
//PriceChannel 1
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
//Trend
trend = close < ld and high < hd ? -1 : close > hd and low > ld ? 1 : trend[1]
//Lines
colo = needbb == false ? na : black
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")
//Background
col = needbg == false ? na : trend == 1 ? lime : red
bgcolor(col, transp = 90)
//up = and trend == 1 ? 1 : 0
//dn = and trend == -1 ? 1 : 0
up = close < hd and trend == 1 and (close < open or color == false) ? 1 : 0
dn = close > ld and trend == -1 and (close > open or color == false) ? 1 : 0
longCondition = up == 1
if (longCondition)
strategy.entry("Long", strategy.long, needlong == false ? 0 : na)
shortCondition = dn == 1
if (shortCondition)
strategy.entry("Short", strategy.short, needshort == false ? 0 : na)