
이 전략은 동적 채널과 평평선의 트렌드 추적 원리에 기초하여 설계되었다. 가격의 동적 채널을 계산하고, 채널의 오르락 내리락을 통해 가격 트렌드 방향을 판단하고, 평평선 필러브 가격 분산과 결합하여 거래 신호를 생성한다. 이 전략은 중단계 트렌드 거래에 적합하다.
이 전략은 다음과 같은 원칙에 기초하고 있습니다.
동적 가격 채널을 계산한다. 최상위 가격과 최저 가격으로 채널의 중선을 계산한다. 채널 상단 궤도는 중간선 + 가격 분산도 평균선, 하단 궤도는 중간선 - 가격 분산도 평균선이다.
트렌드 방향을 판단한다. 가격이 상단 궤도에 오르면 부진으로 정의되고, 가격이 하단 궤도에 오르면 하락으로 정의된다.
波噪音. 일정 주기간의 가격 분산도 평균선을 사용하여, 波價格隨機波動에 의한噪音.
거래 신호를 생성한다. 부진할 때, 해당 주기 종전 가격이 개시 가격보다 낮을 때 구매 신호를 생성한다. 하락할 때, 해당 주기 종전 가격이 개시 가격보다 높을 때 판매 신호를 생성한다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 다음과 같은 위험도 있습니다.
대응방법:
이 전략은 다음과 같은 측면에서 최적화될 수 있습니다.
이 전략은 동적 통로와 평선 경향 판단을 통합한 아이디어로, 중·단선에서 트렌드 방향을 잡는 데 좋은 성능을 발휘한다. 그러나 또한 한계가 있으며, 더 많은 시장 상황에 적응하기 위해 추가 테스트 및 최적화가 필요합니다.
/*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)