fsl_futuresLibrary "fsl_futures"
Futures helpers for TradingView.
Provides month code constants and utilities for determining allowed / major
contract months per futures root (e.g., SI uses HKNUZ).
allMonthCodes()
Returns the standard CME-style futures month codes as an array.
Returns: array of month codes in order: F,G,H,J,K,M,N,Q,U,V,X,Z
allMonthCodesStr()
Returns all month codes as a single string for quick membership checks.
Returns: string "FGHJKMNQUVXZ"
majorMonthsByRoot(product_root)
Returns the major month-code subset for a given futures root.
If the root is not mapped, defaults to all months.
Parameters:
product_root (string) : Futures root symbol, e.g. "SI", "ES", "CL"
Returns: string of allowed month codes (e.g., "HKNUZ" for SI), otherwise "FGHJKMNQUVXZ"
allowedMonthsByRoot(product_root)
Returns the allowed month-code subset for a given futures root.
If the root is not mapped, defaults to all months.
Parameters:
product_root (string) : Futures root symbol, e.g. "SI", "ES", "CL"
Returns: string of allowed month codes (e.g., "HKNUZ" for SI), otherwise "FGHJKMNQUVXZ"
isMajorMonth(product_root, month_code)
Checks whether a month code is major for a given futures root.
Parameters:
product_root (string) : Futures root symbol, e.g. "SI"
month_code (string) : Single-letter month code, e.g. "H"
Returns: bool true if month_code is included in the major set for that root
isAllowedMonth(product_root, month_code)
Checks whether a month code is allowed for a given futures root.
Parameters:
product_root (string) : Futures root symbol, e.g. "SI"
month_code (string) : Single-letter month code, e.g. "H"
Returns: bool true if month_code is included in the allowed set for that root
Perpustakaan Pine Script®






















