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 indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
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
Over a lookback of 168 bars it flags entry when the absolute z-score passes 2, exit when it falls to 0.5, a stop at 3.5, and a time limit on holding. It tells which leg to buy and which to sell. As an indicator it places no orders, and fees on four legs are not modelled.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Pair
string
ETH / BTC (A=ETH, B=BTC)
pairSel
Exchange
string
KRAKEN
exch
Bar interval (PAIRS_INTERVAL_MIN)
string
60
tfSel
Z-score lookback, bars (PAIRS_LOOKBACK)
int
168
lookback
Entry |z| (PAIRS_ENTRY_Z)
float
2.0
entryZ
Exit |z| (PAIRS_EXIT_Z)
float
0.5
exitZ
Stop |z| (PAIRS_STOP_Z)
float
3.5
stopZ
Max hold, bars (PAIRS_MAX_HOLD_BARS)
int
168
maxHold
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 standardized z-scores of price data across four different lookback periods (6, 14, 26, and 100). Standardizing data subtracts the moving average from the price and divides by the standard deviation. It applies a Double Exponential Mov
This indicator implements a dual-direction variation of the Williams Vix Fix oscillator in a separate pane. It normalizes price data using min-max scaling to compute both upward and downward synthetic volatility metrics across two selectable calculation modes
The Augmented Dickey-Fuller indicator calculates statistical stationarity and tests for unit roots in price series over a rolling window. It performs ordinary least squares regression on differenced historical price data to compute a t-statistic and an estimat
This indicator applies the hyperbolic tangent to a chosen source series and plots the result in a separate pane. It centers the transform on a 200-bar simple moving average of that source, multiplies the deviation by a steepness factor, and maps the output int
This indicator calculates sample autocorrelation across multiple lag intervals for a selected price series. It computes correlation values over a user-specified lookback period using raw prices, log returns, absolute log returns, or squared log returns. Plotte
Calculates a composite carry and decay oscillator fusing impulse-autocorrelation half-life, a Hurst exponent approximation, path efficiency, and range expansion ratios. It evaluates whether an impulse is likely to persist or mean-revert, plotting the oscillato