
この戦略は,ベクトルチャート (Vector Candles) の概念を,伝統的なチャネルブレークアウト (Channel Breakout) とチョコレートソース (Chocolate Sauce, ChoCH) のパターンの認識と組み合わせて,市場の突破行動を捉えることを目的としています.この戦略は,前K線の高低点と,交差量の拡大されたベクトルチャートと組み合わせた,前K線の高低点との比較を収集することによって,信号を確認し,同時に,一定数の確認K線をノイズをフィルターするために使用します.
この戦略は,ベクトルフィルタをクラシックなチャネルブレイクとChoCHモデルと組み合わせて,カラー区分とK線メカニズムを確認することで,信号の信頼性と認識度を向上させる.戦略の優点は,規則の明確性,信号の直感性であり,一定の柔軟性と最適化可能なスペースがあることである.しかしながら,戦略には,市場のトレンドの把握が不足し,ストップダスト管理の欠如など,いくつかの制限とリスクがある.将来,トレンドの確認,範囲取引,パラメータの最適化,リスク管理などから戦略を完善して,より安定した取引パフォーマンスを得ることができる.
/*backtest
start: 2024-02-01 00:00:00
end: 2024-02-29 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Custom ChoCH and BOS Strategy with Vector Candles", overlay=true)
// Input Parameters
length = input(10, title="Lookback Length for Volume")
volMultiplier = input(2.0, title="Volume Multiplier for Vector Candles")
confirmationCandles = input(3, title="Confirmation Candles")
// Calculate the average volume of the last 'length' candles
avgVol = sma(volume, length)
// Vector Candle Definitions
vectorCandleRed = (close < open) and (volume > avgVol * volMultiplier) ? 1.0 : 0.0
vectorCandleGreen = (close > open) and (volume > avgVol * volMultiplier) ? 1.0 : 0.0
vectorCandleBlue = (close < open) and (volume > avgVol * 1.5) ? 1.0 : 0.0 // 150% volume for blue
vectorCandlePurple = (close > open) and (volume > avgVol * 1.5) ? 1.0 : 0.0 // 150% volume for purple
// Detecting BOS and ChoCH
isRedChoCH = vectorCandleRed > 0 and (close < low[1]) // Red ChoCH
isGreenBOS = vectorCandleGreen > 0 and (close > high[1]) // Green BOS
// Confirmation Logic
redChoCHConfirmed = (sum(vectorCandleRed, confirmationCandles) >= 2) ? 1.0 : 0.0
greenBOSConfirmed = (sum(vectorCandleGreen, confirmationCandles) >= 2) ? 1.0 : 0.0
// Entry Conditions
buyCondition = redChoCHConfirmed > 0
sellCondition = greenBOSConfirmed > 0
// Strategy Execution
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.close("Buy")
// Plotting Vector Candles and Signals
plotshape(series=isRedChoCH, title="Red ChoCH Signal", location=location.belowbar, color=color.red, style=shape.circle, text="Red ChoCH")
plotshape(series=isGreenBOS, title="Green BOS Signal", location=location.abovebar, color=color.green, style=shape.circle, text="Green BOS")
// Plotting Vector Candles for Visualization
plotchar(vectorCandleRed > 0, title="Vector Candle Red", location=location.belowbar, color=color.red, char='R', text="Red")
plotchar(vectorCandleGreen > 0, title="Vector Candle Green", location=location.abovebar, color=color.green, char='G', text="Green")
plotchar(vectorCandleBlue > 0, title="Vector Candle Blue", location=location.belowbar, color=color.blue, char='B', text="Blue")
plotchar(vectorCandlePurple > 0, title="Vector Candle Purple", location=location.abovebar, color=color.purple, char='P', text="Purple")