熊市場MACDショート戦略

作者: リン・ハーンチャオチャン, 日時: 2023-09-14 18:04:28
タグ:

戦略の論理

この短期戦略は,熊市における下落傾向に重点を置く一方,長期的下落傾向の中で資産取引を保証し,さらなる下落後退します.

論理的には

  1. MACDの短線,長線,ヒストグラム線を計算する

  2. 下落傾向の可能性を示している.

  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)


もっと