이 글은 동적 가격 통로를 기반으로 한 단선 거래 전략을 소개한다. 이 전략은 가격의 동적 통로를 계산하여 트렌드 방향을 판단하고 통로 돌파구에서 거래한다.
이 전략은 다음과 같은 원칙에 기초하고 있습니다.
최고 가격과 최저 가격을 사용하여 동적 가격 채널을 계산한다. 채널 상단 라인은 최고 가격과 채널 중간에 있는 라인의 절반, 하단 라인은 최저 가격과 채널 중간에 있는 라인의 절반이다.
가격이 경로를 돌파할 때, 상향 트렌드에 진입하는 것을 나타냅니다. 가격이 경로를 돌파할 때, 하향 트렌드에 진입하는 것을 나타냅니다.
상승 추세에서, 두 개의 연속阴线이 나타났을 때 더 많이; 하향 추세에서, 두 개의 연속阳线이 나타났을 때 공백한다.
역으로 포지션을 개설할 수 있습니다. 즉, 상승기에 적자를 하고, 하락기에 더 많은 것을 하고, 시장의 정서를 따를 수 있습니다.
스톱포트 비율을 설정할 수 있습니다. 예를 들어, 스톱포트를 입시 가격의 x%로 설정하여 수익을 잠금할 수 있습니다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
동적 채널은 시장의 변화를 실시간으로 반영하여 트렌드를 더 잘 판단할 수 있습니다.
트렌드와 몇 개의 K 선의 브레이크 신호를 결합하여 가짜 브레이크를 필터링 할 수 있습니다.
반전 포지션은 시장의 핫 포인트를 잡을 수 있고, 초과 수익을 얻을 수 있다.
제압 비율을 설정하면 위험을 효과적으로 조절할 수 있습니다.
전략적 아이디어는 간단하고 명확하며, 실행하기 쉽습니다.
이 전략에는 위험도 있습니다.
시장이 급격하게 변동할 때 통로는 작동하지 않을 수 있다. 통로를 더 안정적으로 만들기 위해 파라미터를 적절히 조정해야 한다.
역투자는 손해가 발생하기 쉽다. 단위 손해 비율을 조절해야 한다.
가짜 돌파는 잘못된 거래로 이어질 수 있다. 돌파의 유효성을 판단하기 위해서는 트렌드와 결합해야 한다.
거래 비용을 통제하기 위해 너무 자주 거래하는 것을 피하십시오.
이 전략은 동적 통로 판단 트렌드, K 라인 브레이크 입점 및 정지 사고를 통합한다. 매개 변수를 적절히 조정할 경우, 짧은 라인 거래의 효과적인 도구가 될 수 있다. 그러나 거래자는 여전히 위험 통제에 주의를 기울이고 자신의 거래 스타일과 함께 적절한 수정을 수행해야합니다.
/*backtest
start: 2022-09-09 00:00:00
end: 2023-09-15 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
strategy("Noro's Bands Scalper Strategy v1.1", shorttitle = "Scalper str 1.1", 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, %")
needct = input(false, defval = false, title = "Counter-trend entry")
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")
src = close
//PriceChannel
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
sma = sma(close, 20)
smatrend = close > sma ? 1 : close < sma ? -1 : smatrend[1]
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 = 80)
//Signals
bar = close > open ? 1 : close < open ? -1 : 0
up7 = trend == 1 and bar == -1 and bar[1] == -1 ? 1 : 0
dn7 = trend == 1 and bar == 1 and bar[1] == 1 and close > strategy.position_avg_price * (100 + takepercent) / 100 ? 1 : 0
up8 = trend == -1 and bar == -1 and bar[1] == -1 and close < strategy.position_avg_price * (100 - takepercent) / 100 ? 1 : 0
dn8 = trend == -1 and bar == 1 and bar[1] == 1 ? 1 : 0
if up7 == 1 or up8 == 1
strategy.entry("Long", strategy.long, needlong == false ? 0 : trend == -1 and needct == false ? 0 : na)
if dn7 == 1 or dn8 == 1
strategy.entry("Short", strategy.short, needshort == false ? 0 : trend == 1 and needct == false ? 0 : na)