
이 전략은 가격 변동의 폭과 평균선 교차에 기반한 동적 추적 거래 시스템이다. 전략은 주로 가격 변동의 비율이 1.91% 이상인 비정상적인 변동 (“검은 천둥 사건”) 을 모니터링하여 신호를 유발하며, EMA144와 EMA169의 교차와 결합하여 트렌드 방향과 퇴출 시간을 확인한다. 전략은 특히 1-3 분 단기 거래에 적합하며, 시장의 급격한 변동 기회를 빠르게 포착할 수 있다.
이 전략의 핵심 논리는 크게 두 가지로 이루어져 있습니다.
전략은 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='平多')