
이 전략은 쌍용 이동 평균선, 브린 띠 및 MACD 지표를 종합하여 구매 및 판매 조건을 설정하여 은행 Nifty 지수에 대해 5 분 주기의 거래를합니다. MACD 골드 포크가 닫히고 마감 가격이 브린 띠를 돌파 할 때 구매합니다. MACD 포크가 죽고 마감 가격이 브린 띠를 돌파 할 때 판매합니다. 이 전략은 여러 지표의 장점을 결합하여 추세를 발견 할뿐만 아니라 극한점을 위치시킬 수 있습니다.
이 전략의 전체적인 거래 논리는 다음과 같습니다.
이것은 매우 실용적인 트렌드 전략으로 다음과 같은 장점이 있습니다.
종합적으로, 이 전략은 다양한 지표의 장점을 최대한 활용하고, 정확한 판단과 운영 규범을 통해 신뢰할 수 있고 통제 가능한 트렌드 전략이다.
이 전략의 장점은 분명하지만, 몇 가지 위험도 있습니다.
대책과 해결책은 다음과 같습니다.
이 전략은 여전히 최적화할 수 있습니다:
전체적으로, 이 전략은 아주 좋은 프레임워크를 가지고 있으며, 파라미터 최적화, 지표 혁신, 적응 방식 등으로 더 발전하여 더욱 강력하고 안정적인 거래 전략이 될 수 있다.
이 쌍평선 브린띠 MACD 전략은 매매 시점을 판단하는 다양한 지표를 최대한 활용한다. 그것은 추세 식별과 극한 가치 판단, 운영 규범, 위험을 제어할 수 있는, 효율적인 안정적인 거래 전략이다. 지속적인 최적화와 혁신을 통해, 이 전략은 응용 가능성이 높다. 그것은 투자자가 거래 시장에서 안정적이고 제어 가능한 수익을 달성하는 데 중요한 기술 도구를 제공합니다.
/*backtest
start: 2023-11-28 00:00:00
end: 2023-12-28 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Modified MACD and Bollinger Band Strategy", shorttitle="Mod_MACD_BB", overlay=true)
var bool open_buy_position = na
var bool open_sell_position = na
// MACD settings
fast_length = input(12, title="Fast Length")
slow_length = input(26, title="Slow Length")
signal_length = input(9, title="Signal Length")
src = close
[macdLine, signalLine, _] = macd(src, fast_length, slow_length, signal_length)
// Bollinger Band settings
bb_length = input(20, title="Bollinger Band Length")
bb_mult = input(2, title="Bollinger Band Multiplier")
basis = sma(src, bb_length)
dev = bb_mult * stdev(src, bb_length)
upper_band = basis + dev
lower_band = basis - dev
// Define profit target and stop loss
profit_target = input(60, title="Profit Target (Points)")
stop_loss = input(30, title="Stop Loss (Points")
// Buy condition: MACD crosses up the signal line and close is above upper Bollinger Band
buy_condition = crossover(macdLine, signalLine) and close > upper_band
// Sell condition: MACD crosses below the signal line and close is below the lower Bollinger Band
sell_condition = crossunder(macdLine, signalLine) and close < lower_band
// Check for open positions
if (buy_condition)
open_buy_position := true
if (sell_condition)
open_sell_position := true
// Strategy Orders
strategy.entry("Buy", strategy.long, when = buy_condition and not open_sell_position)
strategy.exit("Take Profit/Stop Loss", from_entry = "Buy", limit = close + profit_target, stop = close - stop_loss)
strategy.entry("Sell", strategy.short, when = sell_condition and not open_buy_position)
strategy.exit("Take Profit/Stop Loss", from_entry = "Sell", limit = close - profit_target, stop = close + stop_loss)
// Reset open position status
if (sell_condition)
open_buy_position := na
if (buy_condition)
open_sell_position := na