연대화 탈퇴 전략

저자:차오장, 날짜: 2023-12-15 11:59:08
태그:

img

전반적인 설명

이 전략은 인도 시장에 대한 일 거래 인트라데이 통합 브레이크아웃 지표입니다. 시간 조건, 수수료 및 스톱-로스 추적을 포함합니다. 이 전략의 장점은 명확한 논리, 유연한 매개 변수 조정 및 시장 역동성에 적응하는 것입니다. 그러나 특정 위험이 존재하며 추가 최적화가 필요합니다.

전략 논리

핵심 전략은 볼링거 밴드를 기반으로 합니다. 중선과 상향/하향 밴드가 +MULT/-MULT 표준 편차이기 때문에 LENGTH 기간 간단한 이동 평균을 사용합니다. 상위 밴드 위의 닫는 파업이 발생하면 구매 신호가 생성되며, 하위 밴드 아래에 닫는 파업이 발생하면 판매 신호가 생성되어 범위 파업 전략을 형성합니다.

리스크 통제를 위해, 그것은 중지 손실 라인을 위해 ATR을 사용합니다. 그것은 또한 인도 시장 거래 시간을 고려하고 매일 14:57에 모든 포지션을 닫습니다.

이점 분석

이 전략의 장점:

  1. 명확한 논리, 쉬운 매개 변수 조정, 유연한 적응
  2. 리스크 관리에 스톱 로스 및 타임 컨트롤을 포함
  3. 현지화를 위해 인도 시장의 특수성을 고려하십시오.
  4. 합리적인 거래 빈도, 과도한 거래를 피합니다.
  5. 추가 최적화를 위한 좋은 확장성

위험 분석

이 전략의 위험은:

  1. 볼링거 밴드는 경험에 기초한 매개 변수 조정에 의존합니다.
  2. 거짓 신호에 민감한 단일 표시기
  3. ATR 스톱 로스는 제한된 위험만 제어할 수 있습니다.
  4. 블랙 스완 사건은 고려되지 않습니다.

위험은 다음과 같이 감소 할 수 있습니다.

  1. 신호 필터링을 위한 여러 지표의 조합
  2. 매개 변수 조정 규칙을 최적화
  3. 격차 거래 논리를 포함
  4. 스톱 로스 안정성 강화
  5. 시장 감정 지표를 결합

최적화 방향

전략은 여러 방향으로 최적화 될 수 있습니다.

  1. 더 나은 적응력을 위해 매개 변수 조정 최적화
  2. 잘못된 신호를 피하기 위해 더 많은 지표를 추가합니다.
  3. 스톱 로스 안정성 강화
  4. 트렌드 탐지를 위한 더 많은 분석을 포함
  5. 자동 위치 크기를 고려

모델 및 알고리즘 최적화로, 파라미터 튜닝 및 신호 필터링 기능이 더 넓은 적응과 더 높은 위험 관용을 위해 개선 될 수 있습니다.

결론

요약하자면, 이것은 직관적인 내일 브레이크아웃 전략입니다. 인도 시장의 특성을 해결하고 거래 위험을 제어합니다. 매개 변수 튜닝 및 신호 필터링에 대한 추가 개선으로,이 전략은 상업화 요구 사항을 충족시킬 수 있습니다.


/*backtest
start: 2022-12-08 00:00:00
end: 2023-12-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Consolidation Breakout [Indian Market Timing]",overlay = true , pyramiding = 0 ,initial_capital = 50000, default_qty_value=5, currency = currency.NONE,commission_type = strategy.cash, commission_value = 30, slippage = 1 )


// ══════════════════════════════════//
// ————————> INPUT VALUES <————————— //
// ══════════════════════════════════//

LENGTH = input.int(title='LENGTH', defval = 75, minval = 10 ,maxval = 300)
MULT = input.float(title='MULT_STDEV',defval = 3.2 , minval = 1 , maxval = 7 , step =0.1)

//EMA1 = input.int(title='EMA1', defval = 50, minval = 10 ,maxval = 550)
//EMA2 = input.int(title='EMA2', defval = 135, minval = 10 ,maxval = 550)
factor_tr = input.float(title = "ATR TRAIL", defval = 10, step = 0.1)

// ══════════════════════════════════//
// ————————> DAY TIME LIMIT <——————— //
// ══════════════════════════════════//

t = time(timeframe.period, '0935-1430:1234567')
time_condition = not na(t)

//**********************// ════════════════════════════════//
//**********************// ————————> ATR & PLOT <————————— //
//**********************// ════════════════════════════════//
//ema1 = ta.ema(close,EMA1)
//ema2 = ta.ema(close,EMA2)

//plot(ema1, color=color.new(color.blue, 0), style=plot.style_linebr, title='ema1')
//plot(ema2, color=color.new(color.yellow, 0), style=plot.style_linebr, title='ema2')

atr_tr = ta.atr(16)*factor_tr

longStop = close - atr_tr
shortStop = close + atr_tr

Entry = close
length = LENGTH
mult = MULT
basis = ta.sma(Entry , length)
dev = mult * ta.stdev(Entry , length)
upper = (basis + dev)
lower = (basis - dev)
buyEntry = ta.crossover(Entry , upper)
sellEntry = ta.crossunder(Entry , lower)

//plot(upper, color=color.new(color.red, 0), style=plot.style_linebr, title="short stop")
//plot(lower, color=color.new(color.green, 0), style=plot.style_linebr, title="Long stop")

plot(upper, color=close[1] > upper and close > upper ? color.green : color.red, linewidth=2)
plot(lower, color=close[1] > lower and close > lower ? color.green : color.red, linewidth=2)




// ══════════════════════════════════//
// ————————> LONG POSITIONS <————————//
// ══════════════════════════════════//
//******barinstate.isconfirmed used to avoid repaint in real time*******

if ( buyEntry and strategy.opentrades==0 and barstate.isconfirmed and time_condition)
    strategy.entry(id= "Long" ,direction = strategy.long, comment = "B")
    
plot(longStop , color=color.new(color.blue, 0), style=plot.style_linebr, title='long Stop')

if strategy.position_size > 0 
    strategy.exit("long tsl", "Long" , stop = longStop , comment='S')

// ═════════════════════════════════════//
// ————————> SHORT POSITIONS <————————— //
// ═════════════════════════════════════//
if ( sellEntry and strategy.opentrades==0 and barstate.isconfirmed and time_condition)
    strategy.entry(id = "Short" ,direction = strategy.short,  comment = "S") 

if strategy.position_size < 0
    strategy.exit("short tsl", "Short" , stop = shortStop ,comment='B')

// ════════════════════════════════════════════════//
// ————————> CLOSE ALL POSITIONS BY 3PM <————————— //
// ════════════════════════════════════════════════//
strategy.close_all(when = hour == 14 and minute == 57)






    

더 많은