
이 전략은 부린 띠 통로의 회귀 돌파 전략에 기초한다. 가격이 부린 띠 통로의 하향 궤도를 넘어갈 때, 장거리 입장을 취한다.
이 전략은 20주기의 린 띠 통로를 사용한다. 린 띠 통로는 중도, 상도, 하도로 구성된다. 중도는 20주기의 간단한 이동 평균이며, 상도는 중도 더하기 표준 차이의 2배로 구성되며, 하도는 중도 빼기 표준 차이의 2배로 구성된다.
가격이 하락할 때, 가격이 초매 상태에 들어간 것을 나타냅니다. 이 때 장점 입장이 수행됩니다. 입장 후, 중지 가격은 입구 때 K 선의 최저 가격으로 설정되며, 정지 목표는 브린 밴드입니다. 이렇게, 전략은 가격이 초매 상태에서 평행선으로 돌아오는 과정을 쫓아 수익을 창출하는 것입니다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
이 전략은 전체적인 아이디어는 명확하고 어느 정도 동작성이 있다. 그러나 브린띠를 이용하여 과매매를 판단하는 시간효율은 높지 않으며, 가격 경향을 완벽하게 판단할 수 없다. 또한, 중지 중지 손실 메커니즘도 최적화되어야 한다. 이후에는 보다 정확한 지표, 최적화 파라미터 및 중지 중지 손실 메커니즘을 개선하는 측면에서 최적화하여 전략 수익성을 향상시킬 수 있다.
/*backtest
start: 2023-01-15 00:00:00
end: 2024-01-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Ronsword
//@version=5
strategy("bb 2ND target", overlay=true)
// STEP 1. Create inputs that configure the backtest's date range
useDateFilter = input.bool(true, title="Filter Date Range of Backtest",
group="Backtest Time Period")
backtestStartDate = input(timestamp("1 Jan 1997"),
title="Start Date", group="Backtest Time Period",
tooltip="This start date is in the time zone of the exchange " +
"where the chart's instrument trades. It doesn't use the time " +
"zone of the chart or of your computer.")
backtestEndDate = input(timestamp("1 Sept 2023"),
title="End Date", group="Backtest Time Period",
tooltip="This end date is in the time zone of the exchange " +
"where the chart's instrument trades. It doesn't use the time " +
"zone of the chart or of your computer.")
// STEP 2. See if the current bar falls inside the date range
inTradeWindow = true
// Bollinger Bands inputs
length = input.int(20, title="Bollinger Bands Length")
mult = input.float(2.0, title="Multiplier")
src = input(close, title="Source")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
// EMA Settings
ema20 = ta.ema(close, 20)
plot(ema20, color=color.blue, title="20 EMA")
// Entry condition
longEntryCondition = ta.crossover(close, lower)
// Define stop loss level as the low of the entry bar
var float stopLossPrice = na
if longEntryCondition
stopLossPrice := low
// Top Bollinger Band itself is set as the target
topBandTarget = upper
// Enter long position when conditions are met
if inTradeWindow and longEntryCondition
strategy.entry("Long", strategy.long, qty=1)
// Set profit targets
strategy.exit("ProfitTarget2", from_entry="Long", limit=topBandTarget)
// Set stop loss
strategy.exit("StopLoss", stop=stopLossPrice)
// Plot Bollinger Bands with the same gray color
plot(upper, color=color.gray, title="Upper Bollinger Band")
plot(lower, color=color.gray, title="Lower Bollinger Band")