-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update futures margins #4479
Update futures margins #4479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to do a bit more work to filter out and isolate some of these issues. Overall, this is pretty good 😃
Data/future/cbot/margins/EH.csv
Outdated
# https://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv13-594.html | ||
20130410,4180,3800 | ||
20131202,2970,2700 | ||
20131204,4180,3800 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like some of these old values' initial margins are not 110% of the maintenance.
Data/future/cme/margins/GE.csv
Outdated
20140919,715,650 | ||
20141017,632.5,575 | ||
20140922,176,160 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sporadic, though it seems standard for this contract. If I remember correctly, the Eurodollar contract's margins apply to tiers of contracts. Maybe the changes in tiers causes the value to be very volatile 🤔
Data/future/nymex/margins/1S.csv
Outdated
20150616,6025,5477 | ||
20150617,5834,5303 | ||
20150618,5636,5123 | ||
20150619,5431,4937 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some thoughts, no changes required:
These margins change every day. Maybe this is the percentage of a single contract that is required as initial margin rather than fixed portfolio values. Either way, this is going to be great for backtesting now that we have all of these margins.
Data/future/nymex/margins/A0D.csv
Outdated
20170310,1375,1250 | ||
# https://www.cmegroup.com/notices/clearing/2017/05/Chadv17-167.html | ||
20170407,13750,12500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is 10x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Data/future/nymex/margins/EWN.csv
Outdated
20131015,4950,4500 | ||
# https://www.cmegroup.com/notices/clearing/2017/03/Chadv17-108.html | ||
20131016,16500,15000 | ||
20131029,27500,25000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong order of magnitude.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suspect margins
* Fixes previously incorrect margins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sanity check these last bits and then should be good to go.
20130320,550,500 | ||
20130404,1430,1300 | ||
20130417,550,500 | ||
20130502,1430,1300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one still seems not quite correct. Perhaps can just skip all the mid-month ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite the back and forth, this is one of the test cases I focused on early to ensure we had proper margins. I took a look closely, and this one is correct.
The margins change frequently because when the front-month contract expires, the new front-month contract still retains its old margin value, but it shifts to a lower margin value once that contract is closer to expiry.
Data/future/comex/margins/AUP.csv
Outdated
20170303,385,350 | ||
# https://www.cmegroup.com/notices/clearing/2017/05/Chadv17-183.html | ||
20170519,363,330 | ||
# https://www.cmegroup.com/notices/clearing/2017/11/Chadv17-467.html | ||
20170306,348,316 | ||
20170307,336,305 | ||
20170308,324,294 | ||
20170309,311,282 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we should increase this to every month minimum. Every 3 days is a little much for this data
Data/future/nymex/margins/A0D.csv
Outdated
# https://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv13-268.html | ||
20130611,2475,2250 | ||
# https://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv13-304.html | ||
20130102,85,77 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems abnormally low
Data/future/nymex/margins/A0F.csv
Outdated
20130206,72,65 | ||
20130207,2200,2000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Front-month roll over?
Data/future/nymex/margins/A9N.csv
Outdated
20130905,8517,7742 | ||
20130906,6387,5806 | ||
20130909,61600,56000 | ||
20130910,66000,60000 | ||
20140421,52800,48000 | ||
# https://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv14-279.html | ||
20140714,45100,41000 | ||
# https://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv14-469.html | ||
20141205,55000,50000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think this shifts from every 3 days to every few months?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that CME decided to switch from percentage values to a fixed dollar value around the time of the 2013-09-09 entry, but I have no known way to confirm this. CME currently shows fixed margin values on their margins page, but those that have percentage margins tended to behave like this contract did early on.
* Only the first margin of a percentage margin will be used from now onwards
Known issues for posterity: 1 - These are the margins of the first contract on-chain - at least a month out. The real margins approaching expiration are much lower. Including every single day's update is a lot of unnecessary data that doesn't improve the platform much. 2 - LEAN margin modeling for these contracts is a large approximation and should actually be per contract not a fixed number for all contracts. Rewrite needed to move these into an algorithm/approximation based on the SPAN risk formula. That said -- its still a large improvement with many new, previously unmodelled contracts added so will merge as is and plan for rewrite of futures margins at a later date. |
Kudos to @gsalaz98 for this awesome work!
Description
Update future margins data.
Related Issue
N/A
Motivation and Context
Better and updated margins improves futures backtesting modelling and behavior.
Requires Documentation Change
N/A
How Has This Been Tested?
N/A
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>