
이 거래 전략은 MACD와 1차 균형 도표의 두 가지 기술 지표를 결합하여 중간 트렌드 및 동력 변화를 캡처합니다. MACD 지표는 빠른, 느린 및 신호 라인을 구성하고 각각 12, 26 및 9의 파라미터 설정을 사용하여 동력 변화와 트렌드 반전을 식별합니다. 1차 균형 도표는 전환 라인, 기준 라인, 선행 상위 및 선행 하위, 트렌드 강도 및 방향 및 지지 / 저항 지점에 대한 통찰력을 제공합니다.
이 전략은 MACD 지표와 1차 균형 차트 클라우드를 사용하여 구매 및 판매 신호를 생성한다. 가격이 1차 균형 차트 클라우드를 초과하고 MACD 라인에서 신호선을 통과하면 구매 신호를 유발하여 부향 경향을 나타냅니다. 가격이 1차 균형 차트 클라우드를 초과하고 MACD 라인 아래에 신호선을 통과하면 판매 신호를 유발하여 하향 경향을 나타냅니다.
동적 MACD와 일회성 차트 트레이딩 전략은 두 가지 널리 알려진 기술 지표와 결합하여 중기 경향과 동력 변화를 식별하는 강력한 방법을 제공합니다. 명확하게 정의된 구매 및 판매 기준과 위험 관리 지침을 통해 거래자가 현명한 결정을 내리고 위험을 통제하고 수익을 극대화하도록 돕는 것을 목표로합니다. 그러나 거래자는 자신의 거래 스타일과 시장 특성에 따라 전략을 최적화하고 맞춤화하고 지속적으로 그 성능을 모니터링해야합니다. 적절한 조정과 위험 관리로 전략은 거래자의 도구 상자에 귀중한 보완이 될 수 있습니다.
/*backtest
start: 2024-04-01 00:00:00
end: 2024-04-30 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("MACD and Ichimoku Cloud Strategy", overlay=true)
// MACD Components
fastLength = 12
slowLength = 26
signalLength = 9
[macdLine, signalLine, _] = ta.macd(close, fastLength, slowLength, signalLength)
// Ichimoku Cloud Components
tenkanLength = 9
kijunLength = 26
senkouLength = 52
displacement = 26
tenkanSen = (ta.highest(high, tenkanLength) + ta.lowest(low, tenkanLength)) / 2
kijunSen = (ta.highest(high, kijunLength) + ta.lowest(low, kijunLength)) / 2
senkouSpanA = (tenkanSen + kijunSen) / 2
senkouSpanB = (ta.highest(high, senkouLength) + ta.lowest(low, senkouLength)) / 2
chikouSpan = close[displacement]
// Plot Ichimoku Cloud
plot(tenkanSen, color=color.red, title="Tenkan-sen")
plot(kijunSen, color=color.blue, title="Kijun-sen")
p1 = plot(senkouSpanA, color=color.green, title="Senkou Span A", offset=displacement)
p2 = plot(senkouSpanB, color=color.orange, title="Senkou Span B", offset=displacement)
fill(p1, p2, color=senkouSpanA > senkouSpanB ? color.new(color.green, 90) : color.new(color.red, 90))
// Define Buy and Sell Conditions
macdBuy = ta.crossover(macdLine, signalLine)
ichimokuBuy = (close > senkouSpanA) and (close > senkouSpanB) and (tenkanSen > kijunSen)
buySignal = macdBuy and ichimokuBuy
macdSell = ta.crossunder(macdLine, signalLine)
ichimokuSell = (close < senkouSpanA) and (close < senkouSpanB) and (tenkanSen < kijunSen) and (tenkanSen[displacement] < math.min(senkouSpanA, senkouSpanB))
sellSignal = macdSell and ichimokuSell
// Execute Buy or Sell orders
if (buySignal)
strategy.entry("Buy", strategy.long)
if (sellSignal)
strategy.entry("Sell", strategy.short)
// Setting up the stop loss and take profit
stopLossPerc = 5.0
takeProfitPerc = 10.0
strategy.exit("Exit Buy", "Buy", loss=stopLossPerc, profit=takeProfitPerc)
strategy.exit("Exit Sell", "Sell", loss=stopLossPerc, profit=takeProfitPerc)
// Plot Buy and Sell Signals
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")