Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Scott, the spanit program does not load the arrays into the program for you to use PC-SPAN. You have to load them manually if you want to use the PC-SPAN program.
Oh, now i see why in the spanscript file you need to:
- load datafiles
- load position files
Calc
- send summary output csv file all in the one batch, as the data is not actually stored anywhere you need it to return the csv file output before the batch file completes.....makes perfect sense now i know that.
I was trying to seperate them into multiple tasks in different batch files thinking the data is stored in the program for the next step
I've been working on a spreadsheet that can extract the risk, value and delta of an option from the CME risk arrays for some time. After ron99 found some discrepancies with a previous post about risk and margin it forced me to review the methods I was using, but it helped me to eventually come up with what I think is some better code. I found that the short option minimum and initial-to-maintenance ratio (two items I was missing) were in the risk arrays, so you have everything you need to calculate the SPAN initial/maintenance and the Total initial/maintenance margins (option value added to SPAN margins).
Just enter the option, the underlying, call or put, strike and net positions and the spreadsheet will extract/calculate the price of the option, the position value, option delta, position risk, short option minimum, and the SPAN and Total margins. I tested this out on a few portfolios to make sure that it was coming up the same numbers as PC-SPAN. I know ron99 said that his firms use the SPAN initial margin, but the firms I trade at use the Total initial margin, so I decided to included both the SPAN and Total margins in the spreadsheet.
I think an advantage that this may have is that it's a little simpler to get the numbers ... all that is needed is the spreadsheet and the risk arrays (no PC-SPAN or batch files).
Don't get me wrong, it has its limitations. It is only coded to work with 12 of the markets I trade, but could be expanded fairly easy. I think I can get it to do simple, two-legged spreads eventually, but for now it will calculate individual option positions. Another aspect it does not handle right now are the credits for offsetting positions, so if you are looking for entire portfolio margin calculation stick with PC-SPAN.
If anyone happens to take it for a spin, let me know if you find any issues ... I'm sure they are in there.
Happy Thanksgiving!
***A few additional notes if you give it a try, the option contract, underlying contract and strikes should stay in the format as shown in the spreadsheet. Short positions should be entered as negative numbers in the net column (e.g. -2). Also, the spreadsheet will be looking for the CME risk arrays labelled as cme.s.pa2 and nyb.s.pa2 in the C:\Span4\Data folder.
Thanks for finding that. I suppose I could fix that by having the code make your text input upper case before running the search. I'll put it on the to-do list.
When you click on the Single Position button an input box will appear asking you to select an option. Click anywhere in the row of an option you want to look at and click OK. It runs the code for just that row/option. It should come in handy if you have just a couple of options to check our or if you add one to your list and don't want to run them all. I will eventually get that into my main spreadsheet so as I am looking at potential trades I can run the numbers for just the strikes that I may want to sell.
Yes, it just takes a little reverse-engineering. I run a test portfolio in PC-SPAN so I can find the symbols and values and then dig through the risk arrays manually to make sure I get the search strings right. I can add these symbols to the to-do list if you'd like.
No, their shouldn't be any issues ... just check the cell references in the code to make sure they are looking in the right place and it should work fine. I'll look to add the download/unzip/rename function on the next version.