Sorry for being obnoxious, but I have a follow up question. I implemented the roll mechanism now and get weird results. Consider the current term structure of Crude Oil (of which December will be traded).
December 2024 has a volume of 7800 and December 2025 has a volume of 1300. I currently have no position in December 2024 and December 2025 is considered liquid. Therefore the status will be ROLLADJUST. That means that I cannot open a position in Crude and have to wait till either December 2024 expires or the liquidity changes (December 2025 has more volume than 2024 or drops below 1% of 2024).
I have absolutely no experience in the volume profiles going forward, but don't I have to wait quite some time before I can open a contract in Crude? Or is my roll calendar erroneous? Perhaps ROLLADJUST only makes sense if the current contract expires soon? Thanks for your help!
View attachment 339919
Not sure you're being obnoxious but you clearly haven't understood what I was trying to say.
"December 2024 has a volume of 7800 and December 2025 has a volume of 1300. I currently have no position in December 2024 and December 2025 is considered liquid. Therefore the status will be ROLLADJUST. "
Yes
"That means that I cannot open a position in Crude and have to wait till either December 2024 expires"
No.
ROLLADJUST just means we roll - so the system would shift the current priced contract from being Z24 to Z25 and does the back adjustment, the code then resets the role state to no roll, and we're free to take a position in Z25.
Rob
Code:
=======================================================================================================================================================
Status and time to roll in days
=======================================================================================================================================================
status roll_expiry price_expiry carry_expiry contract_priced contract_fwd position_priced relative_volume_fwd contract_volume_fwd
ALUMINIUM_LME No_Roll 24 69 104 20240700 20240800 0.0 1.381 231
Roll_exp is days until preferred roll set by roll parameters. Prc_exp is days until price contract expires, Crry_exp is days until carry contract expires
Contract suffix: p=price, f=forward, c=carry
Contract volumes over recent days, normalised so largest volume is 1.0
************************************************************************************************
Automatically changing state from RollState.No_Roll to RollState.Roll_Adjusted for ALUMINIUM_LME
************************************************************************************************
********************************************************************************
Rolling adjusted prices!
Current multiple prices
CARRY CARRY_CONTRACT PRICE PRICE_CONTRACT FORWARD FORWARD_CONTRACT
index
2024-05-07 09:00:00 2578.5 20240800 2565.0 20240700 2578.5 20240800
2024-05-07 10:00:00 2576.0 20240800 2560.5 20240700 2576.0 20240800
2024-05-07 11:00:00 2560.5 20240800 2544.5 20240700 2560.5 20240800
2024-05-07 12:00:00 2568.5 20240800 2549.0 20240700 2568.5 20240800
2024-05-07 13:00:00 2563.0 20240800 NaN 20240700 2563.0 20240800
2024-05-07 14:00:00 2558.0 20240800 NaN 20240700 2558.0 20240800
New multiple prices
CARRY CARRY_CONTRACT PRICE PRICE_CONTRACT FORWARD FORWARD_CONTRACT
index
2024-05-07 10:00:00 2576.0 20240800 2560.5 20240700 2576.0 20240800
2024-05-07 11:00:00 2560.5 20240800 2544.5 20240700 2560.5 20240800
2024-05-07 12:00:00 2568.5 20240800 2549.0 20240700 2568.5 20240800
2024-05-07 13:00:00 2563.0 20240800 2549.0 20240700 2563.0 20240800
2024-05-07 14:00:00 2558.0 20240800 2549.0 20240700 2558.0 20240800
2024-05-07 14:00:01 NaN 20240900 2558.0 20240800 NaN 20240900
Current adjusted prices
index
2024-05-03 23:00:00 2543.5
2024-05-07 08:00:00 2557.0
2024-05-07 09:00:00 2565.0
2024-05-07 10:00:00 2560.5
2024-05-07 11:00:00 2544.5
2024-05-07 12:00:00 2549.0
Name: price, dtype: float64
New adjusted prices
index
2024-05-07 10:00:00 2569.5
2024-05-07 11:00:00 2553.5
2024-05-07 12:00:00 2558.0
2024-05-07 13:00:00 2558.0
2024-05-07 14:00:00 2558.0
2024-05-07 14:00:01 2558.0
dtype: float64
********************************************
AUTO ROLLING - NO USER CONFIRMATION REQUIRED
********************************************
2024-05-08 16:50:02 DEBUG Interactive_Update-Roll-Status {'component': 'parquetFuturesMultiplePricesData', 'instrument_code': 'ALUMINIUM_LME'} Wrote 2585 lines of prices for ALUMINIUM_LME to parquetFuturesMultiplePricesData
2024-05-08 16:50:02 INFO Interactive_Update-Roll-Status {'component': 'parquetFuturesMultiplePricesData', 'instrument_code': 'ALUMINIUM_LME'} Added data for instrument ALUMINIUM_LME
2024-05-08 16:50:02 DEBUG Interactive_Update-Roll-Status {'component': 'parquetFuturesAdjustedPricesData', 'instrument_code': 'ALUMINIUM_LME'} Wrote 2585 lines of prices for ALUMINIUM_LME to parquetFuturesAdjustedPrices
2024-05-08 16:50:02 INFO Interactive_Update-Roll-Status {'component': 'parquetFuturesAdjustedPricesData', 'instrument_code': 'ALUMINIUM_LME'} Added data for instrument ALUMINIUM_LME
2024-05-08 16:50:02 DEBUG Interactive_Update-Roll-Status Successful roll! Returning roll state of ALUMINIUM_LME to RollState.No_Roll
)