
이 전략은 돈치안 (Donchian) 통로 지표에 기반하여 시장 행태를 추적하기 위해 트렌드 거래를 한다. 가격이 돈치안 통로를 뚫었을 때 트렌드 추적을 한다. 가격이 통로 안에 돌아왔을 때, 손해 평형을 한다.
일정 주기 동안의 최고 가격과 최저 가격을 계산하여 唐通道를 형성한다. 通道中線は, 기간 동안의 최고 가격과 최저 가격의 평균값이다.
가격이 통로의 상단선을 돌파할 때, 다단점 포지션을 개시한다. 가격이 통로의 하단선을 돌파할 때, 빈점 포지션을 개시한다.
포지션 개설 후, 스톱 라인은 통로의 중간 라인을 추적합니다. 스톱 라인은 통로를 돌파하는 일정 비율의 가격을 추적합니다.
가격이 다시 통로로 돌아왔을 때, 손해배상 청산을 한다.
이 전략은 동치안 통로를 통해 트렌드 방향을 판단하여 시장의 돌파구를 빠르게 잡을 수 있습니다.
통로 중선 추적 스톱로스를 사용하여 수익을 보호 할 수 있습니다.
사용자가 설정한 정지폭에 따라 수익 공간을 적절히 확대한다.
다양한 상황과 적응할 수 있다. 예를 들어, 평형, 돌파, 회수 등과 같이, 포지션을 유연하게 조정한다.
전략적 거래 논리는 간단하고 명확하며, 이해하기 쉽고, 숙지하기 쉽습니다.
이 전략은 단지 브레이크채널 거래에 기초하고 있으며, 시장의 종결에 효과적으로 대응할 수 없습니다.
위조 신호의 위험성이 있으므로 다른 지표와 함께 검증해야 합니다.
이윤을 막기 위한 잘못된 설정으로 인해 손실이 조기 중단되거나 수익이 부족할 수 있습니다.
채널 주기가 잘못 설정되어 거래 신호의 정확성에 영향을 미칩니다.
너무 큰 포지션을 설정하면 시장의 변동이 계좌에 미치는 영향을 증폭시킬 수 있습니다.
로봇 거래는 사고로 인해 중단될 위험이 있으며, 시스템의 안정성과 신뢰성을 보장해야 합니다.
거래량 지표와 결합하여 가짜 돌파구를 추적하는 것을 피하십시오.
트렌드 지표 판단을 높이고 포지션 개시 신호의 정확도를 높여줍니다.
정지/피해 알고리즘을 최적화하여 동적 조정을 구현한다.
시장 환경에 따라 실시간으로 포지션 관리 전략을 조정한다.
“이번 대회에 참가할 수 있는 가장 좋은 시점을 찾기 위해 야간 경기, 야간 경기 전의 데이터를 연구하라”.
다양한 주기적 파라미터를 테스트하여 최적의 파라미터 조합을 찾는다.
모형 검증 모듈을 추가하여 과일접합을 방지한다.
이 전략은 전체적으로 보다 간단하고 실용적인 자기 적응 트렌드 전략이다. 빠른 포착 트렌드 돌파, 수익 보호 등의 특징이 있다. 또한, 상회 조정 상황에 대한 무효성, 가짜 돌파가 손실을 초래하는 등의 단점이 있다. 미래의 최적화 방향은 더 많은 지표 필터링 신호를 결합하고, 동적으로 스톱 스톱 손실 전략을 조정하여 더 많은 시장 환경에 적응하는 것이다.
/*backtest
start: 2022-10-19 00:00:00
end: 2023-10-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2020
//@version=4
strategy(title = "Noro's Donchian Strategy", shorttitle = "Donchian str", overlay = true, default_qty_type = strategy.percent_of_equity, initial_capital = 100, default_qty_value = 100, commission_value = 0.1)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
tp = input(defval = 10, minval = 1, title = "Take profit")
lotsize = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot, %")
pclen = input(50, minval = 1, title = "Price Channel Length")
showll = input(true, defval = true, title = "Show lines")
showbg = input(false, defval = false, title = "Show Background")
showof = input(true, defval = true, title = "Show Offset")
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")
//Price Channel
h = highest(high, pclen)
l = lowest(low, pclen)
center = (h + l) / 2
tpl = h * (100 + tp) / 100
tps = l * (100 - tp) / 100
//Lines
tpcol = showll ? color.lime : na
pccol = showll ? color.blue : na
slcol = showll ? color.red : na
offset = showof ? 1 : 0
plot(tpl, offset = offset, color = tpcol, title = "TP Long")
plot(h, offset = offset, color = pccol, title = "Channel High")
plot(center, offset = offset, color = slcol, title = "Cannel Center")
plot(l, offset = offset, color = pccol, title = "Channel Low")
plot(tps, offset = offset, color = tpcol, title = "TP Short")
//Background
size = strategy.position_size
bgcol = showbg == false ? na : size > 0 ? color.lime : size < 0 ? color.red : na
bgcolor(bgcol, transp = 70)
//Trading
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
lot = 0.0
lot := size != size[1] ? strategy.equity / close * lotsize / 100 : lot[1]
mo = 0
mo := strategy.position_size != 0 ? 0 : high >= center and low <= center ? 1 : mo[1]
if h > 0
strategy.entry("Long", strategy.long, lot, stop = h, when = strategy.position_size <= 0 and needlong and truetime and mo)
strategy.exit("TP Long", "Long", limit = tpl, stop = center)
strategy.entry("Short", strategy.short, lot, stop = l, when = strategy.position_size >= 0 and needshort and truetime and mo)
strategy.exit("TP Short", "Short", limit = tps, stop = center)
if time > timestamp(toyear, tomonth, today, 23, 59)
strategy.close_all()
strategy.cancel("Long")
strategy.cancel("Short")