Buy/Sell Signals with Support/Resistance by InvestYourAsset is an overlay indicator that combines moving average crossovers, MACD calculations, and pivot-based support and resistance levels.
//@version=5
indicator("buy/sell signals with Support/Resistance (InvestYourAsset)", overlay=true)
// Input parameters
ma1 = input(12, title="Short MA Period")
ma2 = input(26, title="Long MA Period")
// Fetching data
symbol = input("NA", title="Ticker Symbol")
data = request.security(symbol, "D", close)
// Filter data based on date range
var float filteredClose = na
if (time >= timestamp(year, month, dayofmonth, 00, 00) and time <= timestamp(year, month, dayofmonth, 23, 59))
filteredClose := close
// MACD Calculation
short_ma = ta.sma(filteredClose, ma1)
long_ma = ta.sma(filteredClose, ma2)
macd_line = short_ma - long_ma
// Signal Generation
positions = ta.crossover(short_ma, long_ma)
signals = positions ? 1 : ta.crossunder(short_ma, long_ma) ? -1 : 0
// Support and Resistance Calculation
lookback = input(20, title="Lookback Period for S&R")
swingHigh = ta.pivothigh(high, lookback, lookback)
swingLow = ta.pivotlow(low, lookback, lookback)
// Plotting
plot(data, color=color.blue, title="Close Price")
plotshape(signals == 1, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Long Signal")
plotshape(signals == -1, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Short Signal")
hline(0, "Zero Line", color=color.gray)
plot(macd_line, color=color.red, title="MACD Oscillator", style=plot.style_histogram, linewidth=1, transp=0)
plot(short_ma, color=color.orange, title="Short MA")
plot(long_ma, color=color.purple, title="Long MA")
plot(swingHigh, color=color.red, style=plot.style_stepline_diamond, linewidth=2, title="Swing High")
plot(swingLow, color=color.green, style=plot.style_stepline_diamond, linewidth=2, title="Swing Low")
Overview
Buy/Sell Signals with Support/Resistance (InvestYourAsset) calculates short and long simple moving averages on filtered close price data, generating buy and sell visual signals when moving averages cross. The indicator also identifies swing highs and lows using a configurable lookback window to plot dynamic support and resistance steplines. Plotted directly on the main price chart, it displays moving averages, signal arrows, pivot levels, and a MACD histogram.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Short MA Period
int
12
ma1
Long MA Period
int
26
ma2
Ticker Symbol
string
NA
symbol
Lookback Period for S&R
int
20
lookback
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator calculates pivot high and pivot low points on the price chart based on configurable left and right bar counts. Confirmed pivot highs and lows are plotted with negative bar offsets directly on the price chart using line and cross styles. Addition
This overlay indicator marks call and put setups from EMAs, RSI, MACD, and a SPY volume ratio. A call needs higher highs, RSI above its minimum, rising MACD, above-average proxy volume, and a rising trend EMA; a put reverses those tests. Early markers use an E
This indicator collection calculates and plots previous daily high and low price levels on the chart to identify potential supply and demand zones. It includes real-time intraday high and low calculations, RSI divergence detection across a customizable period
This overlay indicator marks CALLS and PUTS labels on the price chart when a strict boolean gate of price structure, momentum, volatility, breadth, and candle confirmation all pass. It plots an EMA ribbon with cloud fill, session-anchored VWAP and standard-dev
This script provides an indicator-based backtesting engine framework that simulates trade entries, exits, and filtering directly on the price chart. It evaluates selected entry rules and multi-layered filters, including moving average trends, volume increases,
This indicator combines pivot-based support and resistance levels with multi-timeframe MACD crossovers and a higher-timeframe exponential moving average trend filter. It identifies support and resistance touches using pivot highs and lows within a user-defined