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

  #81 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,647 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338

@Dudetooth -

I was able to add some new instruments: BP, AD, CD. I will post the code once I verify the results tonight.


I tried, but failed, with the following. Could you add them when you get a chance?

Soybean Meal
Soybean Oil
Copper
30 Year US Bonds
10 Year Treasury Notes
Eurodollars


I have found some good trades in those instruments.


THANKS

Follow me on Twitter Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Exit Strategy
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
NexusFi Journal Challenge - April 2024
Feedback and Announcements
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #82 (permalink)
 mu2pilot 
Dallas, TX
 
Experience: Advanced
Platform: T4, Zaner360, TOS
Broker: DeCarley Trading
Trading: Options
Posts: 104 since Sep 2013
Thanks Given: 134
Thanks Received: 52


Dudetooth View Post
I'd gather that you are looking for a step-by-step on how this is done within the spreadsheet. That will take me a little bit to jot down in a narrative form to show you where the data is within risk arrays and explain the process. If you give me some time, I'll see what I can come up with.

Even though you don’t use Excel, if you can look through the spreadsheet and its VBA code some of the process may make sense with your ability to program in Python.

Wouldn't it be easier to just post your VBA code? Understanding your steps aren't that difficult if you know a little about programming and can inspect the code. I can post it, but don't want to without Dudetooth's permission.

Reply With Quote
  #83 (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 took a quick look over at CME ... most other products we have in this spreadsheet seem to have the same date for last trade and settlement, even LC. I checked a couple on ICE and the date in the SPAN is what they list as the last trade date. It almost looks like LH is odd man out.

Reply With Quote
  #84 (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


kevinkdog View Post
I was able to add some new instruments: BP, AD, CD. I will post the code once I verify the results tonight.

Great ... looking forward to it.



kevinkdog View Post
I tried, but failed, with the following. Could you add them when you get a chance?

I added it to the "to-do" list for the next update.

Reply With Quote
  #85 (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


mu2pilot View Post
Wouldn't it be easier to just post your VBA code? Understanding your steps aren't that difficult if you know a little about programming and can inspect the code. I can post it, but don't want to without Dudetooth's permission.

That's fine by me, but it seems to me that it would be rather difficult to understand the process without seeing the corresponding data in the spreadsheet.

Reply With Quote
  #86 (permalink)
 mu2pilot 
Dallas, TX
 
Experience: Advanced
Platform: T4, Zaner360, TOS
Broker: DeCarley Trading
Trading: Options
Posts: 104 since Sep 2013
Thanks Given: 134
Thanks Received: 52


Dudetooth View Post
That's fine by me, but it seems to me that it would be rather difficult to understand the process without seeing the corresponding data in the spreadsheet.

Yeah, you're probably right. The other option is to download a trial copy of excel and look at the code that way. Assuming he has a windows box to load it on. If he has no windows computers, then that's a non-starter.

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

I have been playing around with currencies in the SPAN spreadsheet. Here is what I have found:

1. In the spreadsheet, the delta calculations for Euro (6E) and Yen (6J) are double what they actually are. This can be corrected easily in the code (by changing code to d1=1). @Dudetooth - can you verify this?

2. For settlement dates, the Options Express Trade Calculator gives the options expiration date as 3 days before the SPAN settlement date. This is true for all currencies I looked at (BP, EC, CD, AD, JY). So, if you are used to calculating ROI based on OEX date, the SPAN spreadsheet ROI will be lower.

For ROI calculations, I believe you want to use options expiration date, not settlement date. Can someone confirm my thinking?


3. I have added the following currencies: BP, AD, CD. Code is below:

