This script is designed for trend-continuation traders. Instead of chasing a stock at its peak, this indicator identifies short-term "oversold" conditions within a larger uptrend. It paints a clear signal directly on your candles when the risk-to-reward ratio is statistically in your favor.
//@version=5
indicator("DTL Lab - Buy-the-Dip Visual", overlay=true)
// --- INPUTS ---
ema_len = input.int(50, "Trend Filter (EMA)", minval=1)
rsi_len = input.int(14, "RSI Length", minval=1)
rsi_low = input.int(35, "Dip Threshold (RSI)", minval=10, maxval=50)
// --- CALCULATIONS ---
ema_val = ta.ema(close, ema_len)
rsi_val = ta.rsi(close, rsi_len)
// --- LOGIC ---
// 1. Price is above the EMA (Uptrend)
// 2. RSI is below our dip threshold
// 3. RSI was previously above the threshold (Crossing down)
is_uptrend = close > ema_val
is_dip = rsi_val < rsi_low and rsi_val[1] > rsi_low
buy_signal = is_uptrend and is_dip
// --- VISUALS ---
plot(ema_val, color=color.new(color.blue, 50), title="Trend EMA")
plotshape(buy_signal,
style=shape.triangleup,
location=location.belowbar,
color=color.new(#28a745, 0),
size=size.small,
title="Dip Entry Signal")
// --- ALERTS ---
alertcondition(buy_signal, title="Dip Entry Detected", message="Buy the Dip signal on {{ticker}}")
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
DayTradeLab DOES NOT provide investment advice. The information contained within this websites, is provided for informational and educational purposes only. The information should not be construed as investment or trading advice, and is not meant to be a solicitation or recommendation to buy, sell, or hold any positions in any indices or financial markets mentioned.