
이 전략은 복합적인 기술 분석 거래 시스템으로, 여러 지표를 통합하여 높은 확률의 파동 거래 기회를 식별합니다. 이 시스템은 주로 SuperTrend 지표를 트렌드 방향 필터로 사용하여 ADX (평균 방향 지수) 와 결합하여 트렌드 강도를 확인하고, 유동성 삼각지대 (Liquidity Delta) 분석을 사용하여 구매 및 판매 압력 불균형을 사용하여 여러 시장 환경에서 정확한 입출자 신호를 생성합니다.
이 전략은 다음의 네 가지 핵심 지표의 연동으로 거래 신호를 형성합니다.
슈퍼 트렌드 지표: 주요 트렌드 방향 필터로서, 최적화 설정을 사용하여 (인수:3.0, ATR 주기:10) 반응성과 신뢰성을 균형 잡는다. 가격이 슈퍼트렌드 선 위에있을 때 상승 추세로 인식하고, 가격이 슈퍼트렌드 선 아래에있을 때 하락 추세로 인식한다.
ADX 지표: 현재 트렌드의 강도를 확인하기 위해 사용되며, 가로판이나 혼란스러운 시장 환경을 필터링한다. 전략은 사용자 정의 구현 방법을 사용하여 실제 파도, 긍정 및 부정적인 방향으로 이동을 계산하여 ADX 값을 생성한다. ADX 값이 설정된 스레드값 (기본 25) 보다 높을 때, 강한 트렌드가 있음을 나타내는 경우, 시스템은 신호 거래를 생성하는 것을 선호합니다.
유동성 델타 지표: 거래량 매매 압력의 불균형을 분석하고, 거래량 매매량을 계산하고, 일련의 표준화 및 부드러운 처리를 통해 최종 델타 값을 얻는다. 델타 값이 긍정적 인 경계를 초과 할 때 더 많은 신호를 발생시키고, 부정적인 경계를 초과 할 때 더 많은 신호를 발생하여 트렌드 방향과 잠재적 인 반전을 검증한다.
PSAR 지표(선택 가능): 트렌드 변화의 추가 확인으로, 신호 필터링을 줄이기 위해 기본으로 종료할 수 있습니다. 가격이 PSAR 지점을 초과하면 상승 추세로 간주되며, 가격이 PSAR 지점을 초과하면 하락 추세로 간주됩니다.
거래 논리는 모든 활성화 된 지표를 조합하여 통합 신호를 생성한다. 모든 지표가 동일한 방향으로 지향 할 때 최종 구매 또는 판매 신호가 생성된다. 예를 들어, PSAR 조건, SuperTrend 조건, ADX 조건 및 유동성 델타 조건이 모두 충족되면만 시스템에서 구매 신호가 생성됩니다. 또한, 전략은 사용자가 거래 방향을 선택할 수 있도록 허용합니다.
이 전략은 다음과 같은 몇 가지 중요한 장점을 가지고 있습니다.
다차원 확인 시스템: 트랜드를 확인하기 위해 다양한 유형의 기술 지표를 통합하여 트렌드, 강도 및 거래량과 같은 여러 차원을 확인하여 가짜 신호의 위험을 크게 줄이고 거래의 정확성을 향상시킵니다.
매우 적응력이 좋다: 전략은 사용자가 거래 방향을 선택하고 특정 지표를 활성화 / 비활성화 할 수 있도록 유연하게 허용하여 시스템이 다양한 시장 조건과 다른 거래 품종에 적응 할 수 있습니다.
엄격한 위험 관리내장된 고정 비율의 중지 및 중지 메커니즘, 각 거래에 미리 정의된 위험 제한과 수익 목표가 있는지 확인하고, 자금을 효과적으로 보호합니다.
실제 거래 비용을 고려하십시오.: 전략 모델에는 수수료 ((0.035%) 와 슬라이드 ((2점) 의 계산이 포함되어 있으며, 이는 재검토 결과를 실제 거래 환경에 더 적합하게 만듭니다.
비주얼 트레이딩 신호: 명확한 구매/판매 신호 화살표를 제공하며, 크기를 사용자 정의하여 차트에서 빠르게 식별할 수 있습니다.
정보 패널: 동적으로 현재 활성화 된 지표와 위험 설정을 표시하고, 전략 실행 상태에 대한 즉각적인 피드백을 제공합니다.
보수적 지위 관리: 매 거래마다 5%의 이득을 포지션 크기로 사용해서 과다 거래로 인한 손실을 방지한다.
이 전략은 포괄적으로 설계되었지만, 다음과 같은 잠재적인 위험들이 있습니다.
매개변수 민감도전략적 성능은 지표의 파라미터 설정, 특히 슈퍼 트렌드 인자 및 ADX 마이너스에 크게 의존합니다. 다른 시장 환경에는 다른 파라미터 최적화가 필요할 수 있습니다. 그렇지 않으면 과다 거래 또는 중요한 기회를 놓칠 수 있습니다.
지연 위험: 여러 가지 이동 평균 지표가 사용됨에 따라 신호가 다소 지연될 수 있으며, 이는 빠르게 변하는 시장에서 적시에 진입하거나 진출하지 못하게 만든다.
연관성 위험: 여러 기술 지표들 사이에 내재적 연관성이 존재할 수 있는데, 이는 겉으로 보기에는 독립적인 확인이 비슷한 수학 모델에 기반한 지표들로부터 나올 수 있다는 것을 의미하며, 여러 가지 확인의 실제 가치를 떨어뜨린다.
과대 최적화 위험: 2021-2033 재검토 기간 동안의 좋은 성능은 반드시 미래 시장에서 똑같이 효과적이라는 것을 의미하지는 않습니다, 특히 이러한 매개 변수가 역사적 데이터에 대한 과도한 최적화의 결과라면 더욱 그렇습니다.
해결책:
이 전략은 다음과 같은 몇 가지 측면에서 최적화될 수 있습니다.
동적 변수 조정: 시장의 변동성에 따라 SuperTrend 인자 및 ADX 하락값을 자동으로 조정하는 메커니즘을 구현하여 전략이 다른 시장 환경에 더 잘 적응할 수 있습니다. 예를 들어, 낮은 변동성 시장에서 작은 SuperTrend 인자를 사용하고 높은 변동성 시장에서 큰 인자를 사용합니다.
시간 필터시간 기반 필터링을 추가하여 암호화폐 시장의 주말이나 외환 시장의 중요한 경제 데이터가 발표되는 것과 같은 알려진 낮은 유동성 또는 높은 변동성 시점에 거래하는 것을 피하십시오.
다중 시간 프레임 분석: 더 높은 시간 프레임의 트렌드 확인을 통합하는 것, 예를 들어, 현재 거래 시간 프레임과 일선 트렌드 방향이 일치하는 경우에만 거래에 진입한다. 이것은 전략의 승률을 크게 향상시킬 수 있다.
지능형 손해 방지 전략: 고정 비율의 스톱을 ATR 또는 지지/저항 지점에 기반한 동적 스톱으로 대체하여 시장의 실제 변동 상황을 더 잘 반영하고 시장 소음으로 촉발되는 스톱을 줄입니다.
입국 필터링 추가RSI 오버 바이 오버 셀 판단이나 브린 벨트 경계 테스트와 같은 필터링 조건을 추가하는 것을 고려할 수 있으며, 더 유리한 가격 수준에서만 입시하여 입시 품질을 향상시킬 수 있습니다.
자금 관리 최적화: 현재 전략의 성과와 시장 상황에 따라 역동적인 포지션 관리를 구현하고, 전략의 성과가 좋으면 포지션을 점진적으로 늘리고, 불확실성이 증가하면 포지션을 줄인다.
기계 학습 강화: 기계 학습 기술을 활용하여 지표의 무게 분배를 최적화하고, 각 지표가 최종 신호 형성에서 중요성을 갖도록 다양한 시장 환경에 따라 자동으로 조정합니다.
다중 지표 동적 트렌드 거래 전략은 SuperTrend, ADX 및 유동성 델타와 같은 여러 기술 지표를 통합하여 다양한 시장 환경에서 파동 거래에 적합한 포괄적이고 유연한 거래 시스템을 구축합니다. 이 전략의 핵심 장점은 다차원 신호 확인 메커니즘과 엄격한 위험 관리 프레임워크로 시장 소음을 효과적으로 필터링하고 거래 자금을 보호 할 수 있습니다. 그러나 사용자는 파라미터 민감성 및 지표 지연과 같은 잠재적인 위험에 주의를 기울이고 정기적으로 전략의 성능을 재평가해야합니다.
동적 변수 조정, 다중 시간 프레임 분석 및 지능형 중단 전략과 같은 제안의 최적화 방향을 구현함으로써 이 시스템은 수익성과 안정성을 더욱 향상시킬 잠재력을 가지고 있습니다. 궁극적으로, 이 전략은 계량 거래자에게 개인 위험 선호 및 시장 관점에 따라 맞춤화 및 확장 할 수있는 견고한 프레임 워크를 제공합니다.
/*backtest
start: 2025-01-27 00:00:00
end: 2025-05-14 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TiamatCrypto
//@version=6
// ====================================================================================
// Multi-Indicator Swing Trading Strategy [TIAMATCRYPTO]v6
// ====================================================================================
// DESCRIPTION:
// This strategy uses a combination of technical indicators to identify swing trading
// opportunities in various markets. The default settings are optimized for daily
// timeframes on cryptocurrency and forex markets.
//
// RECOMMENDED DEFAULT SETTINGS:
// - Trading direction: Both (performs well in trending and ranging markets)
// - Position size: 5% (conservative position sizing to manage risk)
// - Stop Loss: 2% (conservative risk management for capital preservation)
// - Take Profit: 4% (realistic profit target with 1:2 risk-reward ratio)
// - Initial capital: $10,000 (realistic starting account size)
// - Timeframe: 2m (best performance on 2m charts)
// - Testing period: 2021-2033 (provides sufficient sample size of trades)
// ====================================================================================
strategy("Multi-Indicator Swing [TIAMATCRYPTO]v6", overlay=true,
default_qty_type=strategy.percent_of_equity, default_qty_value=5,
initial_capital=10000, commission_type=strategy.commission.percent,
commission_value=0.035, slippage=2)
// === BASIC SETTINGS ===
// Backtesting time period set directly in the code for realistic testing
var startDateInput = timestamp("2021-01-01T00:00:00")
var endDateInput = timestamp("2033-12-31T23:59:59")
var inDateRange = time >= startDateInput and time <= endDateInput
// Trading direction settings
tradeDirection = input.string("Both", "Trading Direction", options=["Long Only", "Short Only", "Both"], group="Basic Settings")
// === INDICATOR SWITCHES ===
// PSAR is now disabled by default
usePSAR = input.bool(false, "Use PSAR", group="Indicator Switches")
useSupertrend = input.bool(true, "Use Supertrend", group="Indicator Switches")
useADX = input.bool(true, "Use ADX", group="Indicator Switches")
useLiquidityDelta = input.bool(true, "Use Liquidity Delta", group="Indicator Switches")
// === INDICATOR SETTINGS SECTION ===
// PSAR Settings
// Default PSAR settings are conservative and work well across multiple markets
psarStart = input.float(0.02, "PSAR Initial Value", minval=0.01, maxval=0.1, step=0.01, group="PSAR Settings")
psarIncrement = input.float(0.02, "PSAR Increment", minval=0.01, maxval=0.1, step=0.01, group="PSAR Settings")
psarMaximum = input.float(0.2, "PSAR Maximum", minval=0.1, maxval=0.5, step=0.05, group="PSAR Settings")
// Supertrend Settings
// Factor 3.0 provides a good balance between sensitivity and false signals
atrPeriod = input.int(10, "SuperTrend ATR Period", minval=1, maxval=50, group="SuperTrend Settings")
factor = input.float(3.0, "SuperTrend Multiplier", minval=1, maxval=10, step=0.1, group="SuperTrend Settings")
// ADX Settings
// ADX threshold of 25 is standard for identifying strong trends
adxLength = input.int(14, "ADX Length", minval=1, maxval=50, group="ADX Settings")
adxThreshold = input.int(25, "ADX Trend Strength Threshold", minval=10, maxval=50, group="ADX Settings")
// Liquidity Delta Settings
// These settings help identify significant volume imbalances for trend confirmation
deltaLength = input.int(14, "Liquidity Delta Length", minval=1, maxval=50, group="Liquidity Delta")
deltaSmooth = input.int(3, "Delta Smoothing", minval=1, maxval=20, group="Liquidity Delta")
deltaThreshold = input.float(0.5, "Delta Signal Threshold", minval=0.1, maxval=5, step=0.1, group="Liquidity Delta")
// Risk Management Settings
// Conservative settings to ensure capital preservation
useStopLoss = input.bool(true, "Use Stop Loss", group="Risk Management")
useTakeProfit = input.bool(true, "Use Take Profit", group="Risk Management")
stopLossPercent = input.float(2.0, "Stop Loss (%)", minval=0.5, maxval=5, step=0.1, group="Risk Management")
takeProfitPercent = input.float(4.0, "Take Profit (%)", minval=1.0, maxval=10, step=0.1, group="Risk Management")
// Visualization Settings
signalSize = input.string("Normal", "Signal Size", options=["Small", "Normal", "Large"], group="Visualization")
buyColor = input.color(color.green, "Buy Signal Color", group="Visualization")
sellColor = input.color(color.red, "Sell Signal Color", group="Visualization")
// === INDICATOR CALCULATIONS ===
// All remaining indicators set to initialize as true when their respective switch is off
// PSAR Calculations
psar = ta.sar(psarStart, psarIncrement, psarMaximum)
psarCondition = not usePSAR or (close > psar)
psarSellCondition = not usePSAR or (close < psar)
// Supertrend Calculations
[supertrendValue, supertrendDirection] = ta.supertrend(factor, atrPeriod)
supertrendCondition = not useSupertrend or (supertrendDirection > 0)
supertrendSellCondition = not useSupertrend or (supertrendDirection < 0)
// ADX Calculations - custom implementation
trueRange = math.max(high - low, math.abs(high - close[1]), math.abs(low - close[1]))
smoothedTrueRange = ta.sma(trueRange, adxLength)
dmPlus = high > high[1] ? math.max(high - high[1], 0) : 0
dmMinus = low[1] > low ? math.max(low[1] - low, 0) : 0
smoothedDmPlus = ta.sma(dmPlus, adxLength)
smoothedDmMinus = ta.sma(dmMinus, adxLength)
diPlus = smoothedTrueRange > 0 ? 100 * smoothedDmPlus / smoothedTrueRange : 0
diMinus = smoothedTrueRange > 0 ? 100 * smoothedDmMinus / smoothedTrueRange : 0
dx = (diPlus + diMinus) > 0 ? math.abs(diPlus - diMinus) / (diPlus + diMinus) * 100 : 0
adxValue = ta.sma(dx, adxLength)
adxCondition = not useADX or (adxValue > adxThreshold)
// Liquidity Delta Calculations
bidVolume = close < open ? volume : volume * (high - close) / (high - low + 0.000001)
askVolume = close > open ? volume : volume * (close - low) / (high - low + 0.000001)
deltaRaw = bidVolume - askVolume
deltaAvg = ta.sma(deltaRaw, deltaLength)
deltaNormalized = deltaAvg / ta.sma(volume, deltaLength)
deltaSmoothed = ta.ema(deltaNormalized, deltaSmooth)
// Delta Signals
bullishDelta = deltaSmoothed > deltaThreshold
bearishDelta = deltaSmoothed < -deltaThreshold
deltaCondition = not useLiquidityDelta or bullishDelta
deltaSellCondition = not useLiquidityDelta or bearishDelta
// === TRADING LOGIC ===
// Buy signal - combination of all active indicators
buySignal = psarCondition and supertrendCondition and adxCondition and deltaCondition
// Sell signal - combination of all active indicators
sellSignal = psarSellCondition and supertrendSellCondition and adxCondition and deltaSellCondition
// Apply trading direction
isLongAllowed = tradeDirection == "Long Only" or tradeDirection == "Both"
isShortAllowed = tradeDirection == "Short Only" or tradeDirection == "Both"
finalBuySignal = buySignal and isLongAllowed
finalSellSignal = sellSignal and isShortAllowed
// === POSITION ENTRY WITH RISK MANAGEMENT ===
// Conservative position management with defined risk parameters
if finalBuySignal and inDateRange
strategy.entry("Long", strategy.long)
// Conditional setting of stop-loss and take-profit
if useStopLoss or useTakeProfit
stopLevel = useStopLoss ? close * (1 - stopLossPercent / 100) : na
takeProfitLevel = useTakeProfit ? close * (1 + takeProfitPercent / 100) : na
strategy.exit("Long Exit", "Long", stop=stopLevel, limit=takeProfitLevel)
if finalSellSignal and inDateRange
strategy.entry("Short", strategy.short)
// Conditional setting of stop-loss and take-profit
if useStopLoss or useTakeProfit
stopLevel = useStopLoss ? close * (1 + stopLossPercent / 100) : na
takeProfitLevel = useTakeProfit ? close * (1 - takeProfitPercent / 100) : na
strategy.exit("Short Exit", "Short", stop=stopLevel, limit=takeProfitLevel)
// === SIGNAL VISUALIZATION ===
// Creating separate signals for different sizes
buySmallSignal = finalBuySignal and signalSize == "Small"
buyNormalSignal = finalBuySignal and signalSize == "Normal"
buyLargeSignal = finalBuySignal and signalSize == "Large"
sellSmallSignal = finalSellSignal and signalSize == "Small"
sellNormalSignal = finalSellSignal and signalSize == "Normal"
sellLargeSignal = finalSellSignal and signalSize == "Large"
// Draw signals for each size
plotshape(buySmallSignal and inDateRange, title="Buy Small", location=location.belowbar, color=buyColor, style=shape.triangleup, size=size.small)
plotshape(buyNormalSignal and inDateRange, title="Buy Normal", location=location.belowbar, color=buyColor, style=shape.triangleup, size=size.normal)
plotshape(buyLargeSignal and inDateRange, title="Buy Large", location=location.belowbar, color=buyColor, style=shape.triangleup, size=size.large)
plotshape(sellSmallSignal and inDateRange, title="Sell Small", location=location.abovebar, color=sellColor, style=shape.triangledown, size=size.small)
plotshape(sellNormalSignal and inDateRange, title="Sell Normal", location=location.abovebar, color=sellColor, style=shape.triangledown, size=size.normal)
plotshape(sellLargeSignal and inDateRange, title="Sell Large", location=location.abovebar, color=sellColor, style=shape.triangledown, size=size.large)
// === INFORMATION PANEL ===
// Building list of active indicators
indList = ""
indList := usePSAR ? indList + "PSAR, " : indList
indList := useSupertrend ? indList + "SuperT, " : indList
indList := useADX ? indList + "ADX, " : indList
indList := useLiquidityDelta ? indList + "Delta" : indList
// Remove last comma if it exists
if str.endswith(indList, ", ")
indList := str.substring(indList, 0, str.length(indList) - 2)
// Building risk management text
riskText = ""
if useStopLoss and useTakeProfit
riskText := str.tostring(stopLossPercent, "#.#") + "% SL, " + str.tostring(takeProfitPercent, "#.#") + "% TP"
else if useStopLoss
riskText := str.tostring(stopLossPercent, "#.#") + "% SL"
else if useTakeProfit
riskText := str.tostring(takeProfitPercent, "#.#") + "% TP"
else
riskText := "Disabled"
// Display strategy information
var table infoTable = table.new(position.top_right, 2, 5, border_width=1)
table.cell(infoTable, 0, 0, "Strategy:", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 1, 0, "Multi-Indicator Swing", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 0, 1, "Period:", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 1, 1, "2021-2023", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 0, 2, "Direction:", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 1, 2, tradeDirection, bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 0, 3, "Indicators:", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 1, 3, indList, bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 0, 4, "Risk Management:", bgcolor=color.new(color.blue, 90), text_color=color.white)
table.cell(infoTable, 1, 4, riskText, bgcolor=color.new(color.blue, 90), text_color=color.white)