Cari ide untuk "BINARY"
Test//@version=5
strategy("Binary MACD Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Parameter MACD
fastLength = input.int(12, title="MACD Fast Length")
slowLength = input.int(26, title="MACD Slow Length")
signalLength = input.int(9, title="Signal Smoothing")
// Hitung MACD
= ta.macd(close, fastLength, slowLength, signalLength)
// Sinyal BUY/SELL
buySignal = ta.crossover(macdLine, signalLine)
sellSignal = ta.crossunder(macdLine, signalLine)
// Entry/Exit logic
if (buySignal)
strategy.entry("BUY", strategy.long)
if (sellSignal)
strategy.entry("SELL", strategy.short)
// Tambahkan visual sinyal
plotshape(buySignal, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Tambahkan MACD lines (opsional)
plot(macdLine, title="MACD", color=color.aqua)
plot(signalLine, title="Signal", color=color.orange)

