추진력 역전 전략

저자:차오장, 날짜: 2024-01-03 17:14:15
태그:

img

전반적인 설명

이 전략은 이동 평균과 상대 강도 지수 (RSI) 를 기반으로 한 모멘텀 역전 전략입니다. 엔트리 및 출구를 결정하기 위해 과잉 구매 및 과잉 판매 신호와 함께 빠르고 느린 이동 평균의 크로스오버를 사용합니다.

전략 논리

이 전략은 14일 이동 평균을 빠른 신호 라인으로, 28일 이동 평균을 느린 라인으로 사용합니다. 또한 RSI 지표를 통합하여 시장이 과소매 또는 과소매 여부를 측정합니다.

14일 MA가 28일 MA를 넘어서고 RSI가 30 이하 또는 RSI가 13 이하일 때, 그것은 상승 동력의 반전을 신호하며 긴 입력을 촉구합니다. 14일 MA가 28일 MA보다 다시 넘어가면, 그것은 부분적인 수익 출출을 촉구하는 동력 반전의 실패를 신호합니다.

또한, 전략은 부분적 이윤 취득 메커니즘을 가지고 있습니다. 오픈 포지션의 이윤이 설정된 이윤 취득 수준 (8%의 결부) 에 도달하면 부분적으로 이윤을 취득합니다 (50%의 결부 판매).

이점 분석

이 전략은 이동평균의 장점을 결합하고 윙사 손실을 피합니다.

  1. 속도가 빠르거나 느린 이동평균을 사용하면 소음을 필터링합니다.

  2. RSI는 새로운 최고치를 추격하는 것을 피하기 위해 과잉 구매 및 과잉 판매 수준을 측정합니다.

  3. 부분적인 이익 취득은 수익을 확보하고 위험을 줄여줍니다.

위험 분석

  1. 이중 이동 평균 크로스오버는 윙사 (whipsaws) 를 생성하여 손실로 이어질 수 있습니다. 이 전략은 RSI를 사용하여 일부 윙사 신호를 필터링하여 추가 확인을 제공합니다.

  2. 부분적 이윤 취득은 더 큰 움직임을 놓치는 결과를 초래할 수 있습니다. 이윤 취득 수준은 위험과 보상을 균형을 맞추기 위해 조정 될 수 있습니다.

최적화 방향

  1. 최적의 설정을 찾기 위해 이동 평균의 다른 매개 변수 조합을 테스트합니다.

  2. 다른 RSI 임계 수준을 테스트합니다.

  3. 부분 수익을 취하는 수익 수준과 판매 비율을 조정하여 위험/이익을 균형 잡습니다.

결론

전체적으로 이것은 전형적인 평균 역전 전략이다. 그것은 시장을 돌리는 것을 결정하기 위해 RSI를 보충하여 신호를 필터하기 위해 빠른 / 느린 MA 교차를 사용합니다. 또한 일부 이익을 잠금하기 위해 부분 수익을 구현합니다. 전략은 간단하지만 실용적입니다. 매개 변수는 다른 시장 조건에 맞게 조정 할 수 있습니다.


/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-02 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title = "14/28 SMA and RSI", shorttitle = "14/28 SMA and RSI", overlay = false, pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, currency = currency.USD)
src = close, len = input(14, minval=1, title="Length")
take_Profit=input(8, title="Take Profit")
quantityPercentage=input(50, title="Percent of Quantity to Sell")
closeOverbought=input(true, title="Close Overbought and Take Profit")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
longCondition = 0
sellCondition = 0
takeProfit = 0
quantityRemainder = 100
smaSignal = input(14, title="SMA Signal Period")
smaLong = input(28, title="SMA Longer Period")
if ((sma(close, smaSignal) >= sma(close, smaLong) and rsi<= 30) or (rsi<=13)) and strategy.position_size==0
    longCondition:=1

if longCondition==1
    strategy.entry("Buy", strategy.long)
    
profit = ((close-strategy.position_avg_price)/strategy.position_avg_price) * 100

if sma(close, smaSignal) <= sma(close, smaLong) and strategy.position_size>1
    sellCondition := 1

if strategy.position_size>=1
    if closeOverbought == true
        if profit>=take_Profit and takeProfit == 0
            strategy.exit("Take Profit", profit=take_Profit, qty_percent=quantityPercentage)
            takeProfit:=1
            quantityRemainder:=100-quantityPercentage
    if sellCondition == 1 and quantityRemainder<100
        strategy.close("Buy")

    if closeOverbought == false and rsi>70
        strategy.close("Take Profit")
        
plot(longCondition, "Buy Condition", green)
plot(takeProfit, "Partial Sell Condition", orange)
plot(sellCondition, "Sell Condition", red)

더 많은