오프닝 주도 전략


생성 날짜: 2023-10-23 15:13:49 마지막으로 수정됨: 2023-10-23 15:13:49
복사: 1 클릭수: 694
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

오프닝 주도 전략

개요

오픈 드라이브 전략은 거래일 개시 후 첫 30 분 동안의 가격 행동을 관찰하여 가격의 강력한 돌파 방향을 식별하고 그 후 그 방향으로의 트렌드 거래를합니다. 이 전략은 주로 오픈 후의 유동성과 거래량이 증가하여 큰 가격 변동과 방향적 힘을 일으킬 수 있습니다.

전략 원칙

  1. 이 전략은 30분 K 선을 사용한다. 이는 오픈 후의 가격 행동을 판단하기 위해 충분한 시간 간격이 필요하기 때문이다.

  2. 다음 개장 시간대의 K 라인을 식별하십시오: 0700-0715, 0800-0815, 1300-1315, 1430-1445

  3. 디스크 K 라인이 다음 조건을 충족하는지 판단하십시오:

    • 개시 가격은 K선에서 가장 낮은 가격에 가깝고, 개시 가격은 K선에서 가장 높은 가격에 가깝습니다.

    • 또는 상장값이 최고값에 가깝고, 상장값이 최저값에 가깝습니다.

    • 그리고 그 K 선의 최고 가격은 이전 5 K 선의 최고 가격의 1배 범위를 초과하거나, 또는 최저 가격은 이전 5 K 선의 최저 가격의 1배 범위를 초과합니다.

  4. 만약 위의 조건이 성립한다면, K선 발생 이후의 3번째 K선으로 그 방향으로 진입하는 트렌드 거래가 진행된다.

  5. 그리고 K선으로 들어가는 가장 높은 가격 또는 가장 낮은 가격으로 스톱 손실 라인을 설정합니다.

  6. 포지션은 3개의 K 라인 후 출발, 즉 90분.

우위 분석

  • 오픈 후의 높은 유동성 특성을 활용하여 더 큰 방향성을 포착할 수 있습니다.
  • 필터링 조건을 뚫고 진동 동향에서 발생하는 잘못된 신호를 피합니다.
  • 더 높은 시간 사이클은 너무 많은 거래 빈도를 필터링합니다.
  • 손해 확산을 방지하기 위한 손해 중지 설정

위험 분석

  • 고정된 상장 간격 시간에는 트렌드가 깨질 위험이 있습니다.
  • 브레이크 값을 적절하게 설정하지 않으면 일부 유효한 신호를 제거할 수 있습니다.
  • 고정 지분 기간은 특정 상황에 따라 조정할 수 없습니다.
  • 이동식 정지 없이 트렌드를 추적할 수 없습니다.

다음을 고려할 수 있습니다:

  • 더 많은 파라미터를 동적으로 사용하여 오픈 영역을 결정합니다
  • 브레이크한 임값 변수를 최적화
  • 변동에 따라 지분 기간을 조정합니다
  • 이동식 손해제도 추가

최적화 방향

  • 트렌드 방향을 판단하는 더 많은 지표와 결합하여 신호 품질을 향상시킬 수 있습니다.
  • 더 적은 시간 내에 진입하여 더 많은 작업을 수행할 수 있습니다.
  • 테스트 결과에 따라 최적화 가능한 파라미터들, 예를 들어, 연장간격, 돌파한 임계, 스톱 손실 설정 등
  • 다이내믹 스톱, 이동 스톱, 재입장 등의 수익을 올리는 전략을 고려할 수 있습니다.
  • 여러 품종의 재검토를 시도하여 가장 적합한 품종을 결정할 수 있습니다.

요약하다

오프닝 드라이브 전략은 오프닝 후 가격의 강력한 돌파 방향을 포착하여 트렌드 추적을 수행합니다. 무작위 입장에 비해 더 나은 위험과 수익 특성을 가지고 있습니다. 중요한 것은 파라미터 설정을 잘 파악하고 적절한 품종을 선택하여 너무 자주 입장을 피하면서 수익을 올리는 확률을 높이는 것입니다.

