Questions about using 'sysinit/futures/rollcalendars_from_db_prices_to_csv.py' #1568
Replies: 1 comment 6 replies
-
|
I think you misunderstand the purpose of roll calendars. The purpose of roll calendars is only to generate historical multiple price data. That should be a one-time thing (for each instrument).
Technically, yes. But "everytime" is really just once per instrument. I don't know why that script would ignore the last entry, but it does seem like you need it to be there. The script was probably written with a different use-case in mind.
No. The normal process would be: Update sampled contracts --> download contract prices --> generate multiple prices --> generate adjusted prices Update sampled contracts ( When it is time to roll a contract, you would use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've just downloaded contract price date for CHFJPY from 2020 to 2025 by using barchart, and i used the script
sysinit/futures/rollcalendars_from_db_prices_to_csv.pyto generate roll calendar and usedsysinit/futures/multipleprices_from_db_prices_and_csv_calendars_to_db.pyto generate multiple prices. However i found that the generated roll calendar only goes to 2025-06-13and my multiple prices shows that the PRICE_CONTRACT doesn't change to 20251200 from 2025-09-15 to 2025-10-17
It's confused since i got the contract price data till 2025-10-17, i thought the last roll date would be around 2025-09-13. After i check the code i found that in file
sysinit/futures/build_roll_calendars.py, the functionadjust_to_price_serieswould ignore the last line of approx calendar which i think is just 2025-09-13My question is :
download contract prices data(no matter from barchart or from IB) -->generate roll calendar based on rollconfig and contract prices data -->generate multiple price -->generate back adjusted price
Hopefully someone can answer my question or point out my mistake, thanks in advance.:)
Beta Was this translation helpful? Give feedback.
All reactions