
이 전략은 시장의 극한 변동 기간을 포착하기 위해 특별히 설계된 정량 거래 시스템이다. 가격과 평균선 사이의 오차 정도를 모니터링하여 시장에서 발생할 수 있는 유동성 고갈 상황을 식별하여 시장 역전 기회를 포착한다. 전략은 평균선 조합, 변동률 추적 및 동적 중지 메커니즘을 사용하여 완전한 거래 시스템을 구축한다.
전략의 핵심은 가격과 평균의 편차를 계산하여 시장의 이상성을 식별하는 것이다. 구체적으로 구현하는 것은 다음과 같다:
동적 유동성 계열 캡처 전략은 시장의 극단적인 상황을 캡처하는 데 초점을 맞춘 정량 거래 시스템입니다. 과학적인 지표 조합과 엄격한 위험 통제를 통해 전략은 시장의 급격한 변동이 발생했을 때 거래 기회를 잡을 수 있습니다.
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Liquidation Cascade Strategy", overlay=true)
// Paramètres de l'indicateur de liquidation
var float lastHigh = na
var float lastLow = na
var float lastPriceLow = na
var float lastPriceHigh = na
var bool shortLiq = na
var bool longLiq = na
src = close
maLength1 = 15
maLength2 = 30
ma1 = ta.sma(src, maLength1)
ma2 = ta.ema(src, maLength2)
avgLine = (ma1 + ma2) / 2
distVal = ((src - avgLine) / avgLine) * 100
ph = ta.highest(distVal, 89)
pl = ta.lowest(distVal, 89)
if ph == distVal and ph > 0
lastHigh := distVal
lastPriceHigh := high
if pl == distVal and pl < 0
lastLow := distVal
lastPriceLow := low
shortLiq := not na(lastHigh) and lastHigh == distVal and distVal > 0
longLiq := not na(lastLow) and lastLow == distVal and distVal < 0
// Condition d'achat : 3 liquidations longues consécutives
buyCondition = ta.valuewhen(longLiq, longLiq, 0) and ta.valuewhen(longLiq, longLiq, 1) and ta.valuewhen(longLiq, longLiq, 2)
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Conditions de vente
var float entryPrice = na
var bool positionOpen = false
// Mise à jour du prix d'entrée
if (buyCondition)
entryPrice := close
positionOpen := true
// 1. Vente sur rebond technique (distVal > -1%)
sellCondition1 = distVal > -1 and positionOpen
// 2. Vente sur liquidation courte
sellCondition2 = shortLiq and positionOpen
// 3. Trailing Stop (2x ATR)
atr = ta.atr(14)
trailingStop = close - 2 * atr
sellCondition3 = close < trailingStop and positionOpen
// Exécution des ventes
if (sellCondition1 or sellCondition2 or sellCondition3)
strategy.close("Buy")
positionOpen := false
// Visualisation
plot(avgLine, color=color.blue, title="Avg Line")
plot(distVal, color=distVal > 0 ? color.red : color.green, style=plot.style_columns)