
이 전략은 벡터 (Vector Candles) 의 개념을 전통적인 채널 브레이크 (Channel Breakout) 와 초콜릿 소스 (Chocolate Sauce, ChoCH) 모형의 인식과 결합하여 시장의 돌파행위를 포착하는 것을 목표로 한다. 전략은 상가 가격과 전 K 선의 높낮이를 비교하여 신호를 확인하고, 합성 교역을 확대하는 벡터 (Vector Candles) 을 결합하여 소음을 필터링하는 데 사용하며, 특정 수의 확인 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")