곰 시장 MACD 단기 전략

저자:차오장, 날짜: 2023-09-14 18:04:28
태그:

전략 논리

이 단기 전략은 하향 시장에서 하향 움직임에 초점을 맞추고, 장기적인 하향 추세 내에서 자산을 거래하고, 추락 추세 이후 다시 탈퇴하도록 보장합니다.

논리는 다음과 같습니다.

  1. MACD 짧은, 긴 및 히스토그램 라인을 계산

  2. 하향 MACD 크로스오버 신호 잠재 하향 추세

  3. 450 일 MA 이하의 가격은 장기 하락 추세를 확인합니다.

  4. 두 가지 조건이 충족될 때 단축

  5. 영업이익은 입시 가격보다 8% 낮습니다.

  6. 엔트리 가격보다 4%의 스톱 로스 설정

단기 회전과 긴 MA를 위해 MACD를 활용하여 맹목적인 단축을 피합니다. 이익/손실 위험은 제어됩니다.

장점

  • MACD는 단기 하락 잠재력을 나타냅니다.

  • 긴 MA 필터는 단축 반전을 피합니다.

  • 2: 1 이익/손실 비율은 위험을 통제합니다.

위험성

  • MACD 매개 변수를 조정해야 합니다.

  • 긴 MA는 신호가 늦어지는 경향이 있습니다.

  • 단축은 단지 긴 기회를 놓친다.

요약

이 전략은 하향 추세를 보장 할 때 단기 하락 움직임을 포착합니다. 이익/손실 조정 및 위치 사이징은 성과에 중요합니다.


/*backtest
start: 2023-08-14 00:00:00
end: 2023-09-13 00:00:00
period: 2h
basePeriod: 15m
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/
// © Coinrule

//@version=5
strategy("Shorting Bearish MACD Cross with Price Below EMA 450 (By Coinrule)", overlay=true, initial_capital = 10000, default_qty_value = 30, default_qty_type = strategy.percent_of_equity, commission_type=strategy.commission.percent, commission_value=0.1)

// EMAs 
slowEMA = ta.ema(close, 450)

// MACD
[macdLine, signalLine, histogramLine] = ta.macd(close, 11, 26, 9)

// Conditions
goShortCondition1 = ta.crossunder(macdLine, signalLine)
goShortCondition2 = slowEMA > close

timePeriod = time >= timestamp(syminfo.timezone, 2021, 12, 1, 0, 0)
notInTrade = strategy.position_size <= 0
strategyDirection = strategy.direction.short

if (goShortCondition1 and goShortCondition2 and timePeriod and notInTrade)
    stopLoss = high * 1.04
    takeProfit = low * 0.92
    strategy.entry("Short", strategy.short)
    strategy.exit("exit","Short", stop=stopLoss, limit=takeProfit)
    
plot(slowEMA, color=color.green)


더 많은