1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
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
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
ADX Backtest buys when ADX crosses above a threshold, optionally requiring the plus DI to lead, while price is above a 60-period SMA, EMA or RMA, or when price crosses above that average with ADX already above the threshold. It exits when ADX falls back under the threshold or price drops below the average. ADX and DI lines sit in a separate pane. There is no stop loss and sizing uses all equity.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
ADX Smoothing
int
14
adxlen
DI Length
int
14
dilen
ADX In Threshold
int
25
adxThreshold
忽略adx方向
bool
true
ignore_direction
Date
time
timestamp("1 Feb 2018 00:00 +0800")
start_date
Date
time
timestamp("31 Dec 2099 00:00 +0800")
end_date
均线
int
60
ma_length
均线类型
string
SMA
ma_option
仅在均线之上买入
bool
true
buy_over_ma
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.
HA UnivLong&Short Futures calculates Heikin Ashi candles and builds a channel using simple moving averages of Heikin Ashi highs and lows. It enters long positions when the upper channel line crosses above the lower channel line and opens short positions on the
This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr
This strategy executes short positions during the end-of-day session (14:29–15:00) when the price is below the 200-day simple moving average. If price moves higher against the initial short trade, it scales into the position by submitting a second short order
This strategy combines an EMA ribbon with MACD confirmation and plots in a separate pane. It enters when ribbon alignment, optional MACD zero or signal crosses, volume, smart-money, and multi-timeframe filters agree, then exits with percentage stop loss and ta
This strategy plots a comparative relative strength line against a benchmark symbol in a separate pane. It calculates price and volume simple moving averages alongside a multi-period highest high. Long trades enter using full equity when price exceeds its movi
This strategy calculates two simple moving averages using periods 34 and 68 on the close price. It detects bullish crossovers to enter long positions of 10 contracts and bearish crossovers to enter short positions of 10 contracts after the 100th bar. Opposite