NexusFi: Find Your Edge


Home Menu

 





PC-SPAN


Discussion in Options

Updated
      Top Posters
    1. looks_one Dudetooth with 218 posts (213 thanks)
    2. looks_two ron99 with 116 posts (55 thanks)
    3. looks_3 CafeGrande with 30 posts (4 thanks)
    4. looks_4 BlueRoo with 24 posts (5 thanks)
      Best Posters
    1. looks_one Dudetooth with 1 thanks per post
    2. looks_two SMCJB with 1 thanks per post
    3. looks_3 ron99 with 0.5 thanks per post
    4. looks_4 BlueRoo with 0.2 thanks per post
    1. trending_up 188,781 views
    2. thumb_up 317 thanks given
    3. group 75 followers
    1. forum 610 posts
    2. attach_file 159 attachments




 
Search this Thread

PC-SPAN

  #41 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785

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.

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Better Renko Gaps
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #42 (permalink)
 spj77 
Qld, Australia
 
Experience: Beginner
Platform: Excel/Hoadley/PC-SPAN
Broker: OX
Trading: Options
Posts: 28 since Mar 2012
Thanks Given: 6
Thanks Received: 44

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

Thanks!
Scott

Reply With Quote
  #43 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785



spj77 View Post
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

Thanks!
Scott

With spanit you are using the program without having to open it. Thus saving a bunch of time.

Here is the manual for spanit.
https://www.cmegroup.com/confluence/display/pubspan/Script+Language+for+PC-SPAN+v.4.05+and+SPAN+Risk+Manager

Here is the manual for all of PC-SPAN
https://www.cmegroup.com/confluence/display/pubspan/SPAN+Overview

Started this thread Reply With Quote
Thanked by:
  #44 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785

Warning.

The example spreadsheet in this CME Span Pos Converter pdf manual
https://www.cmegroup.com/clearing/risk-management/files/spanposconvutil.pdf

for ES shows using cc code (column J) ES. But that is not correct. You need to use cc code SP.

I emailed CME about this. We'll see if they do anything.

Started this thread Reply With Quote
  #45 (permalink)
 Dudetooth 
Steubenville Ohio
 
Experience: Intermediate
Platform: OX, OEC, RJO
Trading: Options on Futures
Posts: 266 since Sep 2012
Thanks Given: 30
Thanks Received: 274

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.

Attached Files
Elite Membership required to download: Margin without PC-SPAN.zip
Reply With Quote
Thanked by:
  #46 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785

Dudetooth, that is great! The options I compared all matched PC-SPAN for margin.

I found out that you have to use capitalized letters for the symbols.

How do you use the Single Position button?

Can other commodities be added? Like HE (Hogs), CT, CO, DA (milk), HO, RB, SI.

Started this thread Reply With Quote
  #47 (permalink)
 Dudetooth 
Steubenville Ohio
 
Experience: Intermediate
Platform: OX, OEC, RJO
Trading: Options on Futures
Posts: 266 since Sep 2012
Thanks Given: 30
Thanks Received: 274


ron99 View Post
I found out that you have to use capitalized letters for the symbols.

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.


ron99 View Post
How do you use the Single Position button?

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.


ron99 View Post
Can other commodities be added? Like HE (Hogs), CT, CO, DA (milk), HO, RB, SI.

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.

Reply With Quote
Thanked by:
  #48 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785

Yes I would like those symbols added if you could.

I am going to add the download disk array macro to this spreadsheet. So then all can be done from one spreadsheet.

There wouldn't be a problem adding that on this spreadsheet?

Started this thread Reply With Quote
  #49 (permalink)
 Dudetooth 
Steubenville Ohio
 
Experience: Intermediate
Platform: OX, OEC, RJO
Trading: Options on Futures
Posts: 266 since Sep 2012
Thanks Given: 30
Thanks Received: 274


ron99 View Post
There wouldn't be a problem adding that on this spreadsheet?

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.

Reply With Quote
Thanked by:
  #50 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,647 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338



Dudetooth View Post
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.


Dude -
This looks awesome! Can you save a version in Excel 97 format? I am still way behind the times...

Follow me on Twitter Reply With Quote




Last Updated on September 23, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts