NexusFi: Find Your Edge


Home Menu

 





PC-SPAN


Discussion in Options

Updated
      Top Posters
    1. looks_one Dudetooth with 218 posts (213 thanks)
    2. looks_two ron99 with 116 posts (55 thanks)
    3. looks_3 CafeGrande with 30 posts (4 thanks)
    4. looks_4 BlueRoo with 24 posts (5 thanks)
      Best Posters
    1. looks_one Dudetooth with 1 thanks per post
    2. looks_two SMCJB with 1 thanks per post
    3. looks_3 ron99 with 0.5 thanks per post
    4. looks_4 BlueRoo with 0.2 thanks per post
    1. trending_up 188,781 views
    2. thumb_up 317 thanks given
    3. group 75 followers
    1. forum 610 posts
    2. attach_file 159 attachments




 
Search this Thread

PC-SPAN

  #31 (permalink)
 Dudetooth 
Steubenville Ohio
 
Experience: Intermediate
Platform: OX, OEC, RJO
Trading: Options on Futures
Posts: 266 since Sep 2012
Thanks Given: 30
Thanks Received: 274


ron99 View Post
Looks like it needed the full path for spanit.

That'll do it. If no path is given it will default to the folder the batch file is in. I went back through my batch files and placed the full path in all of them just to be safe.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Deepmoney LLM
Elite Quantitative GenAI/LLM
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #32 (permalink)
 Dudetooth 
Steubenville Ohio
 
Experience: Intermediate
Platform: OX, OEC, RJO
Trading: Options on Futures
Posts: 266 since Sep 2012
Thanks Given: 30
Thanks Received: 274


spj77 View Post
But i am hoping to get just the straight margin for each as if it were traded independently of anything else, like if it was the only position in the portfolio.t

Another route you could look at would be to use the RiskReported.exe as mentioned in post #12.

It'll give you a CSV file that looks like the attached pic (activeValue= last value of position; scanContr= margin for that position) :

Reply With Quote
Thanked by:
  #33 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785



Dudetooth View Post
Another route you could look at would be to use the RiskReported.exe as mentioned in post #12.

It'll give you a CSV file that looks like the attached pic (activeValue= last value of position; scanContr= margin for that position) :

I don't understand. I get $61 IM for each OG contract.

Started this thread Reply With Quote
Thanked by:
  #34 (permalink)
 spj77 
Qld, Australia
 
Experience: Beginner
Platform: Excel/Hoadley/PC-SPAN
Broker: OX
Trading: Options
Posts: 28 since Mar 2012
Thanks Given: 6
Thanks Received: 44

Wish the CME would hurry up and send me a user id and password so i can download SpanPosCov.exe...So frustrating, want to try the ideas you guys have given!

Reply With Quote
  #35 (permalink)
 spj77 
Qld, Australia
 
Experience: Beginner
Platform: Excel/Hoadley/PC-SPAN
Broker: OX
Trading: Options
Posts: 28 since Mar 2012
Thanks Given: 6
Thanks Received: 44

Hi Ron,
So if in PCSPAN each option is its own portfolio, would you use the risk reporter tool to extract them all out into one excel/csv file, or do you have another method?
Cheers
Scott



ron99 View Post
Scott, if you put the symbol in the firm name then you will get the margin for each. That is what I do. See post #14.

SPAN will group the results by firm name with the same acct ID. So everything on the spreadsheet will the same firm name and acct ID will be calculated together to give you margin for all lines of the spreadsheet with that firm name and acct ID.

If you want margin for each contract then put your symbol in the firm name and anything in acct ID.

If you want margin for a spread, Put the same firm name and acct ID for each leg. SPAN will then combine them.

Tip: The spreadsheet must be closed in order to run the SPANPosConv batch. Also blank lines in spreadsheet are ignored.


This is how it would look if you put them into the SPAN program.


Reply With Quote
  #36 (permalink)
 Dudetooth 
Steubenville Ohio
 
Experience: Intermediate
Platform: OX, OEC, RJO
Trading: Options on Futures
Posts: 266 since Sep 2012
Thanks Given: 30
Thanks Received: 274


ron99 View Post
I get $61 IM for each OG contract.

I did misspeak (thanks for catching that) ... it is the scan risk contribution that is listed, not the margin. The main thing is that it does not add in the Short Option Minimum (SOM). I loaded it up in PC-SPAN with 1 GCZ3 C1660 I get $61 for risk and $71 for IM. Digging through PC-SPAN results it looks like the SOM for GC added $55 to the $7 risk array (rounded to $61), plus the option value of $10 for the $71 total.

Unfortunately, the ScanRiskContr report doesn't reflect the SOM. That is done in the PBReq report, but in there the SOM is grouped by commodity so it won't be too helpful for multiple positions in the same market. Your method of using the spanit.exe with the position name in the firm column may be the best solution for calculating individual position margin that will include the SOM. Thanks for the idea.

Reply With Quote
  #37 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785


