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)
I apologize. I almost have to re-learn my old code when I go back through it and I got that one messed up.
The issue was in the option value function. It was fine with v3 and v4b was off, but it wasn't just as simple as cut and paste from one to the other (the structure changed), so replace the function optionvalue with the code in the attached text file.
I gave it a quick check and it seemed to work, but let me know if you find any other issues.
Same thing. The two files download OK and if I "track select" or "scan select" ICE contracts the application works fine. If I include CME contracts the "calculating - please wait" window displays for a long time and eventually Excel will freeze ("not responding") and must be force closed. The Excel detail window called it "AppHangB1"
I don't know if the data is messed up in the zipped file, but it seems to be missing the carriage-return character at the end of the lines (if you open it in notepad, all the data is run together as one continuous line). PC-SPAN must be coded to read the data even without the carriage-return character, but my code looks to read each line.
Sorry about this, but downloading the cme.s.pa2 has the same issue. What I originally did was open the link in my browser where it was displayed with the line breaks. I copied that and pasted it into notepad and saved it as my pa2. I assumed that downloaded the cme.s.pa2 would work and just realized now that it had the same issue.
- let the whole thing download in a browser window
- CTRL A, CTRL C, open a notepad, CTRL V
- save notepad in SPAN4 > DATA folder, make sure it's saved as "all files" and the correct file extension (.pa2) will magically appear (the default save mode might be .txt, which won't work).
A little more clarification on the issue with Friday's CME data.
Normally, the pa2 files have a Windows encoding for line breaks ... the characters CrLf:
Friday's data appears to have had a Unix encoding, using only Lf to designate the line breaks:
PC-SPAN is apparently fine with just Lf, but VBA needs to see the CrLf. This issue appears to have been a big enough of a deal to prompt CME to replace all of Friday's pa2 files with updated ones that have the CrLf encoding in place. This should indicate that we're not likely to see this happen again, but if it does the following code can fix it for you.
In the Functions module add this routine:
Sub FixLf(FileName As String) 'code to replace vbLf with vbCrLf if CME's pa2 files switch to unix code
Dim buff
On Error Resume Next
Open FileName For Input As #1
buff = Input$(LOF(1), #1)
Close #1
If InStr(buff, vbCrLf) = 0 Then
buff = Replace$(buff, vbLf, vbCrLf)
End If
Open FileName For Output As #1
Write #1, buff
Close #1
On Error GoTo 0
End Sub
In the Sub download_risk_files() add these lines right before the end of the sub where you see the line "GetOut:" so your last 5 lines look like this:
You can load this code now if you want. It will check your downloaded pa2 for CrLf encoding. If it is present it leaves things alone, but if it can't find any CrLf it will assume that Lf is being used and change all Lf encoding to CrLf.
I am trying to figure out how to use Dudetooth's program to calculate margin without SPAN program installed, when I click the link on the summary page to get Risk array: it is something like this, there is no pa2 anywhere. What I have done:
1: downloaded his latest program: XLS-SPAN(04b)
2: Built a path C:\SPAN4\DATA on my computer
Please help if anyone knows where is the pa2 file, thanks!
Index of /pub/span/data/
Name Size Date Modified
[parent directory]
asxcl/ 10/24/14, 3:35:00 AM
asxclf/ 10/24/14, 1:35:00 AM
bfx/ 10/24/14, 2:05:00 PM
bmdc/ 10/24/14, 6:25:00 AM
bourseafr/ 10/24/14, 1:34:00 PM
bse/ 5/17/14, 12:36:00 PM
cbt/ 8/17/09, 12:00:00 AM
cce/ 4/27/12, 12:00:00 AM
ccl/ 4/27/12, 12:00:00 AM
ccx/ 12/26/13, 12:00:00 AM
cdc/ 10/23/14, 5:14:00 PM
cee/ 10/24/14, 9:31:00 AM
cfe/ 10/23/14, 6:12:00 PM
clearing/ 1/2/07, 12:00:00 AM cme/ 10/24/14, 11:33:00 AM
cmx/ 4/27/12, 12:00:00 AM
dgc/ 10/24/14, 7:21:00 AM
difx/ 10/23/14, 6:54:00 AM
ecc/ 10/24/14, 12:45:00 PM
elx/ 10/23/14, 6:17:00 PM
eus/ 9/24/10, 12:00:00 AM
hkf/ 10/24/14, 9:08:00 AM
ice/ 10/23/14, 6:21:00 PM
jcch/ 10/24/14, 2:44:00 AM
jsc/ 10/24/14, 1:54:00 AM
kcb/ 12/26/13, 12:00:00 AM
kdpw/ 10/24/14, 12:17:00 PM
kel/ 10/22/14, 11:44:00 AM
lch/ 5/15/14, 6:01:00 AM
liffe/ 10/24/14, 1:55:00 PM
lme/ 10/23/14, 3:52:00 PM
mat/ 10/24/14, 12:40:00 PM
mcx/ 10/24/14, 2:14:00 PM
mcx-sx/ 9/15/14, 11:03:00 PM
mge/ 10/23/14, 4:04:00 PM
micex/ 12/26/13, 12:00:00 AM
nocc/ 12/26/13, 12:00:00 AM
nos/ 5/15/14, 6:01:00 AM
nse/ 10/20/14, 1:21:00 AM
nyb/ 10/23/14, 5:15:00 PM
nyl/ 10/23/14, 5:34:00 PM
nym/ 4/27/12, 12:00:00 AM
nzf/ 12/26/13, 12:00:00 AM
nzx/ 10/24/14, 12:14:00 AM
ocx/ 10/23/14, 6:17:00 PM
ose/ 12/26/13, 12:00:00 AM
pbt/ 2/15/14, 12:00:00 AM
pnx/ 4/27/12, 12:00:00 AM
sdco/ 10/24/14, 7:49:00 AM
sfe/ 12/26/13, 12:00:00 AM
smx/ 10/24/14, 1:35:00 PM
smxcc/ 3/15/14, 12:00:00 AM
taifex/ 10/24/14, 1:55:00 AM
takas/ 10/24/14, 10:15:00 AM
tcc/ 2/12/14, 12:00:00 AM
test_exch/ 10/28/13, 12:00:00 AM
tif/ 10/24/14, 2:04:00 AM
tse/ 3/15/13, 12:00:00 AM
wce/ 10/23/14, 4:05:00 PM
xeu/ 9/24/10, 12:00:00 AM
xma/ 10/23/14, 8:49:00 PM
xny/ 10/23/14, 6:17:00 PM
Did you grab the XLS-SPAN from post #2? I lost track, but I know that I did get the latest patched file linked on post #2.
Did you go through the instructions on the Setup tab? Section 2 covers downloading the pa2 files. All you need to do is enter the date (YYYYMMDD format, like 20141024) in cell G1 on the Scanner tab and then click the Download Risk button. It goes out and finds the right web address and downloads the pa2 files to your C:\SPAN4\DATA folder.
Once that is done then you can scan for trades or enter positions on the Tracker tab to follow their progress from day to day. I think that the Setup tab instructions cover all of that and there should be some example positions on the Tracker tab to show you how to set them up.
Yes, I printed out the Setup tab and did as told step by step, but nothing came out except something like program flashing/shining then disappeared from my screen, it was fast and I could see what was that.
I am not good at computers/codes, I've finished reading this whole thread and tried to understand what you guys were talking about, most of posts are pretty hard to understand. Luckily and thanks to your hard work, there is a program to use without installing PC SPAN, but I just could use it. Frustrated...