PC-SPAN (Page 30) - Options on Futures | futures.io
futures.io futures trading
 

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Traders Hideout > Options on Futures


PC-SPAN
Started:October 23rd, 2013 (09:36 AM) by ron99 Views / Replies:41,409 / 403
Last Reply:November 19th, 2016 (08:49 AM) Attachments:100

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike
     

Reply
 100  
 
Thread Tools Search this Thread

PC-SPAN

Old December 10th, 2014, 12:35 PM   #291 (permalink)
Elite Member
Chicago, IL
 
Futures Experience: Beginner
Platform: RTrader
Favorite Futures: CL
 
Posts: 15 since Apr 2013
Thanks: 9 given, 1 received

days to expiration

@Dudetooth,

Do you have an way to calculate the days to expiration (DTE) for a given open? In the SPAN files CME disseminates, they give the options year and month, very similar to an options symbol. For example: Natural Gas, 201501. This is obviously NGF15 (with some strike price).

I tried looking at the Type records on CME's Web page and nothing jumped out.

Is there a DTE in the SPAN files somewhere? Or do you have to calculate it yourself? Or is there an elegant way to find this information?

Thanks in advance.

Reply With Quote
     

Old December 10th, 2014, 12:56 PM   #292 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received


enderqa View Post
@Dudetooth,

Do you have an way to calculate the days to expiration (DTE) for a given open? In the SPAN files CME disseminates, they give the options year and month, very similar to an options symbol. For example: Natural Gas, 201501. This is obviously NGF15 (with some strike price).

I tried looking at the Type records on CME's Web page and nothing jumped out.

Is there a DTE in the SPAN files somewhere? Or do you have to calculate it yourself? Or is there an elegant way to find this information?

Thanks in advance.

The line you are looking for is the Type B line in the CME SPAN file.

The Type B for NG would look something like this:
B NYMON OOF201402 201402 003124330005000002000030000330000000014520500000001000020140128NG

CME maps out what is found in the span files found here:
http://www.cmegroup.com/confluence/display/pubspan/Type+B+-+Expanded

From that you will find that there is a 7 digit string (characters 73-79) that is the Time to Expiration (in years). In the above example that would be 0145205 ... multiply by 0.000365 and you get the DTE.

Also, there is a 8 digit string (characters 92-99) which is the Expiration Date as YYYYMMDD (20140128 in the example above).

Hope this helps.

Reply With Quote
     
The following 2 users say Thank You to Dudetooth for this post:
     

Old December 10th, 2014, 12:59 PM   #293 (permalink)
Elite Member
Chicago, IL
 
Futures Experience: Beginner
Platform: RTrader
Favorite Futures: CL
 
Posts: 15 since Apr 2013
Thanks: 9 given, 1 received



Dudetooth View Post
The line you are looking for is the Type B line in the CME SPAN file.

The Type B for NG would look something like this:
B NYMON OOF201402 201402 003124330005000002000030000330000000014520500000001000020140128NG

CME maps out what is found in the span files found here:
http://www.cmegroup.com/confluence/display/pubspan/Type+B+-+Expanded

From that you will find that there is a 7 digit string (characters 73-79) that is the Time to Expiration (in years). In the above example that would be 0145205 ... multiply by 0.000365 and you get the DTE.

Also, there is a 8 digit string (characters 92-99) which is the Expiration Date as YYYYMMDD (20140128 in the example above).

Hope this helps.

Thank you, I missed this when I was looking through their Web page! I really appreciate all the time you've given me.

-enderqa

Reply With Quote
     

Old April 3rd, 2015, 06:03 PM   #294 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: Intermediate
Platform: R, C#
Favorite Futures: Futures
 
Posts: 53 since Dec 2013
Thanks: 73 given, 70 received

Hi,

Does anyone have historical SPAN files and would be willing to kindly share those? The files on the CME FTP ftp.cmegroup.com only go back to January 2013.

Thanks

Reply With Quote
     

Old April 4th, 2015, 08:19 AM   #295 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received

Futures Edge on FIO

