Type/to search

시간봉 기준 변동성 기반 거래 전략

Common strategy
Created: 2023-09-20 16:50:27
Last modified: 3 years ago
1
Follow
1802
Followers

개요

본 전략은 SPY 시장을 대상으로 시간봉 단위의 가격 변동을 활용하여 시장 흐름을 판단하고, 단기 반전 거래를 실행하는 단기 매매 전략입니다.

전략 원리

  1. 5일 및 13일 이동평균선 크로스를 이용하여 시간봉 단위 가격의 반전을 판단합니다.

  2. RSI 지표가 50 이상일 때 이동평균선 골든크로스가 발생하면 매수 신호가 생성됩니다.

  3. 13일 이동평균선이 5일 이동평균선을 하향 돌파하고, MACD 차이값이 시그널선을 하향 돌파하면 매도 신호가 생성됩니다.

  4. 손절 및 익절 라인을 설정하고, 목표 수익의 두 배에 도달하면 일부 포지션을 청산합니다.

  5. 공매도 거래를 선택할 수 있으며, 현재 거래가 완료된 후 다음 공매도 라운드 진입 여부를 판단합니다.

  6. 입력 매개변수에서 이동평균선, 손절/익절 비율 등을 자유롭게 설정할 수 있습니다.

장점 분석

  1. 시간봉 단위 가격 변동을 활용하여 단기 매매 기회를 포착합니다.

  2. 여러 지표를 조합한 검증을 통해 신호 정확도를 높입니다.

  3. 손절 및 익절 전략 설정으로 리스크 관리에 도움이 됩니다.

  4. 부분 익절을 통해 수익을 확정지을 수 있습니다.

  5. 입력 매개변수를 자유롭게 설정할 수 있어 단기 트레이더가 조정하기에 적합합니다.

리스크 분석

  1. 시간봉 단위 가격 변동에서 가짜 신호가 발생하여 손실을 볼 수 있습니다.

  2. 손절/익절 비율 설정이 부적절하면 지나치게 일찍 청산되거나 포지션 보유 시간이 길어질 수 있습니다.

  3. 일부 종목의 경우 최적의 백테스트 결과를 얻기 위해 매개변수 최적화 및 조정이 필요합니다.

  4. 최적화 시 과적합(오버피팅)의 위험이 존재합니다.

  5. 잦은 거래로 인해 수수료 거래 비용이 증가합니다.

최적화 방향

  1. 다양한 매개변수 조합을 테스트하여 최적의 매개변수를 찾습니다.

  2. 거래 신호 확인을 위해 다른 지표의 보조 활용을 평가합니다.

  3. 손절/익절 전략을 최적화하여 리스크와 수익의 균형을 맞춥니다.

  4. 추세 필터를 추가하여 역추세 거래를 피합니다.

  5. 부분 익절 조건을 적절히 완화하여 수익 기간을 연장합니다.

  6. 본 전략에 적합한 다른 종목을 평가합니다.

요약

본 전략은 SPY의 시간봉 단위 단기 매매 기회를 포착하려고 합니다. 매개변수 최적화, 신호 필터링 등을 통해 신뢰성을 높이고 효과적인 단기 매매 전략으로 발전시킬 수 있습니다.

Source
Pine
//@version=5
strategy(title="SPY 1 Hour Swing Trader", initial_capital=300000, default_qty_type=strategy.percent_of_equity, default_qty_value=15, pyramiding=0, commission_type=strategy.commission.cash_per_order, commission_value=0, overlay=true, calc_on_every_tick=false, process_orders_on_close=true, max_labels_count=500)

//The purpose of this script is to spot 1 hour pivots that indicate ~5 to 6 trading day swings.
//Results indicate that swings are held approximately 5 to 6 trading days on average, over the last 6 years.
//This indicator spots a go long opportunity when the 5 ema crosses the 13 ema on the 1 hour along with the RSI > 50.
//It also spots uses a couple different means to determine when to exit the trade. Sell condition is 
//primarily when the 13 ema crosses the 5 ema and the MACD line crosses below the signal line and
//the smoothed Stoichastic appears oversold (greater than 60). Stop Losses and Take Profits are configurable
//in Inputs along with ability to include short trades plus other MACD and Stoichastic settings.
//If a stop loss is encountered the trade will close. Also once twice the expected move is encountered
//partial profits will taken and stop losses and take profits will be re-established based on most recent close
Strategy parameters
Strategy parameters
Include Short Trades!
Input Stop Loss Percentage (0.02 = 2%)
Input Take Profit Percentage (0.03 = 3%)
Partial Profit Percentage in whole numbers (50 is 50%)
Fast EMA Period
Slow EMA Period
RSI Length
MACD Fast Length
MACD Slow Length
MACD Signal Length
ADX Length
Stochastic Length
Stoicastic Smooth K
Stoicastic Source
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)