ALMA 크로스오버 전략

저자:차오장, 날짜: 2023-09-23 15:11:02
태그:

전반적인 설명

이 전략은 크로스오버 신호를 생성하기 위해 두 개의 아르노 레고 이동 평균 (ALMA) 을 사용하며, 하나는 빠르고 하나는 느리다. ALMA는 전통적인 MAs에 비해 지연을 줄이고 신호 라인을 매끄럽게합니다. 신호 정확성을 향상시키기 위해 볼륨 필터가 추가됩니다. 암호화폐에 최적화되었지만 다른 도구에 조정 될 수 있습니다. 경고가 포함되어 있습니다.

전략 논리

핵심 지표와 규칙은 다음과 같습니다.

  1. 빠른 ALMA: 탈출을 잡기 위한 짧은 기간.

  2. 느린 ALMA: 추세를 측정하기 위한 더 긴 기간

  3. 부피 필터: 짧은 EMA가 긴 EMA를 넘을 때 유효합니다.

  4. 구매 신호: 빠른 ALMA가 느린 ALMA와 볼륨 필터를 통과합니다.

  5. 판매 신호: 빠른 ALMA는 느린 ALMA 아래로 넘습니다.

  6. 짧은 신호: 빠른 ALMA가 느린 ALMA 아래를 통과하고 볼륨 필터가 통과합니다.

  7. 커버 신호: 빠른 ALMA가 느린 ALMA를 가로질러 지나간다.

이 전략은 견고한 신호를 위한 트렌드, 모멘텀 및 볼륨 분석을 결합합니다. ALMA는 뒤떨어진 신호를 줄이고 볼륨은 잘못된 브레이크오프를 피합니다.

장점

전통적인 이동 평균 전략에 비해 주요 장점은 다음과 같습니다.

  1. ALMA는 지연을 줄이고 신호 품질을 향상시킵니다.

  2. 부피 필터는 가짜 파열로 인한 손실을 방지합니다.

  3. 빠른 / 느린 조합은 트렌드 방향을 측정합니다.

  4. 간단하고 직관적인 규칙, 실행하기 쉽습니다.

  5. 다양한 시장에 대한 MA 매개 변수의 유연한 조정.

  6. 합리적인 위험 관리

  7. 매개 변수 조정을 통해 더 많은 최적화 잠재력.

  8. 전체적으로 전통적인 크로스오버 전략에 비해 안정성과 품질이 향상되었습니다.

위험성

그 장점에도 불구하고 다음과 같은 위험 요소가 주목되어야 합니다.

  1. 크로스오버 시스템은 내재적으로 윙사 (wipssaws) 에 취약합니다.

  2. ALMA의 성능은 매개 변수 조정에 달려 있습니다.

  3. 부피가 급격하면 신호 생성에 오류가 생길 수 있습니다.

  4. 어떤 지연은 항상 존재합니다. 모든 손실을 피할 수 없습니다.

  5. 과도한 최적화로 인한 과도한 적합성 위험

  6. 부피가 이상하면 신호가 끊어집니다.

  7. 머신러닝 기술은 더 나은 결과를 가져올 수 있습니다.

  8. 과도한 마취를 피하기 위해 수익/위험 비율을 모니터링합니다.

강화

위험을 해결하기 위해 다음과 같은 분야에서 개선이 가능합니다.

  1. ALMA 매개 변수를 최적화해서 더 민감하게 감지할 수 있게

  2. 다른 부피 측정값을 실험해보세요.

  3. 트레이드당 손해를 제어하기 위해 스톱 로스를 도입합니다.

  4. 강력한 신호를 위한 다른 지표를 포함합니다.

  5. 더 똑똑한 신호 조절을 위해 기계 학습 모듈을 추가합니다.

  6. 전략 다양화를 위해 여러 제품으로 배포합니다.

  7. 다른 시장에 대한 포지션 사이즈 모델 최적화

  8. 부착을 방지하기 위해 견고성을 연구합니다.

결론

결론적으로, 전통적인 크로스오버 전략에 비해, 이 전략은 ALMA 알고리즘과 볼륨 필터를 통해 신호 품질과 견고성을 향상시킵니다. 그러나 전략 최적화는 반복적인 과정입니다. 변화하는 시장에 적응하기 위해 여러 차원에서 전략을 계속 개선하는 것이 중요합니다.


/*backtest
start: 2022-09-16 00:00:00
end: 2023-09-22 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/
// © Sarahann999
// Calculations for TP/SL based off: https://kodify.net/tradingview/orders/percentage-profit/
//@version=5
strategy("ALMA Cross", overlay=true)

//User Inputs
src= (close)
long_entry = input(true, title='Long Entry')
short_entry = input(true, title='Short Entry')

//Fast Settings
ALMA1 = input(100, "ALMA Lenghth 1", group= "ALMA Fast Length Settings")
alma_offset = input.float(defval=0.85, title='Arnaud Legoux (ALMA) - Offset Value', minval=0, step=0.01)
alma_sigma = input.int(defval=6, title='Arnaud Legoux (ALMA) - Sigma Value', minval=0)
Alma1 = ta.alma(src, ALMA1, alma_offset, alma_sigma)

//Slow Settings
ALMA2 = input(120, "ALMA Length 2", group = "ALMA Slow Length Settings")
alma_offset2 = input.float(defval=0.85, title='Arnaud Legoux (ALMA) - Offset Value', minval=0, step=0.01)
alma_sigma2 = input.int(defval=6, title='Arnaud Legoux (ALMA) - Sigma Value', minval=0)
Alma2 = ta.alma(src, ALMA2, alma_offset2, alma_sigma2)

//Volume
var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
    runtime.error("No volume is provided by the data vendor.")
shortlen = input.int(5, minval=1, title = "Short Length", group= "Volume Settings")
longlen = input.int(10, minval=1, title = "Long Length")
short = ta.ema(volume, shortlen)
long = ta.ema(volume, longlen)
osc = 100 * (short - long) / long

//Define Cross Conditions
buy = ta.crossover(Alma1, Alma2)
sell = ta.crossunder(Alma1, Alma2)

//Calculate Take Profit Percentage
longProfitPerc = input.float(title="Long Take Profit", group='Take Profit Percentage',
     minval=0.0, step=0.1, defval=2) / 100
shortProfitPerc = input.float(title="Short Take Profit",
     minval=0.0, step=0.1, defval=2) / 100
     
// Figure out take profit price 1
longExitPrice  = strategy.position_avg_price * (1 + longProfitPerc)
shortExitPrice = strategy.position_avg_price * (1 - shortProfitPerc)

// Make inputs that set the stop %  1
longStopPerc = input.float(title="Long Stop Loss", group='Stop Percentage',
     minval=0.0, step=0.1, defval=2.5) / 100
shortStopPerc = input.float(title="Short Stop Loss",
     minval=0.0, step=0.1, defval=2.5) / 100

// Figure Out Stop Price
longStopPrice  = strategy.position_avg_price * (1 - longStopPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortStopPerc)

//Define Conditions
buySignal = buy and osc > 0
     and strategy.position_size == 0

//sellSignal 
sellSignal = sell and osc > 0
     and strategy.position_size == 0

// Submit entry orders
if buySignal and long_entry
    strategy.entry(id="Long", direction=strategy.long, alert_message="Enter Long")
    alert(message="BUY Trade Entry Alert", freq=alert.freq_once_per_bar)
    
if sellSignal and short_entry
    strategy.entry(id="Short", direction=strategy.short, alert_message="Enter Short")
    alert(message="SELL Trade Entry Alert", freq=alert.freq_once_per_bar)
    
// Submit exit orders based on take profit price
if (strategy.position_size > 0)
    strategy.exit(id="Long TP/SL", limit=longExitPrice, stop=longStopPrice, alert_message="Long Exit 1 at {{close}}")
if (strategy.position_size < 0)
    strategy.exit(id="Short TP/SL", limit=shortExitPrice, stop=shortStopPrice, alert_message="Short Exit 1 at {{close}}")

//Draw
plot(Alma1,"Alma Fast", color=color.purple, style=plot.style_circles)
plot(Alma2,"Alma Slow", color=#acb5c2, style=plot.style_circles)

더 많은