고거래량 돌파복리 포지션 전략


생성 날짜: 2024-02-18 15:43:02 마지막으로 수정됨: 2024-02-18 15:43:02
복사: 0 클릭수: 585
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

고거래량 돌파복리 포지션 전략

개요

이 전략의 핵심 아이디어는 높은 거래량 상태에서 브레이크를 추적하고, 리스크 예산 비율과 250배의 시뮬레이션 레버리지를 설정하여 수익 포지션을 달성하는 것입니다.

전략 원칙

다음의 조건이 충족되면 추가로 입학할 수 있습니다.

  1. 거래량이 사용자 정의한 임계 (volThreshold) 를 넘습니다.
  2. 현재 K선 최저값은 이전 K선 최저값보다 낮습니다.
  3. 현재 K 라인 종료 가격은 마이너스이며 이전 K 라인 종료 가격보다 높습니다.
  4. 미완성 상장 다수 포지션이 존재하지 않는다

포지션 크기를 계산하는 방법은 다음과 같습니다.

  1. 계정 이자 (equity) 의 위험 퍼센트 (riskPercentage) 에 따라 위험 금액을 계산
  2. 리스크 금액을 모의 레버리지 배수 ((leverage, default 250x) 로 곱하면 계약 수를 얻습니다.

탈퇴 원칙:

다수점 포지션의 손실 비율 posProfitPct는 스톱로스 라인 ((-0.14%) 또는 스톱로스 라인 ((4.55%) 를 만질 때 청산한다.

우위 분석

이 전략의 장점은 다음과 같습니다.

  1. 높은 거래량으로 인한 트렌드 반전 기회를 포착합니다.
  2. 이윤이 급격히 증가하는 리비트 포지션 관리
  3. 위험 관리에 도움이 되는 합리적인 Stop Loss Brake 설정

위험 분석

이 전략에는 몇 가지 위험도 있습니다.

  1. 250배의 레버리지는 손실을 증가시킬 수 있습니다.
  2. 슬라이드 포인트, 수수료 및 보증금과 같은 실제 거래 요소를 고려하지 않습니다.
  3. 최적화 매개 변수를 반복적으로 재검토하고 실장 검증해야 합니다.

위험은 다음과 같은 방법으로 줄일 수 있습니다.

  1. 적당히 리버리지 배수를 줄여주세요.
  2. 더 많은 손실을 막기
  3. 실제 거래 비용을 고려합니다.

최적화 방향

이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.

  1. 동적으로 레버 크기를 조정
  2. 스탠드 손실 조건을 최적화
  3. 트렌드 필터를 추가합니다.
  4. 주식의 특정 특성과 결합된 조회

요약하다

이 전략은 전반적으로 간단하고 직접적이며, 역전 기회를 포착하여 초과 수익을 얻습니다. 그러나 또한 약간의 위험이 있으며, 신중한 실전 검증이 필요합니다. 매개 변수 및 전략 구조를 최적화하면 더 안정적이고 실전성이 강해질 수 있습니다.

전략 소스 코드
/*backtest
start: 2023-02-11 00:00:00
end: 2024-02-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("High Volume Low Breakout (Compounded Position Size)", overlay=true, initial_capital=1000)

// Define input for volume threshold
volThreshold = input.int(250, "Volume Threshold")

// Define input for risk per trade as a percentage of total equity
riskPercentage = input.float(10, "Risk Percentage")

// Calculate volume
vol = volume

// Check for high volume and low lower than the previous bar
highVolume = vol > volThreshold
lowLowerThanPrevBar = low < low[1]

// Calculate position profit percentage
posProfitPct = 100 * (close - strategy.position_avg_price) / strategy.position_avg_price

// Calculate the position size based on risk percentage and total account equity
equity = strategy.equity
riskAmount = (equity * riskPercentage / 100) / (close - strategy.position_avg_price)

// Calculate leverage (250x in this case)
leverage = 250

// Calculate the position size in contracts/lots to trade
positionSize = riskAmount * leverage

// Check if the current bar's close is negative when it has high volume
negativeCloseWithHighVolume = highVolume and close < close[1]

// Enter long position as soon as volume exceeds the threshold, low is lower than the previous bar, and the current bar's close is negative
if highVolume and lowLowerThanPrevBar and negativeCloseWithHighVolume and strategy.position_size == 0
    strategy.entry("Long", strategy.long, qty=positionSize, comment="Long Entry")

// Exit long position intrabar if profit goes below -0.14% or above 1%
if strategy.position_size > 0
    if posProfitPct < -0.14 or posProfitPct > 4.55
        strategy.close("Long")