
이 전략은 유동성 가중 이동 평균을 기반으로 하는 거래 시스템입니다. 가격 변동과 거래량 간의 관계를 모니터링하여 시장 유동성을 측정하고 이를 기반으로 빠르고 느린 이동 평균을 구성합니다. 빠른 선이 느린 선을 위로 교차할 때 매수 신호가 생성되고, 아래로 교차할 때 매도 신호가 생성됩니다. 이 전략은 비정상적인 유동성 사건에 특별한 주의를 기울이고 배열을 통해 주요 가격 포인트를 기록하여 더 정확한 거래 기회를 제공합니다.
전략의 핵심은 거래량과 가격 변화율의 비율을 통해 시장 유동성을 측정하는 것입니다. 구체적인 구현 단계는 다음과 같습니다.
이는 유동성 분석과 기술 지표를 결합한 혁신적인 전략으로, 시장 유동성 이상 현상을 모니터링하여 기존의 이동평균선 교차 시스템을 최적화합니다. 특정 시장 환경에서는 좋은 성과를 보이지만 안정성과 적용성을 개선하기 위해서는 추가 최적화가 필요합니다. 트레이더는 실시간 사용에 앞서 충분한 테스트를 수행하고 다른 지표와 결합하여 보다 완전한 트레이딩 시스템을 구축하는 것이 좋습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-16 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//Liquidity ignoring price location
//@version=6
strategy("Liquidity Weighted Moving Averages [AlgoAlpha]", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=3)
// Inputs
outlierThreshold = input.int(10, "Outlier Threshold Length")
fastMovingAverageLength = input.int(50, "Fast MA Length")
slowMovingAverageLength = input.int(100, "Slow MA Length")
start_date = input(timestamp("2018-01-01 00:00"), title="Start Date")
end_date = input(timestamp("2069-12-31 23:59"), title="End Date")
// Define liquidity based on volume and price movement
priceMovementLiquidity = volume / math.abs(close - open)
// Calculate the boundary for liquidity to identify outliers
liquidityBoundary = ta.ema(priceMovementLiquidity, outlierThreshold) + ta.stdev(priceMovementLiquidity, outlierThreshold)
// Initialize an array to store liquidity values when they cross the boundary
var liquidityValues = array.new_float(5)
// Check if the liquidity crosses above the boundary and update the array
if ta.crossover(priceMovementLiquidity, liquidityBoundary)
array.insert(liquidityValues, 0, close)
if array.size(liquidityValues) > 5
array.pop(liquidityValues)
// Calculate the Exponential Moving Averages for the close price at the last liquidity crossover
fastEMA = ta.ema(array.size(liquidityValues) > 0 ? array.get(liquidityValues, 0) : na, fastMovingAverageLength)
slowEMA = ta.ema(array.size(liquidityValues) > 0 ? array.get(liquidityValues, 0) : na, slowMovingAverageLength)
// Trading Logic
in_date_range = true
buy_signal = ta.crossover(fastEMA, slowEMA) and in_date_range
sell_signal = ta.crossunder(fastEMA, slowEMA) and in_date_range
// Strategy Entry and Exit
if (buy_signal)
strategy.entry("Buy", strategy.long)
if (sell_signal)
strategy.close("Buy")
// Plotting
fastPlot = plot(fastEMA, color=fastEMA > slowEMA ? color.new(#00ffbb, 50) : color.new(#ff1100, 50), title="Fast EMA")
slowPlot = plot(slowEMA, color=fastEMA > slowEMA ? color.new(#00ffbb, 50) : color.new(#ff1100, 50), title="Slow EMA")
// Create a fill between the fast and slow EMA plots with appropriate color based on crossover
fill(fastPlot, slowPlot, fastEMA > slowEMA ? color.new(#00ffbb, 50) : color.new(#ff1100, 50))