이 전략은 Voss 예측 필터와 Ehlers 순간 트렌드 라인 지표를 사용하여 시장의 주기적 전환점을 식별하여 거래량을 구현합니다. Voss 필터는 구매/판매 신호를 사전에 발송 할 수 있으며, 순간 트렌드 라인 지표는 전체적인 트렌드 방향을 판단하여 트렌드 시장에서 Voss 필터의 오해를 줄이는 데 사용됩니다. 이 전략은 비트코인과 같은 주기적으로 더 명백한 품종에 적용되며, 회고 측정에서 더 잘 수행됩니다.
보스는 John F. Ehlers의 A Peek Into The Future에서 필터를 예측했다. 필터의 계산 공식은 다음과 같다:
_filt = 0.5 * _s3 * _x1 + _f1 * _s2 * _filt[1] - _s1 * _filt[2]
_voss = _x2 * _filt - _sumC
그 중 하나는_x1은 가격의 1차분입니다._x2은 평평함수입니다._s1、_s2、_s3은 필러 파동 변수입니다._f1은 주기 변수입니다._filt은 필터링 결과입니다._최종 출력으로 voss.
이 필터는 평형 필터로 볼 수 있으며, 현재와 지난 몇 번의 정보를 강조하여 사전에 구매/판매 신호를 낸다. 내재된 그룹 지연으로 인해, 그것은 마치 이 미래의 을 보는 것처럼 다른 지표보다 먼저 예측 신호를 낸다.
순간 트렌드 라인 지표는 다음과 같은 공식으로 계산된다:
_it = (_a-((_a*_a)/4.0))*_src+0.5*_a*_a*_src[1]-(_a-0.75*_a*_a)*_src[2]+2*(1-_a)*nz(_it[1])+-(1-_a)*(1-_a)*nz(_it[2])
이 지표는 가격과 가장 잘 일치하는 트렌드 라인을 실시간으로 그리며, 트렌드 방향과 강점을 정확하게 판단할 수 있다.
Voss이 마이너스 전환을 통해 정렬되고, 상단파를 통과하면 구매 신호가 발생한다.
Voss이 양변에서 음변으로, 아래로 필러 파운드를 통과하면 팔기 신호가 발생한다.
또한, 트렌드 라인 지표가 트렌드 방향을 확인했을 때만 거래 신호가 발송됩니다. 이것은 트렌드 시장에서 Voss 필터가 발산할 수 있는 잘못된 신호를 필터링 할 수 있습니다.
위험은 다음과 같은 방법으로 줄일 수 있습니다.
이 전략은 다음과 같은 측면에서 최적화될 수 있습니다.
이 전략은 포스 필터와 트렌드 지표를 통합하여 시장의 주기적 반전점을 효과적으로 식별할 수 있다. 최적화 파라미터를 통해 위험을 제어하여 이 전략은 안정적인 양적 거래 시스템을 달성할 수 있다. 이는 명백한 주기적 성질을 가진 품종에 널리 적용될 수 있으며, 회계 평가에서 좋은 거래 효과를 보여왔다. 전체적으로 이 전략은 독특한 예측 능력을 가지고 있으며, 다방면에서 최적화할 수 있으며, 광범위한 응용 전망을 가지고 있다.
/*backtest
start: 2023-08-19 00:00:00
end: 2023-09-18 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// A Peek Into the Future
// John F. Ehlers
// TASC Aug 2019
// Created by e2e4mfck for tradingview.com
// Modified by © Bitduke
//@version=4
//strategy("Voss Strategy (Filter + IT)", overlay=false, calc_on_every_tick=false,pyramiding=0, default_qty_type=strategy.cash,default_qty_value=1000, currency=currency.USD, initial_capital=1000,commission_type=strategy.commission.percent, commission_value=0.075)
// voss filter
source = input(close, type = input.source)
period = input(20, type = input.integer)
predict = input(4, type = input.integer)
bandwidth = input(0.25, type = input.float)
// it trendline
src = input(hl2, title="Source IT")
a = input(0.07, title="Alpha", step=0.01)
fr = input(false, title="Fill Trend Region")
ebc = input(false, title="Enable barcolors")
hr = input(false, title="Hide Ribbon")
voss_filter (_period, _predict, _bandwidth, _source) =>
float _filt = 0, float _sumC = 0, float _voss = 0
_PI = 2 * asin(1)
_order = 3 * _predict
_f1 = cos(2 * _PI / _period)
_g1 = cos(_bandwidth * 2 * _PI / _period)
_s1 = 1 / _g1 - sqrt(1 / (_g1 * _g1) - 1)
_s2 = 1 + _s1
_s3 = 1 - _s1
_x1 = _source - _source[2]
_x2 = (3 + _order) / 2
for _i = 0 to (_order - 1)
_sumC := _sumC + ((_i + 1) / _order) * _voss[_order - _i]
if bar_index <= _order
_filt := 0
_voss := 0
else
_filt := 0.5 * _s3 * _x1 + _f1 * _s2 * _filt[1] - _s1 * _filt[2]
_voss := _x2 * _filt - _sumC
[_voss, _filt]
[Voss, Filt] = voss_filter(period, predict, bandwidth, source)
instantaneous_trendline (_src, _a, _freq, _ebc, _hr) =>
_it = 0.0
_it := (_a-((_a*_a)/4.0))*_src+0.5*_a*_a*_src[1]-(_a-0.75*_a*_a)*_src[2]+2*(1-_a )*nz(_it[1], ((_src+2*_src[1]+_src[2])/4.0))-(1-_a)*(1-_a)*nz(_it[2], ((_src+2*_src[1]+_src[2])/4.0))
_lag = 2.0*_it-nz(_it[2])
[_it, _lag]
[it, lag] = instantaneous_trendline(src, a, fr, ebc, hr)
// - - - - - - - - - - //
plot(Filt, title = "Filter", style = plot.style_line, color = color.red, linewidth = 2)
plot(Voss, title = "Voss", style = plot.style_line, color = color.blue, linewidth = 2)
hline(0.0, title = "Zero", linestyle = hline.style_dashed, color = color.black, linewidth = 1)
plot(hr? na:it, title="IT Trend", color= fr? color.gray : color.red, linewidth=1)
plot(hr? na:lag, title="IT Trigger", color=fr? color.gray : color.blue, linewidth=1)
// Strategy Logic
longCondition = lag < it and crossover(Voss,Filt)
shortCondition = it > lag and crossover(Filt,Voss)
strategy.entry("Voss_Short", strategy.short, when=shortCondition)
strategy.entry("Voss_Long", strategy.long, when=longCondition)
// === Backtesting Dates === thanks to Trost
testPeriodSwitch = input(true, "Custom Backtesting Dates")
testStartYear = input(2019, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testStartHour = input(0, "Backtest Start Hour")
testPeriodStart = timestamp(testStartYear, testStartMonth, testStartDay, testStartHour, 0)
testStopYear = input(2020, "Backtest Stop Year")
testStopMonth = input(2, "Backtest Stop Month")
testStopDay = input(29, "Backtest Stop Day")
testStopHour = input(0, "Backtest Stop Hour")
testPeriodStop = timestamp(testStopYear, testStopMonth, testStopDay, testStopHour, 0)
testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false
testPeriod_1 = testPeriod()
isPeriod = true
// === /END
if not isPeriod
strategy.cancel_all()
strategy.close_all()