OPEN-SOURCE SCRIPT
Actualizado iFCPO Soyoil Spread

iFCPO Soyoil Spread — z-score divergence between FCPO (Bursa Crude Palm Oil Futures) and CBOT soybean oil (ZL/BO).
WHY IT MATTERS
FCPO and soybean oil are 0.85+ correlated long-run (substitute oils in the global vegetable-oil complex). When the FCPO/BO ratio z-score blows out beyond ±2σ over a 50-day lookback, FCPO is statistically rich or cheap vs the global benchmark. Mean-reversion bias kicks in.
HOW TO USE
- z > +2: FCPO over-extended vs BO — bias short / fade longs
- z < −2: FCPO cheap vs BO — bias long / fade shorts
- |z| < 1: ignore — pairs are tracking normally
- 1 < |z| < 2: stretched, watch for reversal
This is a CONTEXT layer — it modifies conviction. NEVER trade z alone. Pair with iFCPO Wick Hunter (entries) + iFCPO Regime Meter (regime) + iFCPO Session Law (timing).
KPIs
- Lookback: 50 daily bars (configurable)
- Extreme threshold: ±2σ (configurable)
- Symbol: CBOT:ZL1! (TradingView's continuous front-month soybean oil)
OUTPUTS
Dimensionless ratio z (FCPO close / BO close), mean / ±1σ / ±2σ hlines, color-graded line (red rich / green cheap / amber stretched), tinted background at extremes, full status table top-right (FCPO, BO, z, state, pair-with).
Open-source. Part of the iFCPO free hero stack.
WHY IT MATTERS
FCPO and soybean oil are 0.85+ correlated long-run (substitute oils in the global vegetable-oil complex). When the FCPO/BO ratio z-score blows out beyond ±2σ over a 50-day lookback, FCPO is statistically rich or cheap vs the global benchmark. Mean-reversion bias kicks in.
HOW TO USE
- z > +2: FCPO over-extended vs BO — bias short / fade longs
- z < −2: FCPO cheap vs BO — bias long / fade shorts
- |z| < 1: ignore — pairs are tracking normally
- 1 < |z| < 2: stretched, watch for reversal
This is a CONTEXT layer — it modifies conviction. NEVER trade z alone. Pair with iFCPO Wick Hunter (entries) + iFCPO Regime Meter (regime) + iFCPO Session Law (timing).
KPIs
- Lookback: 50 daily bars (configurable)
- Extreme threshold: ±2σ (configurable)
- Symbol: CBOT:ZL1! (TradingView's continuous front-month soybean oil)
OUTPUTS
Dimensionless ratio z (FCPO close / BO close), mean / ±1σ / ±2σ hlines, color-graded line (red rich / green cheap / amber stretched), tinted background at extremes, full status table top-right (FCPO, BO, z, state, pair-with).
Open-source. Part of the iFCPO free hero stack.
Notas de prensa
v2.0 Polish — Two upgrades:1. CRITICAL math fix: Replaced raw FCPO/BO ratio z-score with log-ratio z-score `z(log(FCPO/BO))`. Previous version mixed RM/MT (FCPO) with USD¢/lb (BO) — the resulting ratio drift was dominated by USDMYR + unit-scale, not palm/soy economics. Log-ratio is dimensionally consistent and the z-score now measures relative dislocation around the rolling mean (not arbitrary scale).
2. Repaint fix: Both daily series (BO and FCPO) now pull `close[1]` inside request.security() — locked to confirmed daily bar. Previous version used today's still-forming close which made the z-score noisy intraday.
Header reframed: explicit "STATISTICAL stretch only" disclaimer added — cross-currency arb is imperfect, so read this as a conviction modifier, never an entry.
Ecosystem updates: "Pair with" expanded to include myr-context.
Part of the v3.0 free-tier polish wave.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.