큰 파동, 큰 추락 전략

저자:차오장, 날짜: 2023-11-06 15:48:22
태그:

img

전반적인 설명

빅 서지 빅 폴 전략은 포지션에 진입하기 위해 거대한 상승 및 하락 촛불을 감지합니다. 거대한 상승 촛불을 감지할 때 짧게 가고 거대한 하락 촛불을 감지할 때 길게 간다. 스톱 손실은 신호 촛불의 최저 수준 (대위 상향으로 길게) 아래로 배치되며, 수익을 취하는 것은 스톱 손실의 1 배로 설정됩니다. 사용자는 상승 / 하락 촛불의 최소 크기와 특정 기간 동안 평균 바 범위의 배수를 정의 할 수 있습니다.

전략 논리

이 전략의 핵심 논리는 다음과 같습니다.

  1. 현재 촛불 범위 (높은 - 낮은) 및 촛불 몸의 크기를 계산합니다. ( 닫으면 긍정적으로 > 개방, 닫으면 부정적으로 < 개방)

  2. 지난 N 개의 촛불 위에 평균 범위를 계산

  3. 현재 촛불이 만족하는지 확인하십시오: 범위 >= 평균 범위 x 곱하기 그리고 몸 크기 >= 범위 x 미니 몸 크기 계수

  4. 위의 조건이 충족되면 신호가 발사됩니다: 상승 촛불에 짧게, 하락 촛불에 길게

  5. 스톱 러스 및 수익을 취득할 수 있는 옵션: 낮은 스톱 러스 및 스톱 러스 계수 x 범위에서 스톱 러스; 1 x 스톱 러스에서 수익을 취득

몸집 크기의 필터는 도지를 제외합니다. 동적 평균 범위는 시장 변화에 적응합니다. 스톱 손실 및 이익 취득은 합리적인 드라우다운 통제를 허용합니다.

장점

이 전략의 가장 큰 장점은 양질의 트렌드 역전 신호를 포착하는 것입니다. 두 가지 판단에 기초합니다.

  1. 거대한 상승/하락 촛불은 아마도 추세가 확장 된 움직임 후 고갈 된 것을 나타냅니다.

  2. 동적 평균을 초과하는 비정상적으로 큰 범위는

또한 스톱 로즈와 노프트 로프 설정이 합리적이어서 추격하지 않고도 효율적인 손실 통제가 가능합니다.

전체적으로, 이 전략은 높은 품질의 구조적 전환점을 식별하는 데 성공하여 효율적인 실행을 가능하게합니다.

위험성

주요 위험은 두 가지 측면에서 나타납니다.

  1. 거대한 바는 손실을 멈추는 사냥을 할 수 있습니다. 잘못된 신호를 생성

  2. 스톱 손실은 손실을 효과적으로 제어하기에는 너무 넓을 수 있습니다.

첫 번째 위험에 대해 최소 크기의 필터를 추가하면 잘못된 신호를 줄일 수 있지만 기회를 놓칠 수도 있습니다. 매개 변수를 최적화하기 위해 백테스트가 필요합니다.

두 번째 위험의 경우, 스톱 로스 계수를 조정하면 너무 단단하지 않고 서포트 근처에서 스톱을 최적화 할 수 있습니다. 또한 스톱에서 손실을 보상하기 위해 수익률을 높이는 것을 고려하십시오.

더 나은 기회

이 전략은 몇 가지 방법으로 더 개선될 수 있습니다.

  1. 트렌드 방향 필터를 추가하여 트렌드 반대 거래를 피합니다.

  2. 가장 좋은 조합을 찾기 위해 백테스팅을 통해 매개 변수를 최적화

  3. 큰 촛불에서 높은 볼륨을 보장하기 위해 볼륨 필터를 추가

  4. 잘못된 신호를 줄이기 위해 이동 평균, 볼링거 밴드 같은 추가 필터를 고려하십시오.

  5. 최적화를 위한 다양한 제품에서 테스트 매개 변수

  6. 가격 동작에 기반한 동적 조정에 따라 트레일링 스톱 손실을 추가합니다.

  7. 초기 스톱 로스 이후 재입구 기회를 고려합니다.

위의 향상으로,이 전략은 훨씬 더 효과적이 될 수 있으며 이익의 확률을 향상시킬 수 있습니다. 최적의 매개 변수를 찾기 위해 광범위한 백테스팅과 최적화가 필요합니다.

