가격-용량 통합에 기반한 전략을 따르는 경향

저자:차오장, 날짜: 2023-09-13 15:25:20
태그:

이 전략은 Trend Following Strategy Based on Price-Volume Integration라고 불립니다. 이 전략은 가격과 부피의 지표를 모두 고려하여 트렌드 방향을 결정하고 가격과 부피의 힘에 맞춰 신호를 생성합니다.

거래 논리는 다음과 같습니다.

먼저 가격의 5일 이동 평균과 15일 이동 평균을 계산합니다.

5일 가격 이동 평균이 상승하고 15일 볼륨 이동 평균도 상승하면 구매 신호를 생성하기 위해 동기화 된 가격-용량 상승을 신호합니다.

5일 가격 이동 평균이 하락하거나 15일 볼륨 이동 평균이 하락하면 기존의 긴 포지션은 종료됩니다.

이 전략의 장점은 트렌드 방향을 판단하기 위해 가격과 부피 변화를 공동으로 사용하는 것입니다. 양쪽 모두 상승세를 지향할 때만 긴 진입이 발생하여 잘못된 신호를 효과적으로 필터링합니다.

그러나 이동 평균의 매개 변수는 다양한 제품 특성에 맞게 최적화 및 조정되어야합니다. 단 하나의 거래 손실 위험을 줄이기 위해 Stop Loss 또한 중요합니다.

결론적으로, 가격 및 부피 지표를 적절하게 통합하면 트렌드 거래 전략 성능을 향상시킬 수 있습니다. 그러나 거래자는 여전히 실제 조건에 따라 전략 매개 변수를 조정하는 유연성을 유지하면서 시장 정보를 더 많이 관찰해야합니다.


/*backtest
start: 2023-01-01 00:00:00
end: 2023-09-12 00:00:00
period: 1d
basePeriod: 1h
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/
// © Celar

//@version=5
strategy("VOLLY PRICE CONVERGE", default_qty_type= strategy.percent_of_equity )
base_sma = ta.sma(close, 10)
vol_sma5 = ta.hma(volume, 15)
price_sma5 = ta.hma(close, 15)
ma50 = ta.sma(close, 50)
ma20 = ta.sma(close, 20)
int vol_indicator = na
int price_indicator = na

if vol_sma5 > vol_sma5[1]
    vol_indicator := 1
else
    vol_indicator := 0

if price_sma5 > price_sma5[1]
    price_indicator := 1
else
    price_indicator := 0
        
signal = vol_indicator + price_indicator

colour = signal == 2 ?  #00802b : signal == 1 ? #cc2900 : color.white 

bank_roll = strategy.equity
qty = bank_roll/close

strategy.entry("Long", strategy.long, qty, when = signal == 2 and close > base_sma)
// Generate a full exit bracket (profit 10 points, loss 5 points per contract) from the entry named "Long".
strategy.close("Long", when = signal == 1 or signal == 0 or close < base_sma )

 
        

더 많은