
この戦略は,技術分析のクラシックな均線交差とK線形状認識を組み合わせたスマート取引システムである.戦略は,K線の上下影線と実体との関係を分析し,双均線交差信号を組み合わせて,市場トレンドの転換点の正確なキャプチャを実現する.システムは,価格の動きだけでなく,平均波幅を計算して動的に取引パラメータを調整し,戦略の適応性を向上させる.
この戦略の核心的な論理は,以下の2つの部分に分かれています.
K線形状認識モジュールは,上下影線と実体との比率関係を計算して潜在的反転信号を識別する.システムは,調節可能な影線倍数パラメータ ((wickMultiplier) と実体パーセントパラメータ ((bodyPercentage) を信号品質を最適化するために設定している.K線に条件を満たす長上影線または長下影線が現れたとき,システムは,相応の多行または空行信号を発信する.
双均線交差システムは,14周期と28周期のシンプル・ムービング・アベア (SMA) をトレンド・インジケーターとして採用する.短期平均線が長期平均線を上方から横切るときは多信号を生成し,短期平均線が長期平均線を下方から横切るときは空信号を生成する.
この戦略は,K線形状認識と均線交差システムを組み合わせて,比較的完全な取引意思決定の枠組みを構築している.この戦略の優点は,厳格なシグナルフィルタリング機構と柔軟なパラメータ調節能力にあるが,同時に,パラメータ最適化と市場環境の適応性の問題にも注意する必要がある.継続的な最適化と改善により,この戦略は,異なる市場環境で安定したパフォーマンスを維持することが期待されている.
/*backtest
start: 2024-10-28 00:00:00
end: 2024-11-27 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5 indicator("Wick Reversal Setup", overlay=true)
// Input parameters
wickMultiplier = input.float(3.5, title="Wick Multiplier", minval=0.5, maxval=20)
bodyPercentage = input.float(0.25, title="Body Percentage", minval=0.1, maxval=1.0)
// Calculate the average range over 50 periods
avgRange = ta.sma(high - low, 50)
// Define the lengths of wicks and bodies
bodyLength = math.abs(close - open)
upperWickLength = high - math.max(close, open)
lowerWickLength = math.min(close, open) - low
totalRange = high - low
// Long signal conditions
longSignal = (close > open and upperWickLength >= bodyLength * wickMultiplier and upperWickLength <= totalRange * bodyPercentage) or
(close < open and lowerWickLength >= bodyLength * wickMultiplier and upperWickLength <= totalRange * bodyPercentage) or
(close == open and close != high and upperWickLength >= bodyLength * wickMultiplier and upperWickLength <= totalRange * bodyPercentage) or
(open == high and close == high and totalRange >= avgRange)
// Short signal conditions
shortSignal = (close < open and (high - open) >= bodyLength * wickMultiplier and lowerWickLength <= totalRange * bodyPercentage) or
(close > open and (high - close) >= bodyLength * wickMultiplier and lowerWickLength <= totalRange * bodyPercentage) or
(close == open and close != low and lowerWickLength >= bodyLength * wickMultiplier and lowerWickLength <= totalRange * bodyPercentage) or
(open == low and close == low and totalRange >= avgRange)
// Plot signals
plotshape(series=longSignal, location=location.belowbar, color=color.green, style=shape.labelup, text="Long")
plotshape(series=shortSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="Short")
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sahaj_Beriwal
//@version=5
strategy("My strategy", overlay=true, margin_long=100, margin_short=100)
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
if (longCondition)
strategy.entry("L", strategy.long)
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if (shortCondition)
strategy.entry("S", strategy.short)