전략 소스 코드
/*backtest
start: 2023-10-15 00:00:00
end: 2023-10-22 00:00:00
period: 10m
basePeriod: 1m
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/
// © Marcns_

//@version=5
// a script that highlights open drives around cash market opens throughout the day
// this indicator identifies the following cash open, open drives 0700 - 0715 / 0800 - 0815 / 1300 - 1315 / 1430 - 1445 
// an open drive is when a cash market opens and price runs either up or down away from the opening price, often this will be the high or the low the remainer of the session or day
// and often identify a trend session
strategy("Open Drive", commission_type =  strategy.commission.cash_per_contract, commission_value = 3.8 )

// open drive filter times - all times GMT
eu_sev = time(timeframe.period, "0700-0715", "GB")
eu_eig = time(timeframe.period, "0800-0815", "GB")
us_one = time(timeframe.period, "1300-1315", "GB")
us_two = time(timeframe.period, "1430-1445", "GB")


// identify bar that opens at low and closes at high + vice versa 
// bar needs to open at one extreme and close at another 
TrndExThreshold_Open = 0.15
TrndExThreshold_Close = 0.15

// add a bar range expansion filter - range of bar correlates to volume, high volume = wider range. This script will be able to filter for a break of a 5 bar range +100% or -100%

fbhi = ta.highest(5)
fblo = ta.lowest(5)

fbr = (fbhi - fblo)

RangeEx_up = 0.0

if high >= (fbhi[1] + fbr[1])
    RangeEx_up := 1.0
else
    na

// range ex down

RangeEx_do = 0.0

if low <= (fblo[1] - fbr[1]) 
    RangeEx_do := 1.0
else
    na


//#1 open within 5% of low

OpenAtLow = 0.0 

if (close > open) and (open-low) / (high-low) < TrndExThreshold_Open
    OpenAtLow := 1.0
else 
    na 

//#2 close within 5% of high
    
CloseAtHigh = 0.0

if (close > open) and (high-close) / (high-low) < TrndExThreshold_Close
    CloseAtHigh := 1.0
else
    na 

OD_Up = 0.0

if (OpenAtLow + CloseAtHigh + RangeEx_up == 3.0) and ( eu_sev or eu_eig or us_one or us_two)
    OD_Up := 1
else
    na

plot(OD_Up, title = "OD_up")



OpenAtHigh = 0.0 

if (close < open) and (high-open) / (high-low) < TrndExThreshold_Open
    OpenAtHigh := 1.0
else 
    na 

//#2 close within 5% of high
    
CloseAtLow = 0.0

if (close < open) and (close-low) / (high-low) < TrndExThreshold_Close
    CloseAtLow := 1.0
else
    na 

OD_Down = 0.0

if (OpenAtHigh + CloseAtLow + RangeEx_do == 3.0) and ( eu_sev or eu_eig or us_one or us_two)
    OD_Down := -1
else
    na

plot(OD_Down, title = "OD_down", color = color.red)


//3sma

ma = ta.sma(close,3)

// one time framing - highlight bars the make a series of lower highs or higher lows to identify trend 
// one time frame up 
otf_u = 0.0

if close > ma and close[1] > ma[1]
    otf_u := 1
else
    na
// one time frame down 
otf_d = 0.0

if close < ma and close[1] < ma[1]
    otf_d := 1
else
    na


//bgcolor(otf_u ? color.rgb(76, 175, 79, 70) : na)
//bgcolor(otf_d ? color.rgb(255, 82, 82, 66) : na)

// record high and low of entry bar into variable for absolute stop
// buy stop
bs = 0.0

if OD_Up
    bs := low[1]
else
    na

// sell stop
ss = 0.0

if OD_Down
    ss := high[1]
else
    na




// strategy entry and exits 
// long
if OD_Up
    strategy.entry("el", strategy.long, 2)
if ta.barssince(OD_Up)> 3 
    strategy.exit(id = "ex" , from_entry = "el", limit = close)

// short 
if OD_Down
    strategy.entry("es", strategy.short, 2)
if ta.barssince(OD_Down)> 3
    strategy.exit(id = "ex" , from_entry = "es", limit = close)