
この戦略は,価格変動の幅と均線交差に基づく動態追跡取引システムである.戦略は,主に価格変動率1.91%を超える異常波動 (“ブラック・スウェン・イベント”) を監視することによってシグナルを誘発し,同時にEMA144とEMA169の交差を組み合わせてトレンドの方向と退出のタイミングを確認する.この戦略は,特に1-3分間の短い周期の取引に適しており,市場の激しい波動の機会を迅速に捕捉することができる.
戦略の核心的な論理は以下の2つの部分から成り立っています.
策略は1.91%以上の上昇波動を検知したときに多額の取引を行い,下方波動を検知したときに空白を行う.平線が逆転交差したとき,策略は自動的にポジションを平準化してリスクを制御する.
この戦略は,波動率モニタリングと均線交差を組み合わせて,市場の異常な波動に迅速に反応し,トレンドを追跡します.戦略は合理的に設計され,優れたリスク管理機構がありますが,実際の市場状況に応じてトレーダーによるパラメータ最適化とリスク管理が必要です. リアルタイム取引で小さなポジションから始め,さまざまな市場環境下での戦略のパフォーマンスを段階的に検証することをお勧めします.
/*backtest
start: 2024-12-05 00:00:00
end: 2024-12-12 00:00:00
period: 45m
basePeriod: 45m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
//黑天鹅警报器,作者():道格拉斯机器人
//适合1分钟-3分钟的k线,发生波动超过百分之二时,自动报警
strategy('黑天鹅警报', overlay=true, initial_capital=10000, currency='USD', default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.075, pyramiding=3)
//-------------------------------------------
//-------------------------------------------
timecondition = timeframe.period == '480' or timeframe.period == '240' or timeframe.period == 'D' or timeframe.period == '720'
// Make input options that configure backtest date range
startDate = input.int(title='Start Date', defval=1, minval=1, maxval=31)
startMonth = input.int(title='Start Month', defval=11, minval=1, maxval=12)
startYear = input.int(title='Start Year', defval=2018, minval=1800, maxval=2100)
endDate = input.int(title='End Date', defval=1, minval=1, maxval=31)
endMonth = input.int(title='End Month', defval=11, minval=1, maxval=12)
endYear = input.int(title='End Year', defval=2031, minval=1800, maxval=2100)
// Look if the close time of the current bar
// falls inside the date range
inDateRange = time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0) and time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0)
// Inputs
a = input(1, title='Key Vaule. \'This changes the sensitivity\'')
c = input(10, title='ATR Period')
h = input(false, title='Signals from Heikin Ashi Candles')
ma60 = ta.sma(close, 60)
ema144 = ta.ema(close, 144)
ema169 = ta.ema(close, 169)
ma20 = ta.sma(close, 20)
plot(ema144, color=color.new(color.yellow, 0), title='144')
plot(ema169, color=color.new(color.orange, 0), title='169')
heitiane = close - open
heitiane := math.abs(heitiane)
heitiane /= close
if inDateRange and heitiane > 0.0191 and close < open // and close>f3
strategy.entry('botsell20', strategy.short, comment='黑天鹅追空' + str.tostring(heitiane))
if ta.crossover(ema144, ema169)
strategy.close('botsell20', comment='平空')
if inDateRange and heitiane > 0.0191 and close > open // and close>f3
strategy.entry('botbuy20', strategy.long, comment='白天鹅追多' + str.tostring(heitiane))
if ta.crossunder(ema144, ema169)
strategy.close('botbuy20', comment='平多')