spj77 View Post
Wish the CME would hurry up and send me a user id and password so i can download SpanPosCov.exe...So frustrating, want to try the ideas you guys have given!

CME give good customer service?

Started this thread Reply With Quote
  #38 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785

The procedure would be to create the CSV spreasheet like post #12 with your contracts.

Run SPAN Position Converter Utility to create the .pos file.

Run the SPAN Script batch (spanit) created in post #6.

The output of SPAN Script would be a spreadsheet that looks like this (Column M is the IM)



Or if you run my FormatSPANMargins sub it would look like this (Column L is the IM) I delete column A and do a Text to Column procedure on the resulting Column A to extract the symbols from the rest of the info.



Column H is the current option value in dollar form. You just multiply this by -1 to get a positive number.
Column J is the MM.

Started this thread Reply With Quote
Thanked by:
  #39 (permalink)
 ron99 
Cleveland, OH
 
Experience: Advanced
Platform: QST
Broker: QST, DeCarley Trading, Gain
Trading: Options on Futures
Posts: 3,081 since Jul 2011
Thanks Given: 980
Thanks Received: 5,785


Dudetooth View Post
I did misspeak (thanks for catching that) ... it is the scan risk contribution that is listed, not the margin. The main thing is that it does not add in the Short Option Minimum (SOM). I loaded it up in PC-SPAN with 1 GCZ3 C1660 I get $61 for risk and $71 for IM. Digging through PC-SPAN results it looks like the SOM for GC added $55 to the $7 risk array (rounded to $61), plus the option value of $10 for the $71 total.

Unfortunately, the ScanRiskContr report doesn't reflect the SOM. That is done in the PBReq report, but in there the SOM is grouped by commodity so it won't be too helpful for multiple positions in the same market. Your method of using the spanit.exe with the position name in the firm column may be the best solution for calculating individual position margin that will include the SOM. Thanks for the idea.

The SPAN Risk under Initial Requirements is the IM. $61 in this case. That matches statements I get from the firms I trade at.

The Risk Initial amount on the statements is what I am looking to match. The Initial Margin number on some statements includes the value of the option. But that number is not used to determine margin calls and we don't use that to determine ROI.

The $55 is the MM.

Started this thread Reply With Quote
  #40 (permalink)
 spj77 
Qld, Australia
 
Experience: Beginner
Platform: Excel/Hoadley/PC-SPAN
Broker: OX
Trading: Options
Posts: 28 since Mar 2012
Thanks Given: 6
Thanks Received: 44


Hi,

I finally received the login credentials from the CME and have started to try and automate the PC-SPAN experience like you guys.

But i am hitting the second hurdle. I have copied your guys coding from earlier posts and the 'DownloadRiskArrayFiles" sub works fine; places the unzipped data files in the 'span4\data' folder ready for loading into SPAN. All good there.

I created a "SpanScriptLoadRiskArrayFiles.txt" file and saved it in Span4\Bin folder. It contains two lines:
Load C:\Span4\Data\cme.s.pa2
Load C:\Span4\Data\nyb.s.pa2

I created a "LoadRiskArrayFiles.bat" file and saved it in Span4\Bin folder. It contains:
C:\Span4\Bin\spanit.exe C:\Span4\Bin\SpanScriptLoadRiskArrayFiles.txt


When i run the macro, it opens up a dos window which contains "Batch Interface for PC-SPAN" and then says it is loading the files. The window then closes. The problem is when i then open PC-SPAN to see if files have been loaded it is empty in there.......... The data files themselves are fine as i loaded them manually in PC-SPAN and they populate as you would expect (and then exited without saving).

Any ideas what i am missing / doing wrong? I can't find any setting in the program where i need to enable batch processing...


My Code is attached:
-------------------------------------------------

Sub DownloadRiskArrayFiles()

On Error GoTo GetOut
Dim RetVal
Dim batchfile As String
Dim path As String
dateit = Range("SpanMacro!B2").Value 'Date in YYYYMMDD format
namecme = "cme." & dateit & ".s.pa2.zip"
namenyb = "nyb." & dateit & ".s.pa2.zip"
path = "C:\Span4\Data"

SaveWebFile "ftp://ftp.cmegroup.com/pub/span/data/cme/" & namecme, path & "\" & namecme
SaveWebFile "ftp://ftp.cmegroup.com/pub/span/data/nyb/" & namenyb, path & "\" & namenyb

Call UnZip(path & "\", path & "\" & namecme)
Call UnZip(path & "\", path & "\" & namenyb)

Kill path & "\" & namecme
Kill path & "\" & namenyb

Kill path & "\cme.s.pa2"
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"

GetOut:
End Sub

-----------------------------------------------

Sub LoadRiskArrayFiles()

batchfile = "C:\Span4\Bin\LoadRiskArrayFiles.bat"
RetVal = Shell(batchfile, 1)

End Sub

-----------------------------------------------


Cheers
Scott

Reply With Quote




Last Updated on September 23, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts