
この戦略は、流動性加重移動平均に基づいた取引システムです。価格変動と取引量の関係を監視することで市場の流動性を測定し、これに基づいて高速移動平均と低速移動平均を構築します。高速ラインが低速ラインを上回ったときに買いシグナルが生成され、低速ラインを下回ったときに売りシグナルが生成されます。この戦略は、異常な流動性イベントに特別な注意を払い、配列を通じて重要な価格ポイントを記録するため、より正確な取引機会が提供されます。
この戦略の中核は、取引量と価格変動の比率を通じて市場の流動性を測定することです。具体的な実装手順は次のとおりです。
これは、流動性分析とテクニカル指標を組み合わせた革新的な戦略であり、市場の流動性の異常を監視することで従来の移動平均クロスオーバー システムを最適化するものです。特定の市場環境では良好なパフォーマンスを発揮しますが、安定性と適用性を向上させるには、さらに最適化が必要です。トレーダーはリアルタイムで使用する前に十分なテストを実施し、他のインジケーターと組み合わせてより完全な取引システムを構築することをお勧めします。
/*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))