Are you a NinjaTrader user?

 

volemont View Post
Hi,

Does anyone have historical SPAN files and would be willing to kindly share those? The files on the CME FTP ftp.cmegroup.com only go back to January 2013.

Thanks

CME temporarily posted 2012 data at one time, though the formatting was different. It was only there for a short period of time, and unfortunately I did not grab it.

I don't know of anyone on the thread who did grab the data. Sorry.

Reply With Quote
     

Old April 16th, 2015, 11:10 PM   #296 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: None
Platform: ChartNexus
Favorite Futures: N/a
 
Posts: 3 since Apr 2015
Thanks: 2 given, 0 received

Hi everyone!

I read through the forum pages, thank you for the information all of you have provided - you lot are really awesome to share all of this ^^

I am currently figuring out how to pull the data for the SGX (Singapore Ex.) and CME for the TSI Iron Ore.
Was playing around with your excel - XLS SPan 04b3 - it works perfectly, but does your excel support the SGX pa2 files?


It seems like I can only scan for positions for NYB and CME only for now :/

Cheers!
Cdan

Reply With Quote
     

Old April 17th, 2015, 07:02 AM   #297 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received


Cdanitius View Post
It seems like I can only scan for positions for NYB and CME only for now :/

Each commodity has to be coded into the spreadsheet so that the correct lines of data can be found. You can, however, add as many as you would like. You just need to know the product code and a little about VBA to modify the file. If you want to know how, give me an example of a commodity you'd like to track and I can walk you through the process.

Reply With Quote
     

Old April 19th, 2015, 10:58 PM   #298 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: None
Platform: ChartNexus
Favorite Futures: N/a
 
Posts: 3 since Apr 2015
Thanks: 2 given, 0 received

Hi Dudetooth!

Thanks for the really prompt reply.

I am currently trying to track the FE and FEF (Iron Ore CFR China (62% Fe Fines) Swaps & Futures respectively) and also the TIO (Iron Ore as well) from the NYMEX exchange.

The SGX parameter files can be found here. (I can't post it here, its under the SGX main website, under Clearing,Span Download PM Cycle)

I tried playing around with the automated download for the SGX files but they change the urls every day.(not just the date)

How did you manage to extract data from the pa2 files?

Really appreciate if you could give me a mini walkthrough =)

Cheers!

Reply With Quote
     

Old April 22nd, 2015, 05:19 PM   #299 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received


Cdanitius View Post
Really appreciate if you could give me a mini walkthrough

So, I have good news and bad news.

The bad: Adding the SGX exchange and commodities should have been fairly easy, but as I started to look at their pa2 files I noticed that they are missing the Type P line of data. The Type P data has info on where to place the decimals in the prices and if the data is missing it will throw an error in the spreadsheet. I will check, but I don't think that is an easy fix for this in the spreadsheet.

The good: Adding TIO and any other CME or NYB commodities is fairly easy.
1) In Visual Basic Editor, open the Function P34Bstring in the Functions module.
2) Find Case "ZB" and right above that line insert this:
Case "TIO"
strS(0) = "P NYMICT OOF"
strS(1) = "3 NY-TIO1001"
strS(2) = "4 NY-TIO01"
strS(3) = "B NYMICT OOF"
strS(4) = "82NYMTIO TIO FUT"

Final code with TIO inserted should look like this:
Case "SI"
strS(0) = "P CMXSO OOF"
strS(1) = "3 CX-SI 1001"
strS(2) = "4 CX-SI 01"
strS(3) = "B CMXSO OOF"
strS(4) = "82CMXSI SI FUT"
Case "TIO"
strS(0) = "P NYMICT OOF"
strS(1) = "3 NY-TIO1001"
strS(2) = "4 NY-TIO01"
strS(3) = "B NYMICT OOF"
strS(4) = "82NYMTIO TIO FUT"
Case "ZB"
strS(0) = "P CBT17 OOF"
strS(1) = "3 17 1001"
strS(2) = "4 17 01"
strS(3) = "B CBT17 OOF"
strS(4) = "82CBT17 17 FUT"