If con1 = "A6" Or con1 = "6A" Or con1 = "AD" Then '6A Globex, A6 Barchart
stk1 = stk1 * 1000
str1 = "CMEAD AD OOF" & cp1
str1 = str1 & "201" & yr1 & umo1 & " 201" & yr2 & omo1
strSearch = str1 & " " & Application.WorksheetFunction.Text(stk1, "0000000")
strSearch2 = "3 AD"
strSearch3 = "4 AD"
strSearch4 = "B CMEAD OOF201" & yr1 & umo1 & " 201" & yr2 & omo1
imm2 = 2
v1 = 1#
d1 = 1
'CMEBP BP; CMEC1 C1; CMEAD AD
ElseIf con1 = "B6" Or con1 = "6B" Or con1 = "BP" Then '6B Globex, B6 Barchart
stk1 = stk1 * 1000
str1 = "CMEBP BP OOF" & cp1
str1 = str1 & "201" & yr1 & umo1 & " 201" & yr2 & omo1
strSearch = str1 & " " & Application.WorksheetFunction.Text(stk1, "0000000")
strSearch2 = "3 BP"
strSearch3 = "4 BP"
strSearch4 = "B CMEBP OOF201" & yr1 & umo1 & " 201" & yr2 & omo1
imm2 = 2
v1 = 0.625
d1 = 1
'CMEBP BP; CMEC1 C1; CMEAD AD
ElseIf con1 = "C6" Or con1 = "6C" Or con1 = "CD" Then '6C Globex, C6 Barchart
stk1 = stk1 * 1000
str1 = "CMEC1 C1 OOF" & cp1
str1 = str1 & "201" & yr1 & umo1 & " 201" & yr2 & omo1
strSearch = str1 & " " & Application.WorksheetFunction.Text(stk1, "0000000")
strSearch2 = "3 CD"
strSearch3 = "4 CD"
strSearch4 = "B CMEC1 OOF201" & yr1 & umo1 & " 201" & yr2 & omo1
imm2 = 2
v1 = 1#
d1 = 1

Follow me on Twitter Reply With Quote
  #88 (permalink)
 enderqa 
Chicago, IL
 
Experience: Beginner
Platform: RTrader
Trading: CL
Posts: 15 since Apr 2013
Thanks Given: 9
Thanks Received: 1

@Dudetooth,

Maybe we can start small. Here are four lines from the CME settlement's file


Quoting 
354561:81NYMLO CL OOFC201403 201403 000920000622-00657+01282-00048-00002-01304+01982-00808-00575+00000000000470N
354562:82NYMLO CL OOFC201403 201403 000920001887+02719-01618-01108+02406+02458-01270+06196+002043440000470++06225+C
354563:81NYMLO CL OOFP201403 201403 000920000622-00657+00232-01002+01052-00254+00118+01292+01525-00000000000242N
354564:82NYMLO CL OOFP201403 201403 000920000213-00431+01532+02042-00744-00661+01848-03784-002043440000242++03775-C

I believe these are Crude Oil options. This is because "NYMLO" and "CL" are symbols CME uses for Crude Oil. Here is what I can surmise from the fields. The fist number, e.g., "354561", is NOT in the file, it is the line number. After the colon ":" the actual file begins.
  1. The first feild is 81NYMLO or 82NYMLO. I don't know the difference between the 81 and 82. But I see it in a number of lines.
  2. The "CL" field probably lists the underlying future
  3. The OOFC201403/OOFP201403 lists "options on futures" and then "C" or "P" for call or put. Then the year and month of the underlying future.
  4. The next date "201403" is probably the expiration of the option, in this case the same as the future.
  5. Then it looks like there is a series of numbers I don't understand. There is a "00092" which I think may the the option's strike price. But then it's all Greek to me.

If you could help me understand the long string of numbers, and let me know how you converted that into the Initial Margin (IM) that would be great. I don't need to calculate the Delta. You have some other fields: price, value, DTE, Risk, etc. I dont' need those either at the moment. Like I said, I want to start small and just get the IMs. Then I can look to see how easy or hard it is too add other things.

Lastly, I did download Dudetooth's Excel Macro (xlsm) file. I can load it in LibreOffice but I can't see the underlying "guts" of the program. (I do have a Window's box, but I don't feel like trying to setup Excel just to do one thing).

As for posting the source code. I would recommend you use pastebin: Pastebin.com - #1 paste tool since 2002!. You post the code there. The Web site give you a URL, and then post the URL/link here in the forum. This way the forum isn't cluttered with code.

Reply With Quote
  #89 (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

enderqa, Here is what is in the file.

https://www.cmegroup.com/confluence/display/pubspan/Type+8+Records+-+Standard

Started this thread Reply With Quote
  #90 (permalink)
 mu2pilot 
Dallas, TX
 
Experience: Advanced
Platform: T4, Zaner360, TOS
Broker: DeCarley Trading
Trading: Options
Posts: 104 since Sep 2013
Thanks Given: 134
Thanks Received: 52




FYI, when I open a .pa2 file in a text editor, it appears to be the "expanded" version of the file layout. Here is the file structure for the expanded .pa2 file:

https://www.cmegroup.com/confluence/display/pubspan/Type+8+-+Expanded

The first data record is "81". If you scroll down, you'll see where record type "82" begins.

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