이중 지수 평활화 추세 추종 거래 시스템

EMA ATR RSI AI ML
생성 날짜: 2025-02-10 14:46:36 마지막으로 수정됨: 2025-02-10 14:46:36
복사: 1 클릭수: 335
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

이중 지수 평활화 추세 추종 거래 시스템

개요

이 전략은 혁신적인 트렌드 추적 거래 시스템으로, 시장의 트렌드를 식별하기 위해 이중 인덱스 평준화 기술을 사용합니다. 이 시스템은 가격 데이터를 특수 인덱스 평준화 처리하여 시장의 단기 및 장기 이동을 포착하는 두 가지 트렌드 라인을 생성합니다. 이 시스템은 스톱 스톱 손실 설정 및 유연한 위치 관리 기능을 포함한 전체 위험 관리 모듈을 통합합니다.

전략 원칙

이 전략의 핵심은 고유한 쌍방향 지수 평형 알고리즘이다. 첫째, 이 시스템은 종식 가격에 중점을 두며, 계산 방법은 ((최고 가격 + 최저 가격 + 2*마감 가격) / 4로, 시장 소음의 영향을 줄일 수 있습니다. 그리고 사용자 정의 지수 평준화 함수를 통해 각각 9주기 및 30주기 평준화 곡선을 계산합니다. 단기 곡선이 장기 곡선을 통과하면 거래 신호가 생성됩니다. 상위 횡단은 다중 신호를 생성하고 하위 횡단은 빈 신호를 생성합니다. 시스템에는 또한 백분율 기반의 포지션 관리 시스템이 포함되어 있으며, 기본으로 계좌의 100%의 자금을 사용하여 거래합니다.

전략적 이점

  1. 신호 생성 메커니즘은 명확하고, 고전적인 트렌드 추적 개념을 채택하고, 이해하기 쉽고, 실행하기 쉽습니다.
  2. 이중 계수 평준화 기술은 시장 소음을 효과적으로 필터링하여 신호 품질을 향상시킵니다.
  3. 전체 리스크 관리 시스템, 즉 스톱 스톱 손실 및 포지션 관리 등이 통합되어 있습니다.
  4. 이 시스템은 다양한 시장 환경에 적응할 수 있으며, 여러 종류의 거래에 적합하다.
  5. 시장의 방향을 빠르게 판단할 수 있도록 명확한 시각적 지표를 제공합니다.

전략적 위험

  1. 흔들리는 시장에서 빈번한 잘못된 신호가 발생하여 연속적인 손실을 초래할 수 있다.
  2. 기본적으로 100%의 자금으로 거래하고, 너무 높은 레버리지는 큰 위험을 초래할 수 있습니다.
  3. 고정 점수의 스톱 스톱 손실 설정은 모든 시장 환경에 적합하지 않을 수 있습니다.
  4. 이 시스템은 급격히 변동하는 시장에서 슬라이드 현상이 발생할 수 있으며, 이는 실행의 효과에 영향을 미칠 수 있다.
  5. 과거 테스트 결과는 미래의 성과를 보장하지 않습니다.

전략 최적화 방향

  1. 변동률 지표 ((ATR 같은) 를 도입하여 동적으로 스톱 스톱 손실 지점을 조정한다.
  2. 트렌드 강도 필터를 추가하고, 약한 트렌드 환경에서 거래 빈도를 낮추십시오.
  3. 시장 환경 인식 모듈을 추가하여 흔들리는 시장에서 전략 매개 변수를 자동으로 조정합니다.
  4. 동적 포지션 관리 시스템을 개발하여 시장 상황에 따라 거래 규모를 자동으로 조정합니다.
  5. 기본 분석 모듈을 통합하여 거래 의사 결정의 정확성을 향상시킵니다.

요약하다

이것은 합리적이고 논리적으로 설계된 트렌드 추적 시스템이다. 이중 지수 평준화 기술과 완전한 위험 관리 시스템을 통해 이 전략은 트렌드 시장에서 좋은 성능을 발휘할 수 있다. 그러나 사용자는 자신의 위험 수용 능력에 따라 포지션 크기를 조정할 필요가 있으며, 실물 거래 전에 충분한 재검토를 수행하는 것이 좋습니다.

전략 소스 코드
/*backtest
start: 2024-02-10 00:00:00
end: 2025-02-08 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5  
strategy("Dynamic Trend Navigator AI [CodingView]", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity , default_qty_value=200 )  


// ==================================================================================================  
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/  
// © CodingView_23
//  
// Script Name: Dynamic Trend Navigator  
// Developed by: theCodingView Team  
// Contact: [email protected]  
// Website: www.theCodingView.com  
//  
// Description: Implements an adaptive trend-following strategy using proprietary smoothing algorithms.  
// Features include:  
// - Dual timeframe trend analysis  
// - Custom exponential smoothing technique  
// - Integrated risk management (profit targets & stop-loss)  
// - Visual trend direction indicators  
// ==================================================================================================  



// ====== Enhanced Input Configuration ======  
primaryLookbackWindow = input.int(9, "Primary Trend Window", minval=2)  
secondaryLookbackWindow = input.int(30, "Secondary Trend Window", minval=5)  

// ====== Custom Exponential Smoothing Implementation ======  
customSmoothingFactor(periods) =>  
    smoothingWeight = 2.0 / (periods + 1)  
    smoothingWeight  

adaptivePricePosition(priceSource, lookback) =>  
    weightedSum = 0.0  
    smoothingCoefficient = customSmoothingFactor(lookback)  
    cumulativeWeight = 0.0  
    for iteration = 0 to lookback - 1 by 1  
        historicalWeight = math.pow(1 - smoothingCoefficient, iteration)  
        weightedSum := weightedSum + priceSource[iteration] * historicalWeight  
        cumulativeWeight := cumulativeWeight + historicalWeight  
    weightedSum / cumulativeWeight  

// ====== Price Transformation Pipeline ======  
modifiedClose = (high + low + close * 2) / 4  
smoothedSeries1 = adaptivePricePosition(modifiedClose, primaryLookbackWindow)  
smoothedSeries2 = adaptivePricePosition(modifiedClose, secondaryLookbackWindow)  

// ====== Signal Detection System ======  
trendDirectionUp = smoothedSeries1 > smoothedSeries2 and smoothedSeries1[1] <= smoothedSeries2[1]  
trendDirectionDown = smoothedSeries1 < smoothedSeries2 and smoothedSeries1[1] >= smoothedSeries2[1]  

// ====== Visual Representation Module ======  
plot(smoothedSeries1, "Dynamic Trend Line", #4CAF50, 2)  
plot(smoothedSeries2, "Market Phase Reference", #F44336, 2)  

// ====== Risk Management Configuration ======  
enableRiskParameters = input.bool(true, "Activate Risk Controls")  
profitTargetUnits = input.float(30, "Profit Target Points")  
lossLimitUnits = input.float(30, "Stop-Loss Points")  

// ====== Position Management Logic ======  
var float entryPrice = na  
var float profitTarget = na  
var float stopLoss = na  

// ====== Long Position Logic ======  
if trendDirectionUp  
    strategy.close("Short", comment="Short Close")  
    strategy.entry("Long", strategy.long)  
    entryPrice := close  
    profitTarget := close + profitTargetUnits  
    stopLoss := close - lossLimitUnits  

if enableRiskParameters  
    strategy.exit("Long Exit", "Long", limit=profitTarget, stop=stopLoss)  

// ====== Short Position Logic ======  
if trendDirectionDown  
    strategy.close("Long", comment="Long Close")  
    strategy.entry("Short", strategy.short)  
    entryPrice := close  
    profitTarget := close - profitTargetUnits  
    stopLoss := close + lossLimitUnits  

if enableRiskParameters  
    strategy.exit("Short Exit", "Short", limit=profitTarget, stop=stopLoss)  

// ====== Visual Signals ======  
plotshape(trendDirectionUp, "Bullish", shape.labelup, location.belowbar, #00C853, text="▲", textcolor=color.white)  
plotshape(trendDirectionDown, "Bearish", shape.labeldown, location.abovebar, #D50000, text="▼", textcolor=color.white)  

// ====== Branding Module ======  
var brandingTable = table.new(position.bottom_right, 1, 1)  
if barstate.islast  
    table.cell(brandingTable, 0, 0, "Trading System v2.0", text_color=color.new(#607D8B, 50))