//@version=5 indicator("Sniper Entry", overlay=true) // Input v

//@version=5 indicator("Sniper Entry", overlay=true) // Input v

//@version=5
indicator("Sniper Entry", overlay=true)

// Input variables
rsi_length = input(14, title="RSI Length")
rsi_overbought = input(70, title="RSI Overbought Level")
rsi_oversold = input(30, title="RSI Oversold Level")
macd_fast = input(12, title="MACD Fast Length")
macd_slow = input(26, title="MACD Slow Length")
macd_signal = input(9, title="MACD Signal Length")

// Calculate RSI
rsi = ta.rsi(close, rsi_length)

// Calculate MACD
= ta.macd(close, macd_fast, macd_slow, macd_signal)

// Sniper Entry Conditions
long_entry = rsi < rsi_oversold and macd_line > signal_line
short_entry = rsi > rsi_overbought and macd_line < signal_line

// Plot Buy and Sell Signals
plotshape(long_entry, style=shape.labelup, location=location.belowbar, color=color.green, text="Buy")
plotshape(short_entry, style=shape.labeldown, location=location.abovebar, color=color.red, text="Sell")

// Plot RSI and MACD for reference
hline(rsi_overbought, "Overbought", color=color.red)
hline(rsi_oversold, "Oversold", color=color.green)

Read More

Share:

Latest News