카로베인 평균 역전으로 확장된 정형화된 벡터 전략

저자:차오장, 날짜: 2023-11-03 16:56:13
태그:

img

전반적인 설명

이 전략은 카로베인 평균 반전 지표와 가격 동력을 기반으로 합니다. 트렌드 판단을 위해 가격 동력 보조 지표를 사용하고 특정 엔트리를 위해 카로베인 평균 반전 지표를 결합합니다. 이 전략은 중장기 거래에 적합합니다.

전략 원칙

첫째, 전략은 가격 동력 지표를 얻기 위해 서로 다른 기간에서의 가격 변화 속도를 계산합니다. 가격 동력 지표가 동적 임계선을 넘을 때 긴 신호가 생성됩니다. 아래를 넘을 때 짧은 신호가 생성됩니다.

그 다음 카로베인 평균 반전 지표를 결합하여 특정 진입 시기를 결정합니다. 카로베인 평균 반전 지표는 가격의 평균 반전 성격을 기반으로 계산되며 가격 변동의 가속과 경로를 반영 할 수 있습니다. 이 지표는 트렌드의 방향과 시기를 결정하는 데 도움이되는 본질적인 시누소이드 특성을 가지고 있습니다.

가격 동력 지표가 신호를 생성하면, 카로베인 평균 반전 지표가 해당 방향 영역에 있다면, 입력 신호가 생성됩니다.

장점

  1. 이 전략은 가격 동력과 평균 반전 요인을 포괄적으로 고려하고 있으며, 강력한 트렌드 판단 능력을 가지고 있습니다.

  2. 카로베인 평균 반전 지표는 가격 전환점을 정확하게 파악하고 입시 시기의 정확도를 향상시킬 수 있습니다.

  3. 유지 기간은 매개 변수 조정으로 자유롭게 제어 할 수 있으며, 다양한 시간 프레임에 적합합니다.

  4. 동적 임계값은 시장 변화에 적응적으로 대응하기 위해 실시간으로 조정할 수 있습니다.

위험성

  1. 트렌드를 따라가는 전략으로서, 범위에 묶인 트렌드에 갇히기 쉽다.

  2. 카로베인 평균 반전 지표는 일정 지연을 가지고 있으며, 가격 전환점을 놓칠 수 있습니다.

  3. 과도한 보유 기간으로 인한 손실의 확장을 피하기 위해 보유 기간 매개 변수를 모니터링해야합니다.

  4. 동적 문턱은 너무 넓지 않아야 합니다. 그렇지 않으면 진입 기회를 놓칠 수 있습니다.

대응한 위험 관리 방법:

  1. 트렌드 판단 지표는 시차 시장과 출구 포지션을 예측하는 데 사용될 수 있습니다.

  2. 지연을 줄이기 위해 카로베인 평균 반전 지표에 합리적인 지연을 선택하십시오.

  3. 다른 유지 기간 매개 변수를 테스트하고 적합한 것을 선택하십시오.

  4. 실종된 항목을 방지하기 위해 동적 임계 범위를 조정합니다.

개선 방향

  1. 매개 변수를 최적화하기 위해 가격 동력 계산을 위해 다른 기간을 테스트합니다.

  2. 변동성 지표를 추가하여 시장 범위를 감지하고 스톱 로스를 설정합니다.

  3. 카로베인 평균 반전 지표의 매개 변수를 최적화하여 더 민감하게 만듭니다.

  4. 신호 품질을 향상시키기 위해 볼륨과 같은 추가 필터를 추가합니다.

  5. 매개 변수를 동적으로 최적화하기 위해 기계 학습 알고리즘을 사용합니다.

결론

이 전략은 트렌드 판단 및 신호 생성에서 강력한 기능을 갖춘 가격 동력과 평균 반전 요인을 포괄적으로 활용합니다. 매개 변수 조정을 통해 다른 시장 환경에 적응 할 수 있습니다. 전략을 더 견고하게 만들기 위해 입시 타이밍 및 스톱 손실에 대한 추가 최적화가 수행 될 수 있습니다. 이 전략은 추가 연구와 응용을받을 자격이 있습니다.


