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)
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.
This will list every pa2 file in your data folder in column A:
Sub ListPA2Files()
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
Sheets("Historic").Select
'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)
End If
Next
'Clean up!
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
End Sub
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 had no problem today. Maybe just manually unzip the cme file, and grab the ice file from the ftp site, and manually unzip that too, and try again tomorrow.
Maybe you have a hard disk issue (hard disk out of space, for example)?
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.
I added this but it doesn't work for me. Can you explain lastdate in that line? My column A is formatted as text. The dates are in the 20140702 format as text not dates.
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.
Sub download_risk_files()
On Error GoTo GetOut
Dim RetVal
Dim Batchfile As String
Dim path As String
Dim dateit As Double
Dim namecme As String, namenyb As String
Wait.Show vbModeless
DoEvents
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
End If
If Dir(path & "\nyb.s.pa2") <> "" Then 'delete old pa2 files if they exist
Kill path & "\nyb.s.pa2"
End If
Name path & "\" & "cme." & dateit & ".s.pa2" As path & "\cme.s.pa2"
Name path & "\" & "nyb." & dateit & ".s.pa2" As path & "\nyb.s.pa2"
End If
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"))
End If