この戦略は,熊市下落時の空白取引に焦点を当て,その一方で,資産が大周期下行通路にあることを確保し,さらに下落した後に止まり退出する.
取引の論理は以下の通りです.
MACD指標の快線,慢線,柱状線を計算する
MACDの速線が遅線を横切ると,下落傾向が始まる.
価格が450日移動平均を下回り,長期下落傾向にあることを確認
上記の2つの条件が満たされた場合,空席入場
ストップラインは入場料の8%以下に設定されています.
ストップラインは入場価格の4%上位に設定されます.
この戦略は,短期トレンドの転換を判断するためにMACDを充分活用し,長期平均線を判断するために大トレンドを補助し,盲目空白を避ける. ストップ・ストップ・ストラトジー戦略はリスクを制御する.
MACDは短期的な下落の可能性を判断した.
長期均線フィルタは空白反転を回避する
ストップ・ストップ・損失比は2:1で,リスクをコントロール
MACDパラメータを最適化する必要があります.
長期平均線は誤信号を誘発する
余裕がないと 機会は多用できない
この戦略は,大トレンドが下向きであることを保証する状況で,短期的な下落の機会をキャッチして空白する. ストップ・ストップ・ストラスト戦略の最適化とポートフォリオの管理は,戦略の効果に不可欠である.
/*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)