/*backtest
start: 2022-10-27 00:00:00
end: 2023-11-02 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
// author: capissimo
strategy("Normalized Vector Strategy, ver.3 (sc)", precision=2, overlay=false)
// This is a scaled Normalized Vector Strategy with a Karobein Oscillator
// original: Drkhodakarami (https://www.tradingview.com/script/Fxv2xFWe-Normalized-Vector-Strategy-By-Drkhodakarami-Opensource/)

// Repainting: in general there two types of repainting:
// * when the last candle is constantly being redrawn
// * when the indicator draws a different configuration after it has been deactivated/reactivated, i.e. refreshed

// The former is a natural behaviour, which presents a constant source of frustration, 
// when a signal directly depends on the current market situation and can be overcome 
// with various indirect techniques like divergence.

// The latter suggests a flaw in the indicator design.
// Unfortunately, the Normalized Vector Strategy is repainting in the latter sense, although being
// really promising. Would be nice if our community suggests a solution to this problem ))

// This strat consistently performs with high accuracy, showing up to 96% scores
// Here are some of the best parameters:
// TF     Lookback   Performance (ca.)
// 1m     13         92%
// 3m     34         92%
// 5m     85         92%
// 15m    210        90%
// 30m    360        89%
// 1H     1440,720   94%, 87%

// The Karobein Oscillator has an intrinsic sinusoidal behaviour that helps in determining direction and timing.
// It does not repaint.
// original: alexgrover (https://www.tradingview.com/script/JiNi0f62-Karobein-Oscillator/)

scaleMinimax(X, p, min, max) => 
    hi = highest(X, p), lo = lowest(X, p)
    (max - min) * (X - lo)/(hi - lo) + min

price    = input(close,  "Price Data")
tf       = input(34,     "Timeframe", minval=1, maxval=1440)
thresh   = input(14.,    "Threshold", minval=.1, step=.1) 
div      = input(1000000,"Divisor", options=[1,10,100,1000,10000,100000,1000000,10000000,100000000])
showVol  = input(false,  "Volume")
useold   = input(true,   "Use Old System")

lime  = color.new(color.lime, 10), fuchsia = color.new(color.fuchsia, 10), 
black = color.new(color.black, 100), gray = color.new(color.gray, 50)

vol  = useold ? security(syminfo.tickerid, tostring(tf), volume, barmerge.gaps_off, barmerge.lookahead_on) 
              : security(syminfo.tickerid, tostring(tf), volume)
obv  = cum(change(price) > 0 ? vol : change(price) < 0 ? -vol : 0*vol)
prix = showVol ? obv : price
    
getdiff(prc, tf) =>
    prev  = useold ? security(syminfo.tickerid, tostring(tf), prc[1], barmerge.gaps_off, barmerge.lookahead_on) :
                     security(syminfo.tickerid, tostring(tf), prc[1])
    curr  = useold ? security(syminfo.tickerid, tostring(tf), prc, barmerge.gaps_off, barmerge.lookahead_on) : 
                     security(syminfo.tickerid, tostring(tf), prc)
    (curr/prev) - 1
    
p  = getdiff(prix, tf)
up = thresh/div, dn = -thresh/div
longCondition  = crossover(p, up)
shortCondition = crossunder(p, dn)

bg = longCondition ? lime : shortCondition ? fuchsia : black
cl = p > up ? color.green : p < dn ? color.red : color.silver

bgcolor(bg, editable=false)
plot(scaleMinimax(up, 2500, -1, 1), color=lime, editable=false, transp=0)
hline(0, linestyle=hline.style_dotted, title="base line", color=gray, editable=false)
plot(scaleMinimax(dn, 2500, -1, 1), color=fuchsia, editable=false, transp=0)
plot(scaleMinimax(p, 2500, -1, 1), color=cl, style=plot.style_histogram, transp=70, editable=false)
plot(scaleMinimax(p, 2500, -1, 1), color=cl, style=plot.style_linebr, title="prediction", transp=0, editable=false)

strategy.entry("L", true, 1, when=longCondition)
strategy.entry("S", false, 1, when=shortCondition)

alertcondition(longCondition, title='Long', message='Long Signal!')
alertcondition(shortCondition, title='Short', message='Short Signal!')

//*** Karobein Oscillator
per  = input(8, "Karobein Osc Lookback")

prix2  = ema(price, per)
a = ema(prix2 < prix2[1] ? prix2/prix2[1] : 0, per)
b = ema(prix2 > prix2[1] ? prix2/prix2[1] : 0, per)
c = (prix2/prix2[1])/(prix2/prix2[1] + b)
d = 2*((prix2/prix2[1])/(prix2/prix2[1] + c*a)) - 1

plot(scaleMinimax(d, 2500, -1, 1), color=color.orange, transp=0)


더 많은