결론

빅 서지 빅 폴 전략은 스톱 로스 및 수익 관리와 함께 거대한 촛불 반전에서 이익을 얻습니다. 트렌드 트레이더에게 귀중한 정보를 제공하여 고품질의 구조적 전환점을 성공적으로 식별합니다. 매개 변수 및 논리 최적화로이 전략은 실용적인 의사 결정 도구가 될 수 있습니다. 간단한 논리와 직관적인 경제학 또한 이해하기 쉽고 적용 할 수 있습니다. 전반적으로이 전략은 연구와 구현 가치가있는 탄탄한 프레임워크를 제공합니다.


/*backtest
start: 2023-10-06 00:00:00
end: 2023-11-05 00:00:00
period: 1h
basePeriod: 15m
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/
// © tweakerID

// This strategy detects and uses big bars to enter a position. When the Big Bar 
// is bearish (red candle) the position will be long and viceversa
// for short positions. The stop loss (optional) is placed on the low of the 
// candle used to trigger the position and user inputs allow you to modify the
// size of the SL. Take profit is placed on a reward ratio of 1. User can also modify 
// the size of the bar body used to determine if we have a real Big Bar and
// filter out Doji bars. Big Bars are determined relative to the previous X period size, 
// which can also be modified, as well as the required size of the Big Bar relative to this period average.

//@version=4
strategy("Big Bar Strategy", overlay=false)

direction = input(0, title = "Direction (Long=1, Both=0, Short=-1 ", type=input.integer, minval=-1, maxval=1)
strategy.risk.allow_entry_in(direction == 0 ? strategy.direction.all : (direction < 0 ? strategy.direction.short : strategy.direction.long))

//Inputs
barsizemult=input(1, step=.1, title="SL Mult")
TPbarsizemult=input(1, step=.1, title="TP Mult")
barsizeThreshold=input(.5, step=.1, minval=.5, maxval=.9, title="Bar Body Size")
period=input(10)
mult=input(2, step=.2, title="Big Size Avg Mult to determine Big Bar")
i_reverse=input(false, title="Reverse Trades")
SLon=input(false, title="Use SL / TP")

//Calculations
barsize=high-low
barbodysize=close>open?(open-close)*-1:(open-close)
barsizeavg=sum(barsize, period)/period
bigbar=barsize >= barsizeavg*mult and barbodysize>barsize*barsizeThreshold

//Entry Logic
longCondition = close < open and bigbar //and strategy.position_size==0
shortCondition = close > open and bigbar //and strategy.position_size==0

//SL & TP Calculations
longTP=strategy.position_avg_price + (valuewhen(longCondition,barsize,0)*TPbarsizemult)
longSL=strategy.position_avg_price - (valuewhen(longCondition,barsize,0)*barsizemult)
shortTP=strategy.position_avg_price - (valuewhen(shortCondition,barsize,0)*TPbarsizemult)
shortSL=strategy.position_avg_price + (valuewhen(shortCondition,barsize,0)*barsizemult)
TP=strategy.position_size>0?longTP:shortTP
SL=strategy.position_size>0?longSL:shortSL

//Entries
if (longCondition)
    strategy.entry("long", long=not i_reverse?true:false)
    alert("Big Bar")
if (shortCondition)
    strategy.entry("short", long=not i_reverse?false:true)
    alert("Big Bar")
if SLon
    strategy.exit("SL & TP", "long", stop=SL, limit=TP)
    strategy.exit("SL & TP", "short", stop=SL, limit=TP)
    
// Plots
barcolor(bigbar ? color.white : na)
plot(barsizeavg, transp=100, title="Barsize Avg")
plot(barsize, transp=100, title="Bar Size")
plot(barbodysize, transp=100, title="Bar Body Size")
plot(SLon?TP:na, color=color.green, style=plot.style_cross, title="TP")
plot(SLon?SL:na, color=color.red, style=plot.style_cross, title="SL")
plotshape(longCondition ? 1 : na, style=shape.triangleup, location=location.belowbar, color=color.green, title="Bullish Setup")
plotshape(shortCondition ? 1 : na, style=shape.triangledown, location=location.abovebar, color=color.red, title="Bearish Setup")



더 많은