
“가격 돌파구 구매 전략”은 지정된 도표 범위 내에서 가격과 거래량 돌파구가 동시에 발생하는 것을 탐지하여 구매 기회를 식별하기 위한 거래 전략이다. 이 전략은 먼저 특정 수의 돌파구를 가격과 거래량 검사 창으로 사용한다. 이러한 값은 돌파구 조건을 식별하는 기준으로 사용됩니다.
“가격 돌파구 구매 전략”은 높은 변동성 시장에 적합한 트렌드 추적 전략이다. 가격과 거래량을 동시에 고려하고, 장기 SMA를 트렌드 필터로 결합함으로써, 이 전략은 강세를 보이는 상황에서 거래 기회를 더 잘 포착할 수 있다. 그러나, 이 전략은 추세가 보이지 않는 또는 변동성이 적은 시장에서 좋지 않은 성능을 발휘할 수 있으며, 자주 거래의 위험에 처할 수 있다. 따라서 실제 응용에서는 다양한 시장 특성과 개인 거래 스타일에 따라 이 전략에 대한 적절한 최적화와 조정이 필요하며, 안정성과 수익성을 높일 수 있다.
/*backtest
start: 2023-05-11 00:00:00
end: 2024-05-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tradedots
//@version=5
strategy("Price and Volume Breakout Buy Strategy [TradeDots]", overlay=true, initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 70, commission_type = strategy.commission.percent, commission_value = 0.01)
input_price_breakout_period = input.int(60, "Price Breakout Period")
input_volume_breakout_period = input.int(60, "Volume Breakout Period")
input_trendline_legnth = input.int(200, "Trendline Length")
input_order_direction = input.string("Long", options = ["Long", "Short", "Long and Short"], title = "Order Direction")
price_highest = ta.highest(input_price_breakout_period)
price_lowest = ta.lowest(input_price_breakout_period)
volume_highest = ta.highest(volume, input_volume_breakout_period)
// Long Orders
if close > price_highest[1] and volume > volume_highest[1] and close > ta.sma(close, input_trendline_legnth) and strategy.opentrades == 0 and input_order_direction != "Short"
strategy.entry("Long", strategy.long)
// line.new(bar_index[input_price_breakout_period], price_highest[1], bar_index, price_highest[1], color = #9cff87, width = 2)
// label.new(bar_index,low, "🟢 Breakout Buy", style = label.style_label_up, color = #9cff87)
// Close when price is below moving average for 5 consecutive days
if close < ta.sma(close, input_trendline_legnth) and close[1] < ta.sma(close, input_trendline_legnth) and close[2] < ta.sma(close, input_trendline_legnth) and close[3] < ta.sma(close, input_trendline_legnth) and close[4] < ta.sma(close, input_trendline_legnth) and strategy.opentrades.size(strategy.opentrades - 1) > 0
strategy.close("Long")
// label.new(bar_index, high, "🔴 Close Position", style = label.style_label_down, color = #f9396a, textcolor = color.white)
// Short Orders
if close < price_lowest[1] and volume > volume_highest[1] and close < ta.sma(close, input_trendline_legnth) and strategy.opentrades == 0 and input_order_direction != "Long"
strategy.entry("Short", strategy.short)
// line.new(bar_index[input_price_breakout_period], price_lowest[1], bar_index, price_lowest[1], color = #f9396a, width = 2)
// label.new(bar_index,high , "🔴 Breakout Sell", style = label.style_label_down, color = #f9396a, textcolor = color.white)
// Close when price is above moving average for 5 consecutive days
if close > ta.sma(close, input_trendline_legnth) and close[1] > ta.sma(close, input_trendline_legnth) and close[2] > ta.sma(close, input_trendline_legnth) and close[3] > ta.sma(close, input_trendline_legnth) and close[4] > ta.sma(close, input_trendline_legnth) and strategy.opentrades.size(strategy.opentrades - 1) < 0
strategy.close("Short")
// label.new(bar_index, low, "🟢 Close Position", style = label.style_label_up, color = #9cff87)
plot(ta.sma(close, input_trendline_legnth), color = color.white, linewidth = 2)
plotcandle(open, high, low, close, title='Candles', color = (close > ta.sma(close, input_trendline_legnth) ? #9cff87 : #f9396a), wickcolor=(close > ta.sma(close, input_trendline_legnth) ? #9cff87 : #f9396a), force_overlay = true)