
この戦略は、ローソク足チャートのテクニカル分析に基づいた定量的な取引システムであり、主にローソク足の上ヒゲと下ヒゲの合計長さを分析することで潜在的な取引機会を特定します。この戦略の核心は、リアルタイムで計算された影の合計の長さをオフセット調整された移動平均と比較し、影の長さが移動平均を突破したときにロングシグナルを生成することです。この戦略は、単純移動平均 (SMA)、指数移動平均 (EMA)、加重移動平均 (WMA)、および出来高加重移動平均 (VWMA) を含む複数の移動平均タイプを統合し、トレーダーに柔軟なパラメータ選択スペースを提供します。
戦略の中核となるロジックには、次の主要なステップが含まれます。
この戦略は、ローソク足の影の長さという古典的なテクニカル指標を分析し、それを現代の定量的取引手法と組み合わせて、明確なロジックと強力な実用性を備えた取引システムを構築します。この戦略の主な利点は、パラメータの柔軟性と完全なリスク管理にありますが、市場環境への強い依存やパラメータの感度などの制限もあります。多次元インジケーターを導入し、ポジション管理を最適化することで、この戦略にはまだまだ改善の余地があります。全体として、これは強固な基盤と合理的なロジックを備えた定量的な取引戦略であり、さらなる開発と最適化に適しています。
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Daytrading ES Wick Length Strategy", overlay=true)
// Input parameters
ma_length = input.int(20, title="Moving Average Length", minval=1)
ma_type = input.string("VWMA", title="Type of Moving Average", options=["SMA", "EMA", "WMA", "VWMA"])
ma_offset = input.float(10, title="MA Offset (Points)", step=1)
hold_periods = input.int(18, title="Holding Period (Bars)", minval=1)
// Calculating upper and lower wick lengths
upper_wick_length = high - math.max(close, open)
lower_wick_length = math.min(close, open) - low
// Total wick length (upper + lower)
total_wick_length = upper_wick_length + lower_wick_length
// Calculate the moving average based on the selected method
ma = switch ma_type
"SMA" => ta.sma(total_wick_length, ma_length)
"EMA" => ta.ema(total_wick_length, ma_length)
"WMA" => ta.wma(total_wick_length, ma_length)
"VWMA" => ta.vwma(total_wick_length, ma_length)
// Add the offset to the moving average
ma_with_offset = ma + ma_offset
// Entry condition: wick length exceeds MA with offset
long_entry_condition = total_wick_length > ma_with_offset
// Long entry
if (long_entry_condition)
strategy.entry("Long", strategy.long)
// Automatic exit after holding period
if strategy.position_size > 0 and bar_index - strategy.opentrades.entry_bar_index(strategy.opentrades - 1) >= hold_periods
strategy.close("Long")
// Plot the total wick length as a histogram
plot(total_wick_length, color=color.blue, style=plot.style_histogram, linewidth=2, title="Total Wick Length")
// Plot the moving average with offset
plot(ma_with_offset, color=color.yellow, linewidth=2, title="MA of Wick Length (Offset)")