EURUSD Futures

Indicador top

//version=5
indicator("Padrões de Candles com Setas", overlay=true)

// Funções para identificar padrões de candles
bullish_engulfing = (close > open and close[1] < open[1] and close > open[1] and open < close[1])
bearish_engulfing = (close < open and close[1] > open[1] and close < open[1] and open > close[1])
hammer = (close > open and (high - low) > 2 * (close - open) and (close - low) > 2 * (high - close))
shooting_star = (open > close and (high - low) > 2 * (open - close) and (high - open) > 2 * (close - low))

// Detecção de padrões
bull_signal = bullish_engulfing or hammer
bear_signal = bearish_engulfing or shooting_star

// Plotando setas no gráfico
plotshape(series=bull_signal, style=shape.labelup, location=location.belowbar, color=color.green, size=size.small, text="Buy")
plotshape(series=bear_signal, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.small, text="Sell")

// Exibindo alertas
if (bull_signal)
alert("Padrão de compra identificado!", alert.freq_once_per_bar)
if (bear_signal)
alert("Padrão de venda identificado!", alert.freq_once_per_bar)

Aviso legal