이 전략의 이름은 디트렌드 가격 오스실레이터 양적 거래 전략이다. 이 전략은 디트렌드 가격 오스실레이터 지표를 구축하고 이를 기반으로 거래 신호를 발산함으로써 전형적인 기술 지표 전략에 속한다.
이 전략의 핵심은 가격의 트렌드 오징어 ((DPO) 지표이다. DPO 지표는 이동 평균과 비슷하며, 가격의 더 긴 주기의 트렌드를 제거하여 가격의 주기적 변동이 더 뚜렷하게 나타난다. 구체적으로, DPO 지표는 가격을 N일 간단한 이동 평균과 비교하는 것이다. 가격이 이동 평균보다 높을 때, DPO는 긍정적이며, 가격이 이동 평균보다 낮을 때, DPO는 부정이다.
이 정책은 N을 14로 설정하여 14일 DPO 지표를 구성한다. DPO 지표가 긍정할 때, 다중 신호가 발송되며, DPO 지표가 부정할 때, 공백 신호가 발송된다.
위험을 줄이기 위해 다음과 같은 부분에서 최적화를 고려할 수 있습니다.
이 전략은 가격의 트렌드 오스러 지표에 기반하여 거래 신호를 발산한다. 이 지표는 이동 평균과 비교하여 가격의 긴 주기적 추세를 제거하여 가격의 주기적 특성을 더 분명하게 만든다. 이것은 쉽게 감지되지 않는 거래 기회를 발견하는 데 도움이 된다. 또한 파라미터 선택 민감성, 손실 차단 및 필터링과 같은 문제가 있습니다. 지속적인 최적화를 통해 이 전략의 효과가 크게 향상 될 수 있습니다.
/*backtest
start: 2023-11-16 00:00:00
end: 2023-11-20 08:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 31/03/2017
// The Detrend Price Osc indicator is similar to a moving average,
// in that it filters out trends in prices to more easily identify
// cycles. The indicator is an attempt to define cycles in a trend
// by drawing a moving average as a horizontal straight line and
// placing prices along the line according to their relation to a
// moving average. It provides a means of identifying underlying
// cycles not apparent when the moving average is viewed within a
// price chart. Cycles of a longer duration than the Length (number
// of bars used to calculate the Detrend Price Osc) are effectively
// filtered or removed by the oscillator.
//
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="Detrended Price Oscillator", shorttitle="DPO")
Length = input(14, minval=1)
Series = input(title="Price", defval="close")
reverse = input(false, title="Trade reverse")
hline(0, color=green, linestyle=line)
xPrice = close
xsma = sma(xPrice, Length)
nRes = xPrice - xsma
pos = iff(nRes > 0, 1,
iff(nRes < 0, -1, nz(pos[1], 0)))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1, 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(nRes, color=red, title="Detrended Price Oscillator")