This indicator, drawn in a separate pane, pulls Bitcoin and Ethereum prices from two user-chosen symbols, forms the BTC to ETH price ratio and converts it to a z-score against a rolling average and standard deviation (30 bars by default).
Upper and lower thresholds mark stretched readings as sell or buy signals. RSI and MACD settings are provided as extra confirmation inputs. Lot size and per-lot spread settings estimate a matching ETH position size for the pair trade. It plots signals only and places no orders.
BTC/ETH price ratio z-score in a separate pane
Adjustable lookback and upper and lower thresholds
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Z-Score Lookback Period
int
30
myzScoreLookback
Upper Z-Score Threshold (Sell)
float
2.6
upperThreshold
Lower Z-Score Threshold (Buy)
float
-2.6
lowerThreshold
Signal Plot Offset
float
0.1
signalOffset
Bitcoin Symbol
symbol
COINBASE:BTCUSD
btcSymbol
Ethereum Symbol
symbol
COINBASE:ETHUSD
ethSymbol
RSI Lookback Period
int
14
rsiLength
RSI Overbought Level
float
70
rsiUpper
RSI Oversold Level
float
30
rsiLower
MACD Fast Length
int
12
macdFastLength
MACD Slow Length
int
26
macdSlowLength
MACD Signal Length
int
9
macdSignalLength
Show all 15 settings
Setting
Type
Default
Variable
BTC Lot Size
float
1.0
btcLotSize
BTC Spread per Lot ($)
float
60.0
btcSpreadPerLot
ETH Spread per Lot ($)
float
4.9
ethSpreadPerLot
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 calculates normalized percentage bounds around price highs and lows to anticipate local trend reversals. It oscillates within a fixed -1 to 1 channel and plots two boundary tracking curves alongside a background Karobein oscillator histogram for
This indicator calculates the statistical autocorrelation coefficient of an input series over a user-defined lookback window at a specified lag. It tracks values using an internal circular buffer, computes sample mean, variance, and autocovariance, and normali
The Pretty Good Oscillator calculates the distance between the selected price source and its simple moving average, normalized by the Average True Range over a specified period. It renders as an oscillator line in a separate pane alongside a zero line and thre
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
This indicator measures statistical price deviations using the mean and standard deviation of logarithmic price. Plotted in a separate pane, it identifies overvalued and undervalued market conditions relative to a calculated fair-value baseline. Standard devia