This strategy calculates the WaveTrend oscillator using exponential moving averages of typical price and plots two signal lines alongside overbought and oversold thresholds in a separate pane.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
81 lines of Pine Script v4 from pine/work/wt_version4.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
WaveTrend with Crosses [LazyBear] enters long positions when the primary line crosses above the signal line in oversold territory, and enters short positions on bearish crosses in overbought territory during a configured backtest window. Long trades close when the fast line falls below the slow line, while short trades exit on opposite crosses. Inputs adjust smoothing lengths, threshold levels, and date ranges. Sizing defaults to full equity, and trades lack a stop loss.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Channel Length
int
10
n1
Average Length
int
21
n2
Over Bought Level 1
int
60
obLevel1
Over Bought Level 2
int
53
obLevel2
Over Sold Level 1
int
-60
osLevel1
Over Sold Level 2
int
-53
osLevel2
Backtest Start Year
int
2020
fromYear
Backtest Start Month
int
1
fromMonth
Backtest Start Day
int
2
fromDay
Backtest Stop Year
int
2021
thruYear
Backtest Stop Month
int
12
thruMonth
Backtest Stop Day
int
30
thruDay
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.
Buy The Dips - MA200 Optimised is a mean-reversion strategy that measures short-term percentage price changes alongside a simple moving average trend filter. It opens long positions when price experiences a steep drop exceeding three percent while remaining ab
This strategy combines Bollinger Bands, Bollinger Band Width, and the Relative Strength Index (RSI) for mean-reversion trades. It enters long when price crosses below the lower band with oversold RSI, or when band width contracts under low volatility. Short en
This strategy plots in a separate pane and tests a selected oscillator with one of six entry logics: moving average, moving-average crossover, zero cross, extremes, mean reversion, or take profit. Users scale and time-adjust one of three oscillators and can li
The oversold strategy identifies oversold conditions using the relative strength index with a 14 period. It applies an arithmetic linear moving average with a 20 period for trend filtering and requires the price to stay within 15 percent of this average. Stoch
The script calculates the yield spread between long-term and short-term US Treasury yields (T10Y2Y or manual US10Y minus US02Y) and plots the spread line on a separate pane. It signals long entries on steepening beyond a user threshold in reversion mode or SMA
This mean-reversion strategy combines multi-timeframe exponential moving averages, Bollinger Bands, and the Relative Strength Index. It generates long and optional short trade signals when price interacts with the Bollinger Bands alongside RSI threshold confir