
이 전략은 통로 지표에 기반한 단기 거래 전략이다. 통로 위아래의 돌파구를 이용하여 트렌드의 시작과 끝을 판단하고, 그 후 매매 결정을 내린다. 강한 트렌드 시장에서 이러한 돌파구 전략은 더 나은 수익을 얻을 수 있다.
이 전략은 먼저 일정 주기 동안의 최고 가격과 최저 가격을 계산하여 통로의 상반도와 하반도를 구성한다.
가격이 상승하면 상쇄를 하고, 추가로 진입한다. 가격이 하락하면 상쇄를 하고, 공백으로 진입한다.
이동 스톱을 사용하여 위험을 제어하십시오. 스톱 라인은 통로로 설정된 중간 라인입니다.
두 가지 선택 가능한 탈퇴 규칙이 있습니다: 회귀 중선 및 이동 중지. 전자는 빠른 수익으로 탈퇴하고 후자는 위험을 통제합니다.
시장 환경에 따라 통로주기를 선택하고, 스톱로스 폭을 조정하는 등의 파라미터를 선택하여 전략을 최적화할 수 있다.
작동이 간단하고 실행하기 쉽다. 단지 가격과 통로의 관계를 모니터링하고 규칙에 따라 입장을 열어야 한다.
트렌드 트레이딩, 역동의 위험이 없습니다.
통로가 깨끗하고 직관적이어서 명확한 입구 신호를 형성한다.
좋은 수익률을 가지고 있고, 보통 만족스러운 수익을 얻을 수 있다.
조정 가능한 매개 변수가 많아서 다양한 시장에 최적화 할 수 있습니다.
돌파구가 성공할 수 있는 것은 아니지만, 덫에 걸리는 위험도 있다.
통로는 일정한 주기적으로 형성되어야 하며, 진동상태에는 적용되지 않는다.
통로 중계 손실을 살펴보면 너무 보수적이어서 추세를 유지할 수 없습니다.
매개 변수 최적화는 역사 데이터의 지원이 필요하며, 실 디스크에는 최적화가 있을 수 있다.
기계적으로 거래하는 것은 거래 횟수와 스라이드 포인트 비용을 증가시킬 수 있습니다.
다양한 주기 변수의 효과를 평가하고 최적의 통로 주기를 선택한다.
회귀 중선 스톱 및 이동 스톱을 테스트하고, 더 적합한 탈퇴 메커니즘을 선택한다.
정지 손실을 최적화하고, 정지 손실이 유발되는 확률을 줄입니다.
트렌드 필터링에 참여하여 부적절한 브레이크 트레이드를 피하십시오.
하지만 위험을 통제하는 것은 매우 중요합니다.
이 전략은 전체적으로 좀 더 성숙한 단기 돌파 전략이다. 명확한 진입 규칙이 있고, 위험 통제 조치가 마련되어 있고, 운영 효과가 좋다. 변수 최적화를 통해 전략의 성능을 더욱 향상시킬 수 있다. 그러나 여전히 몇 가지 고유한 단점을 주의해야 하며, 다른 시장에 맞게 조정할 필요가 있다.
/*backtest
start: 2022-10-18 00:00:00
end: 2023-10-24 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Strategy testing and optimisation for free Bitmex trading bot
// © algotradingcc
//@version=4
strategy("Channel Break [for free bot]", overlay=true, default_qty_type= strategy.percent_of_equity, initial_capital = 1000, default_qty_value = 20, commission_type=strategy.commission.percent, commission_value=0.075)
//Options
buyPeriod = input(13, "Channel Period for Long position")
sellPeriod = input(18, "Channel Period for Short position")
isMiddleExit = input(true, "Is exit on Base Line?")
takeProfit = input(46, "Take Profit (%) for position")
stopLoss = input(9, "Stop Loss (%) for position")
// Test Start
startYear = input(2005, "Test Start Year")
startMonth = input(1, "Test Start Month")
startDay = input(1, "Test Start Day")
startTest = timestamp(startYear,startMonth,startDay,0,0)
//Test End
endYear = input(2050, "Test End Year")
endMonth = input(12, "Test End Month")
endDay = input(30, "Test End Day")
endTest = timestamp(endYear,endMonth,endDay,23,59)
timeRange = time > startTest and time < endTest ? true : false
// Long&Short Levels
BuyEnter = highest(buyPeriod)
BuyExit = isMiddleExit ? (highest(buyPeriod) + lowest(buyPeriod)) / 2: lowest(buyPeriod)
SellEnter = lowest(sellPeriod)
SellExit = isMiddleExit ? (highest(sellPeriod) + lowest(sellPeriod)) / 2: highest(sellPeriod)
// Plot Data
plot(BuyEnter, style=plot.style_line, linewidth=2, color=color.blue, title="Buy Enter")
plot(BuyExit, style=plot.style_line, linewidth=1, color=color.blue, title="Buy Exit", transp=50)
plot(SellEnter, style=plot.style_line, linewidth=2, color=color.red, title="Sell Enter")
plot(SellExit, style=plot.style_line, linewidth=1, color=color.red, title="Sell Exit", transp=50)
// Calc Take Profits & Stop Loss
TP = 0.0
SL = 0.0
if strategy.position_size > 0
TP := strategy.position_avg_price*(1 + takeProfit/100)
SL := strategy.position_avg_price*(1 - stopLoss/100)
if strategy.position_size > 0 and SL > BuyExit
BuyExit := SL
if strategy.position_size < 0
TP := strategy.position_avg_price*(1 - takeProfit/100)
SL := strategy.position_avg_price*(1 + stopLoss/100)
if strategy.position_size < 0 and SL < SellExit
SellExit := SL
// Long Position
if timeRange and strategy.position_size <= 0
strategy.entry("Long", strategy.long, stop = BuyEnter)
strategy.exit("Long Exit", "Long", stop=BuyExit, limit = TP, when = strategy.position_size > 0)
// Short Position
if timeRange and strategy.position_size >= 0
strategy.entry("Short", strategy.short, stop = SellEnter)
strategy.exit("Short Exit", "Short", stop=SellExit, limit = TP, when = strategy.position_size < 0)
// Close & Cancel when over End of the Test
if time > endTest
strategy.close_all()
strategy.cancel_all()