SITFX_FuturesSpec_v17

Full-scale futures contract specification library for Pine Script v6. Covers CME, CBOT, NYMEX, COMEX, CFE, Eurex, ICE, and more – including minis, micros, metals, energies, FX, and bonds.
Key Features:
✅ Instrument‑agnostic: ES/MES, NQ/MNQ, YM/MYM, RTY/M2K, metals, energies, FX, bonds
✅ Full contract data: Tick size, tick value, point value, margins
✅ Continuation‑safe: Single‑line logic, no arrays or continuation errors
✅ Foundation for SITFX tools: Gann, Fibs, structure, and risk modules
Usage example:
import SITFX_FuturesSpec_v17/1 as fs
spec = fs.get(syminfo.root)
label.new(bar_index, high, str.format("{0}: Tick={1}, Value=${2}", spec.name, spec.tickSize, spec.tickValue))
SITFX_FuturesSpec_v17 – Complete Futures Contract Library for Pine Script v6
Author: Ken (“SITFX”) | © 2025 Solvere Trading Solutions, LLC
🔹 Overview
SITFX_FuturesSpec_v17 is a comprehensive, continuation‑safe Futures contract library for Pine Script v6.
It provides single‑line contract definitions for CME, CBOT, NYMEX, COMEX, CFE, Eurex, ICE, and other major exchanges, covering:
Equity Index Futures: ES, NQ, YM, RTY, EMD and all micros (MES, MNQ, MYM, M2K)
Volatility Futures: VIX (VX) and Mini‑DAX (FDXM)
FX & Crypto Futures: EuroFX, Yen, Pound, CAD, AUD, Swiss Franc, Micro Euro, Dollar Index, Micro Bitcoin
Treasury & Interest Rate Futures: 30‑Year, 10‑Year, 5‑Year, 2‑Year, SOFR, Fed Funds
Metals: Gold, Silver, Platinum, Copper and their E‑Mini/Micro equivalents
Energies: Crude Oil, E‑Mini Crude, Natural Gas, Heating Oil, RBOB Gasoline
🔹 Key Features
Instrument‑Agnostic Data Backbone
Returns a full FuturesSpec record with symbol, name, exchange, contract size, delivery months, tickSize, tickValue, pointValue, dayMargin, and overnightMargin.
Standardized formatting for multi‑market HUDs, Gann/Fibonacci tools, and risk models.
Continuation‑Safe
Every contract is defined on a single line for guaranteed compilation in Pine Script v6.
Avoids line‑continuation (+ or /) issues common in ternary operators.
Complete Coverage
Supports equity indices, metals, energies, FX, crypto, rates, and bonds.
Micro, mini, and full‑size contracts are fully mapped.
Plug‑and‑Play Integration
Designed as a drop‑in module for any SITFX script.
Provides a single function call:
pinescript
Copy
Edit
import SITFX_FuturesSpec_v17/1 as fs
spec = fs.get(syminfo.root)
label.new(bar_index, high, str.format("{0}: Tick={1}, Value=${2}", spec.name, spec.tickSize, spec.tickValue))
Instantly fetches tick and margin data for dynamic HUDs, risk sizing, and Gann/Fib calculations.
Future‑Ready Backbone
Centralized database for multi‑market, multi‑timeframe scripts.
Optimized for SITFX.StructureCollector, Gann/Fib Modules, and Risk Management HUDs.
🔹 Usage Notes
This library is timeframe and instrument agnostic.
Input: symbol as the root ticker (e.g., "ES", "MES", "GC", "M2K", "VX").
Output: A FuturesSpec record containing all contract details.
Fallback: Returns na if the symbol is not recognized.
🔹 Example Use Case
pinescript
Copy
Edit
import SITFX_FuturesSpec_v17/1 as fs
spec = fs.get(syminfo.root)
if not na(spec)
label.new(bar_index, close,
str.format("{0} | Tick={1} | Value=${2}", spec.symbol, spec.tickSize, spec.tickValue))
This library serves as the foundation for all professional SITFX scripts, enabling:
Real‑time margin & tick value calculation
Multi‑contract HUDs for indices, metals, energies, and FX
Preparation for Gann/Fibonacci confluence and quantified risk engines
Provides standardized tick size, tick value, point value, day/overnight margin, and session data for major CME, CBOT, NYMEX, COMEX, ICE, Eurex, and FX contracts.
🔹 Instrument-agnostic: works with Minis, Micros, Metals, Energies, Bonds, FX, Indices.
🔹 Continuation-safe: all logic written with if/else (no multiline, no line-continuation).
🔹 Helper Getters: tickSize(), tickValue(), pointValue(), dayMargin(), overnightMargin().
🔹 Session Aliases: per-region helpers (US/EU/AS) with normalized contract roots.
🔹 Backbone: designed to integrate with SITFX libraries (DataEngine, HUD, Strategies).
Libreria Pine
In pieno spirito TradingView, l'autore ha pubblicato questo codice Pine come libreria open-source in modo che altri programmatori Pine della nostra comunità possano riutilizzarlo. Complimenti all'autore! È possibile utilizzare questa libreria privatamente o in altre pubblicazioni open-source, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento.
Declinazione di responsabilità
Libreria Pine
In pieno spirito TradingView, l'autore ha pubblicato questo codice Pine come libreria open-source in modo che altri programmatori Pine della nostra comunità possano riutilizzarlo. Complimenti all'autore! È possibile utilizzare questa libreria privatamente o in altre pubblicazioni open-source, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento.