Buy the Dip in an Uptrend checks whether price gained by a specified percentage over an earlier window and subsequently pulled back by a minimum threshold over a recent window. Upon meeting these conditions, it places a buy-stop order slightly above the close. Once executed, positions exit via fixed percentage take-profit and stop-loss targets from entry price. Configurable inputs adjust lookback durations, percentage thresholds, order buffer, and exit targets.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Long Period (bars — the 'first month')
int
15
long_period
Short Period (bars — the 'dip window')
int
8
short_period
Min Uptrend % (e.g. 0.02 = 2%)
float
0.02
trend_threshold
Min Dip % (e.g. 0.02 = 2%)
float
0.02
dip_threshold
Buy-Stop Buffer above close (e.g. 0.02 = 2%)
float
0.02
stop_buffer
Take Profit % from entry (e.g. 0.25 = 25%)
float
0.25
tp_pct
Stop Loss % from entry (e.g. 0.12 = 12%)
float
0.12
sl_pct
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 strategy calculates Bollinger Bands and Aroon oscillator values to identify mean-reversion opportunities. It enters a long position using full equity when the closing price crosses below the lower Bollinger Band while Aroon Up remains above a user-specifi
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
The Chained Linear Regression Reversal Strategy plots linear regression channels with upper and lower standard deviation bands directly on the price chart across a user-defined time window. When price breaks out of the static channel for a confirmed number of
Inspired by Linda Raschke's strategy for T-note futures, this script identifies extended trends where price remains on one side of a 5-period SMA for more than eight consecutive bars. It enters long on the first pullback below the SMA following an eight-bar bu
This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po
This strategy identifies long entry opportunities based on short-term price pullbacks below a major trend filter. It enters long when three consecutive lower closes occur below the 200-period simple moving average, followed by the current bar closing back abov