
개요: 이것은 파동 지표를 사용하여 트렌드를 추적하는 전략이다. 평균 가격의 지수 이동 평균과 절대 가격 차이의 이동 평균을 계산하여 파동선을 얻는다. 전략은 파동선이 과매도 과매도 영역과 교차하는 것을 모니터링하여 거래 신호를 생성한다. 동시에 일률 필터링과 거래량 필터를 결합하여 잘못된 신호를 피한다.
전략적 원칙:
평균값을 계산해 ap = ((최고 가격 + 최저 가격 + 폐지 가격) / 3
n1주기의 ap의 EMA를 계산하고, esa를 얻는다.
ap와 esa의 절대차이의 n1주기 EMA를 계산하고, d를 얻는다
파도선을 계산해: ci=(ap-esa) /(0.015*d)
n2 주기ci의 EMA를 계산하여 최종 파도선 tci, 즉wt1을 얻는다.
wt1의 4주기 SMA를 계산하여, wt2를 얻습니다.
오버 바이 지역과 오버 셀 지역 obLevel1/2와 osLevel1/2의 수평선을 그리기
wt1 위를 obLevel2 라인을 통과할 때 구매 신호가 발생; wt1 아래를 osLevel2 라인을 통과할 때 판매 신호가 발생
평균 라인 emaFilter와 거래량 volumeFilter를 필터 조건으로 추가하여 잘못된 신호를 방지합니다.
입금 후, 정지 Stop Loss 비율을 설정하고, 포지션을 종료합니다
우위 분석:
파동선은 다공간 변환을 더 잘 처리하여 트렌드를 효과적으로 잡을 수 있습니다.
평균선과 거래량 이중 필터링을 결합하여 높은 신뢰도
단일 지표의 한계를 피하는 다중 매개 변수 계산
스톱 스톱 손실을 설정하여 수익의 일부를 잠금하고 위험을 효과적으로 제어합니다.
위험과 단점:
매개 변수 선택은 어떤 경우에 부실 성능 또는 과다 적합으로 이어질 수 있습니다.
최적의 변수 선택에 대한 명확한 지침이 없으며, 시도와 오류가 필요합니다.
더 넓은 시장 조건이 신호에 포함되지 않았습니다.
제한된 범위 또는 변동하는 시장에서 사용할 경우 불꽃놀이 효과가 발생할 위험이 있습니다.
이윤/손실 이외에 탈퇴 규칙이 없는 경우
최적화 방향:
다양한 시간 프레임과 자산에서 최적의 값을 찾기 위해 매개 변수 집합을 테스트합니다.
변동성 지표와 결합하여 낮은 변동성 기간 동안 신호를 피합니다.
신호의 정확성을 높이기 위해 RSI와 같은 추가 지표를 추가합니다.
특정 자산에 대한 최적의 변수를 찾는 기계 학습 모델을 구축합니다.
트래킹 스톱을 추가하거나 급격한 변동성 확장 이벤트에 기반한 탈퇴를 강화하는 탈퇴
결론:
이것은 파동선과 보조 지표 디자인을 결합한 전략이다. 그것은 파동선을 사용하여 트렌드 전환을 효과적으로 식별하는 특징을 가지고 있으며, 평균선과 거래량 필터링을 사용하여 잘못된 신호를 피하여 중장선 트렌드를 대부분 얻을 수 있다. 동시에 스톱 스톱 손실을 사용하여 위험을 제어 할 수 있다. 최적화 할 수있는 공간이 넓고, 더 많은 지표와 결합 된 파라미터 조합을 조정하여 기계 학습과 같은 방법을 계속 개선함으로써 전략이 더 많은 품종과 주기에서 더 잘 작동 할 수 있습니다.
/*backtest
start: 2023-12-31 00:00:00
end: 2024-01-30 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bush Strategy test", shorttitle="Nique Audi", overlay=false)
// Paramètres
n1 = input(10, title="Channel Length")
n2 = input(21, title="Average Length")
obLevel1 = input(60, title="Over Bought Level 1")
obLevel2 = input(53, title="Over Bought Level 2")
osLevel1 = input(-65, title="Over Sold Level 1")
osLevel2 = input(-60, title="Over Sold Level 2")
takeProfitPercentage = input(1, title="Take Profit (%)")
stopLossPercentage = input(0.50, title="Stop Loss (%)")
// Calculs
ap = hlc3
esa = ta.ema(ap, n1)
d = ta.ema(math.abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ta.ema(ci, n2)
wt1 = tci
wt2 = ta.sma(wt1, 4)
// Tracé des lignes
plot(0, color=color.gray)
plot(obLevel1, color=color.red)
plot(osLevel1, color=color.green)
plot(obLevel2, color=color.red, style=plot.style_line)
plot(osLevel2, color=color.green, style=plot.style_line)
plot(wt1, color=color.green)
plot(wt2, color=color.red, style=plot.style_line)
// Tracé de la différence entre wt1 et wt2 en bleu
hline(0, "Zero Line", color=color.gray)
// Conditions d'entrée long et court
longCondition = ta.crossover(wt1, obLevel2)
shortCondition = ta.crossunder(wt1, osLevel2)
// Tracé des signaux d'achat et de vente
plotshape(series=longCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(series=shortCondition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")
// Conditions d'entrée et de sortie
strategy.entry("Long", strategy.long, when=longCondition)
strategy.entry("Short", strategy.short, when=shortCondition)
// Niveaux de prise de profit pour les positions longues et courtes
longTakeProfitLevel = strategy.position_avg_price * (1 + takeProfitPercentage / 100)
shortTakeProfitLevel = strategy.position_avg_price * (1 - takeProfitPercentage / 100)
// Vérification si les niveaux de prise de profit sont atteints
longTakeProfitReached = strategy.position_size > 0 and high >= longTakeProfitLevel
shortTakeProfitReached = strategy.position_size < 0 and low <= shortTakeProfitLevel
// Tracé des formes de prise de profit
plotshape(series=longTakeProfitReached, style=shape.xcross, location=location.belowbar, color=color.blue, size=size.small, title="Take Profit Long")
plotshape(series=shortTakeProfitReached, style=shape.xcross, location=location.abovebar, color=color.blue, size=size.small, title="Take Profit Short")
// Niveaux de stop loss pour les positions longues et courtes
longStopLossLevel = strategy.position_avg_price * (1 - stopLossPercentage / 100)
shortStopLossLevel = strategy.position_avg_price * (1 + stopLossPercentage / 100)
// Vérification si les niveaux de stop loss sont atteints
longStopLossReached = strategy.position_size > 0 and low <= longStopLossLevel
shortStopLossReached = strategy.position_size < 0 and high >= shortStopLossLevel
// Tracé des formes de stop loss
plotshape(series=longStopLossReached, style=shape.xcross, location=location.belowbar, color=color.red, size=size.small, title="Stop Loss Long")
plotshape(series=shortStopLossReached, style=shape.xcross, location=location.abovebar, color=color.red, size=size.small, title="Stop Loss Short")
// Fermeture des positions en cas de prise de profit ou de stop loss
strategy.close("Long", when=longTakeProfitReached or longStopLossReached)
strategy.close("Short", when=shortTakeProfitReached or shortStopLossReached)