Did you double check to make sure the date is correct? It has to be in this format: 20140627
That's Friday. As far as I know, it won't pull in the closest business day, so you have to be precise.
If the download happens, you still won't see any data in Excel's "scanner" tab unless you select one or more (or all) commodities to scan.
You won't see any data in the "tracker" tab unless you've entered the data for one or more options in columns A-E. When you "track all" or "track select" it will then populate columns H-AD. Note: you can hide some of the columns in the H-AD range, if you don't use them.
Last edited by CafeGrande; June 29th, 2014 at 01:07 AM.
This will list every pa2 file in your data folder in column A:
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim ws As Worksheet
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set ws = Worksheets.Add
'Get the folder object associated with the directory
Set objFolder = objFSO.GetFolder("C:\Span4\Data\")
'ws.Cells(1, 1).Value = "The files found in " & objFolder.Name & " are:"
'Loop through the Files collection
x = 5
For Each objFile In objFolder.Files
If InStr(objFile.Name, "cme") > 0 And InStr(objFile.Name, ".pa2") > 14 Then
x = x + 1
ws.Cells(x, 1).value = Mid(objFile.Name, 5, 8)
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
You could add something like this to the bottom of the download_risk_files routine to add the date every time you download a new pa2:
For the first time, the two daily files are not downloading and unzipping/extracting themselves. I thought it might be "my" version of PC-SPAN so I downloaded a fresh copy from the first page of this thread and the same thing happened.
Here's what theSPAN data folder looks like today. Note the CME file is not unzipped and it looks like the ICE file was not downloaded at all.
FWIW, I deleted the zipped CME file and tried again for 20140701 ... same result.
I have been working on this in a number of different ways. I currently have the track sheet working in a category or group manner. See the screen shot below. The groups here a based different accounts, candidate selection and trade execution.
Considering the Ib risk naviagator I am thinking that such groups could be at a product level or at a product contract. For example; Soyabeans or Soyabeans July and Soyabeans August.
It occurs to me that you may wish to manage the greeks for different months differently. So to lump a trade you have in july with a trade you have in August would be unhelpful.
Thinking about how we can create a portfolio sheet with greeks and portfolio margin with profit/loss should not be too difficult but just getting the structure of the idea right first may be very helpful.
Any ideas or suggestions that you have would be appreciated.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
Sorry, it should make more sense if you see it in the entire routine. Here's my sub for downloading the pa2 files ... the last block of code adds the new date if it doesn't already exist.
On Error GoTo GetOut
Dim Batchfile As String
Dim path As String
Dim dateit As Double
Dim namecme As String, namenyb As String
dateit = Range("Scanner!G1").value
namecme = "cme." & dateit & ".s.pa2.zip"
namenyb = "nyb." & dateit & ".s.pa2.zip"
path = Range("Setup!A5").value '"C:\Span4\Data"
If Range("Setup!A18") = "Delete Dates" Then
If Dir(path & "\cme.s.pa2") <> "" Then 'delete old pa2 files if they exist
Kill path & "\cme.s.pa2" 'delete old pa2 files
If Dir(path & "\nyb.s.pa2") <> "" Then 'delete old pa2 files if they exist
Kill path & "\nyb.s.pa2"
Name path & "\" & "cme." & dateit & ".s.pa2" As path & "\cme.s.pa2"
Name path & "\" & "nyb." & dateit & ".s.pa2" As path & "\nyb.s.pa2"
lastdate = Range("Historic!A" & Rows.Count).End(xlUp).Row '140222*** add dates to hist when downloading new pa2
Dim rng1 As Range
Dim strSearch As String
strSearch = dateit
Set rng1 = Range("A6:A" & lastdate).Find(strSearch, , xlValues, xlWhole)
If rng1 Is Nothing Then
Range("Historic!A" & lastdate + 1) = CStr(Range("Scanner!G1"))
The following user says Thank You to Dudetooth for this post: