Tymaz

Tymaz

//@version=5
indicator("Master Signal Indicator", overlay=true)

// Inputs
ema1 = input.int(50, "Short EMA")
ema2 = input.int(200, "Long EMA")
supertrend_atr = input.int(10, "Supertrend ATR Period")
supertrend_mult = input.float(3.0, "Supertrend Multiplier")
rsi_length = input.int(14, "RSI Length")
macd_fast = input.int(12, "MACD Fast Length")
macd_slow = input.int(26, "MACD Slow Length")
macd_signal = input.int(9, "MACD Signal Length")

// Indicators
ema_short = ta.ema(close, ema1)
ema_long = ta.ema(close, ema2)
= ta.supertrend(supertrend_atr, supertrend_mult)
rsi = ta.rsi(close, rsi_length)
= ta.macd(close, macd_fast, macd_slow, macd_signal)
volume_ma = ta.sma(volume, 20)

// Conditions
bullish = direction == 1 and ema_short > ema_long and macd_line > signal_line and rsi < 50 and volume > volume_ma
bearish = direction == -1 and ema_short < ema_long and macd_line < signal_line and rsi > 70 and volume > volume_ma

// Plot Signals
plotshape(bullish, style=shape.labelup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(bearish, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")

// Supertrend Background
bgcolor(direction == 1 ? color.new(color.green, 90) : color.new(color.red, 90))

Read More

Share:

Latest News