
공간 지향 가격 역전 전략은 가격 통로 중심선을 계산하여 가격 변동의 경향 방향을 판단한다. 가격이 통로 중심선에 가까워질 때, 더 많이 또는 더 적게 할 신호를 낸다. 이 전략은 여러 필터링 조건을 결합하여 높은 확률의 거래 기회를 찾는다.
이 전략의 핵심 지표는 가격 채널 중앙선이다. 계산 방법은 최근 30 K 선의 최고 가격과 최저 가격의 평균을 취하는 것이다. 낮은 지점이 중심선보다 높을 때 상승 추세로 간주하고, 높은 지점이 중심선보다 낮을 때 하락 추세로 간주한다.
전략은 트렌드 배경이 변할 때만 거래 신호를 냅니다. 즉, 상승 배경에서는 K 선이 빨간색으로 변할 때만 공백을 둡니다. 하락 배경에서는 K 선이 녹색으로 변할 때만 더 많은 것을 합니다.
또한, 전략은 이중 필터링 조건을 설정합니다. 개체 필터링과 가격 채널 바 필터링. 개체 부피가 평균의 20% 이상일 때만 신호를 유발합니다. 필터링 사이클 내에 연속적인 트렌드 신호가 있어야 포지션을 열 수 있습니다.
이 전략은 트렌드, 가치 지역, K선 형태를 결합하여 매우 효율적인 역전 거래 전략이다. 주요 장점은 다음과 같다:
이 전략의 주요 위험은 가격 반전 지점을 놓치고 신호를 기다리지 않는 것입니다. 다음과 같은 방법으로 최적화 할 수 있습니다:
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
공간 지향 가격 역전 전략은 가격 통로를 판단하여 역전 시점을 설정하여 듀얼 필터링 조건을 설정하여 고품질의 신호를 생성한다. 파라미터 조정 및 풍선 제어에 기반하여 신뢰할 수있는 양적 전략이다.
/*backtest
start: 2023-11-19 00:00:00
end: 2023-11-26 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2018
//@version=2
strategy(title = "Noro's PriceChannel for D1 v1.0", shorttitle = "PriceChannel D1", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100.0, pyramiding = 0)
//Settings
needlong = input(true, "long")
needshort = input(true, "short")
slowlen = input(30, defval = 30, minval = 2, maxval = 200, title = "PriceChannel Period")
pcbars = input(1, defval = 1, minval = 1, maxval = 20, title = "PriceChannel Bars")
usecol = input(true, "Use color-filter")
usebod = input(true, "Use body-filter")
needbg = input(false, defval = false, title = "Need trend 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")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
src = close
//PriceChannel
lasthigh = highest(src, slowlen)
lastlow = lowest(src, slowlen)
center = (lasthigh + lastlow) / 2
//Trend
ub = low > center ? 1 : 0
db = high < center ? 1 : 0
trend = sma(ub, pcbars) == 1 ? 1 : sma(db, pcbars) == 1 ? -1 : trend[1]
//Body
body = abs(close - open)
abody = sma(body, 10)
//Signals
up = trend == 1 and (close < open or usecol == false) and (body > abody / 5 or usebod == false)
dn = trend == -1 and (close > open or usecol == false) and (body > abody / 5 or usebod == false)
//Lines
plot(center, color = blue, linewidth = 3, transp = 0, title = "PriceChannel Center")
//Background
col = needbg == false ? na : trend == 1 ? lime : red
bgcolor(col, transp = 80)
//Trading
if up
strategy.entry("Long", strategy.long, needlong == false ? 0 : na, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
if dn
strategy.entry("Short", strategy.short, needshort == false ? 0 : na, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
if time > timestamp(toyear, tomonth, today, 23, 59)
strategy.close_all()