Forex Correlation
workflow.run_forex_correlationCorrelation coefficient and minimum-variance hedge ratio between two price series of matching length, computed on daily % returns (not raw price levels, which would give spuriously high correlation between two unrelated but both-trending series). hedgeRatio follows Hull's standard futures-hedging formula: cov(returns1,returns2)/var(returns2), "how many units of series 2 per unit of series 1 minimizes the combined position's variance." No live data fetch: supply the two price series directly. The live variant is workflow.run_forex_correlation_live, which has both series fetched automatically for two named pairs. Use when user already has two price series and wants their statistical relationship. Returns: n, correlation (-1 to 1), hedgeRatio.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rates1 | Yes | First price series, chronological order, one price per date | |
| rates2 | Yes | Second price series, chronological order, same length and same dates as rates1 |