
이 전략은 잘 알려지지 않은 코포크 곡선 기술 지표를 활용하여 거래량을 달성합니다. 코포크 곡선은 스탠퍼드 500 지수 또는 거래 대상의 변화율의 중화 이동 평균을 계산하여 파생됩니다. 코포크 곡선 상단에 0선을 통과하면 구매 신호가 발생하고 0선을 통과하면 판매 신호가 발생합니다.
이 전략은 코포크 곡선을 거래 신호를 생성하는 기술 지표로 사용합니다. 코포크 곡선의 계산 공식은 다음과 같습니다.
코포크 곡선 = 10주기 가중 이동 평균 ((14주기 변화율 ROC + 11주기 변화율 ROC)
여기서 변화율 ROC의 계산 공식은: ((현재의 Close - N주기 전의 Close) / N주기 전의 Close
이 전략은 $SPY의 종식 가격을 기반으로 코포크 곡선을 계산한다. 곡선이 0선을 통과하면 구매 신호가 발생하고 0선을 통과하면 판매 신호가 발생한다.
이 전략은 코포크 곡선의 고유한 곡선 형태 특성을 활용하여 거래 신호를 생성한다. 일반적인 지표에 비해 코포크 곡선은 더 강한 예측력을 가지고 있다. 그러나 독립적인 지표로서의 신뢰성은 여전히 검증되어야 하며, 다른 요소와 조합하여 가짜 신호를 필터링하는 것이 좋습니다.
/*backtest
start: 2023-10-13 00:00:00
end: 2023-11-12 00:00:00
period: 1d
basePeriod: 1h
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/
// © RolandoSantos
//@version=4
strategy(title = "Coppock Curve", shorttitle = "Copp Curve Strat", default_qty_type=strategy.cash, default_qty_value=10000, initial_capital=10000)
///trail stop
longTrailPerc = input(title="Trail Long Loss (%)", minval=0.0, step=0.1, defval=100) * 0.01
// Determine trail stop loss prices
longStopPrice = 0.0
longStopPrice := if (strategy.position_size > 0)
stopValue = close * (1 - longTrailPerc)
max(stopValue, longStopPrice[1])
else
0
//Use SPY for Copp Curve entries and exits//
security = input("SPY")
ticker = security(security, "D", close)
///Copp Curve////
wmaLength = input(title="WMA Length", type=input.integer, defval=10)
longRoCLength = input(title="Long RoC Length", type=input.integer, defval=14)
shortRoCLength = input(title="Short RoC Length", type=input.integer, defval=11)
source = ticker
curve = wma(roc(source, longRoCLength) + roc(source, shortRoCLength), wmaLength)
///Lower Band Plot///
band1 = hline(0)
band0 = hline(100)
band2 = hline(-100)
fill(band1, band0, color=color.green, transp=90)
fill(band2, band1, color=color.red, transp=90)
plot(curve, color=color.white)
///Trade Conditions///
Bull = curve > 0
Bear = curve < 0
///Entries and Exits//
if (Bull)
strategy.entry("Long", strategy.long, comment = "LE")
if (Bear)
strategy.close("Long", qty_percent=100, comment="close")
// Submit exit orders for trail stop loss price
if (strategy.position_size > 0)
strategy.exit(id="Long Trail Stop", stop=longStopPrice)