Spread Indicator
Version: v.1.0.0.0

Description
An indicator that calculates the difference between the prices of financial instruments called instrument spread, which helps to identify the differences between prices for the application of arbitrage strategies.
Important
When using Normalized mode, the second ticker must always be the lower-priced instrument.
The indicator exposes three data series for use in auto strategies:
- Spread — raw spread values between the two instruments;
- SMASpread — the spread smoothed over the specified SMA period;
- StdDevSpread — the rolling standard deviation of the spread over the same period.
You can reference these directly in your strategy code via the Spread, SMASpread and StdDevSpread properties for signal generation, filtering or risk management.
Properties
- Spread calculation mode [default: Clean] — Chooses whether the spread is calculated as a direct price difference or normalized using an SMA-based coefficient.
- Period SMA [default: 14, range: 1–∞] — Period SMA.
- Second ticker [default: ES JUN25] — Second financial instrument.
- Use custom ratio [default: false] — Ratio to align the second instrument with the first one. Leave it 1 if you want the spread to be calculated from the net prices of two instruments.
- Ratio [default: 1, range: 1–∞] — Used to align a second instrument that has a lower price than the first. Leave it 1 if you want the spread to be calculated from the net prices of two instruments.