3) Go to the Function T8string
4) Find Case "ZB" and right above that line insert this:
Case "TIO"
str5 = "82NYMICT TIO OOF"

Final code with TIO inserted should look like this:
Case "SI"
str5 = "82CMXSO SI OOF"
Case "TIO"
str5 = "82NYMICT TIO OOF"
Case "ZB"
str5 = "82CBT17 17 OOF"

Where did I find these lines of code? All it takes is a little footwork to find the info in the pa2 file. Open a CME pa2 file in Notepad.exe. The first line to look for is the Type P line of data. You know that TIO is traded on NYMEX, so do a search for "p nymtio". You'll find "P NYMTIO FUTIRON ORE FUTURE002000 000050000000000000000001USD$STD 00 IRON ORE FUTURES", but that line if for the futures. The next line down is what you need: "P NYMICT OOFIRON ORE 62% FE002002 000050000000000000000001USD$STD 00EUROIRON ORE 62% FE,(TSI) CHINA APO". If you noticed, you don't need all of it for the code just the first characters through "OOF". Right underneath that are the Type 3, Type 4 and Type B lines. There are a lot of Type B lines, one for every futures and options contract. You have to go down quite a bit until you see "B NYMTIO FUT" which is a futures contract turn into "B NYMICT OOF" which is the first options contract. Notice that the Type B is "B NYMICT" not "B NYMTIO". Many commodities use a different code for the options than for the futures. That's what gave me the clue to search for "ICT" when finding the Type 82 line of data.

Confused yet? It sounds a lot worse than it really is. Compare the initial strings you see in the code to the lines of data you see in the pa2 file and after a while it should make sense.

With those two modifications in the spreadsheet I ran the numbers for an option and it match what CME Core was showing for it.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


I attached a text file with the two modified modules so you can see the proper formatting because some of the spaces are removed in the lines of code when I post them in the reply.

Attached Files
Register to download File Type: txt Modified Code.txt (10.6 KB, 10 views)
Reply With Quote
     
The following user says Thank You to Dudetooth for this post:
     

Old April 30th, 2015, 06:24 AM   #300 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: None
Platform: ChartNexus
Favorite Futures: N/a
 
Posts: 3 since Apr 2015
Thanks: 2 given, 0 received


Hey Dudetooth,

Really appreciate your long and detailed post - I apologize for the really late reply.

I had played around with what you had mentioned, but I didn't make much progress. It was eating quite a bit of my time so I had decided to pass what you had said over to my colleagues who understood more about programming so they could tackle it in their free time. They were pretty amazed to see what you had come up with.

Instead, I had customized a spreadsheet that had links to my current position files (in the format they are recorded) - it converts and exports all of them as CSV files, and runs them through PC - Span to gather the margins I require. Not the most efficient way, but it currently works for me.

Thank you for your time! Awesome forum and people =)

Reply With Quote
     

Reply



futures.io > Futures Trading, News, Charts and Platforms > Traders Hideout > Options on Futures > PC-SPAN

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

NinjaTrader 8: Features and Enhancements, Tips and Tricks

Dec 6
 

Al Brooks: Stop Losing when a Good Trade goes Bad, Correcting Mistakes

Elite only
 

Trading Technologies: Algo Design Lab hands-on

Dec 13
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current PC Specs tderrick Tech Support 45 October 28th, 2012 04:40 PM
Any PC Gamers in here? forrestang Off-Topic 61 October 10th, 2012 03:37 PM
Virtual PC setup how? boze man Tech Support 5 September 8th, 2012 04:59 PM
I need PC help Boomer34 Tech Support 5 January 22nd, 2012 03:28 PM
PC Question NMTrader Off-Topic 0 July 12th, 2009 11:56 PM


All times are GMT -4. The time now is 03:41 PM.

Copyright © 2016 by futures.io. 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.
 
no new posts

Page generated 2016-12-03 in 0.15 seconds with 20 queries on phoenix via your IP 54.163.147.69