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)
Just reposting this from the Selling Options on Futures thread:
ron99 asked about using a batch file to run SPAN and generate a report.
I've been able to get this to work to create a performance bond risk summary of the portfolio ... not sure yet how to get anything like the Scan Risk Contributions in the Reports tab ... looks like that will need a different kind of script to run the spanReport utility.
Here's what I did:
- In the C:\Span4 folder (default location for installation of program) I placed a copy of the following:
-- Unzipped risk array files (cme.20131018.s.pa2 & nyb.20131018.s.pa2)
-- My portfolio file that I generated in PC-SPAN by right-clicking on my portfolio and selecting Copy Positions To File to generate a .pos file (RJO 131018.pos)
- Then I opened Notepad to create my script and typed in the following lines:
Load C:\Span4\cme.20131018.s.pa2
Load C:\Span4\nyb.20131018.s.pa2
Load C:\Span4\RJO 131018.pos
Calc
SaveCalcSummary C:\Span4\Summary.csv
-- I saved it as a text file named SpanScript.txt in the C:\Span4 folder
- Then in Notepad, on a clean slate I typed in:
spanit C:\Span4\SpanScript.txt
-- Saved this as a batch file (File->Save As changing the Save as type to All Files) named SPAN-Batch.bat in the same folder where the spanit.exe file is (should be C:\Span4\Bin)
Just double-click my batch file (SPAN-Batch.bat), and it will load the risk arrays and portfolio, calculate and create a csv file named Summary in the C:\Span4 folder with my performance bond summary.
Hopes this helps.
****UPDATE****
Make the following changes to the instructions above to see the Position and PB Requirement Reports:
- In the SpanScript.txt type the following lines:
Load C:\Span4\cme.20131018.s.pa2
Load C:\Span4\nyb.20131018.s.pa2
Load C:\Span4\RJO 131018.pos
Calc
Save C:\Span4\Risk.xml
- In the SPAN-Batch.bat file type the following lines:
C:\Span4\Bin\spanit.exe C:\Span4\SpanScript.txt
C:\Span4\RptModule\spanReport.hta C:\Span4\Risk.xml
This will create the reports in the C:\Span4\Reports folder.
This is my first take at some VBA in a spreadsheet to help automate some of the tasks ... it's not pretty, but does some of the basic functions I was looking for (download risk arrays, unzip, rename, run batch file). It would be easy to tweak to have it open the Summary.csv and edit, etc. if you are comfortable with VBA. If not, let me know and I'll see what I can modify to have it do what you are looking for.
Do you use the RiskReporter in PC-SPAN to calculate the risk per position ... I believe they refer to it as Scan Risk Contributions? If you do, do you use the command line to generate the report?