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 190,268 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

  #471 (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


uuu1965 View Post
@Dudetooth
Sorry, I forgot how to get simple futures price, f.e. CLQ7

I tried to get this and other NYMEX and COMEX contracts and got this



but when I tried LH or ZC or CC or ES I got the futures data for 20170609???

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #472 (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 tried to get this and other NYMEX and COMEX contracts and got this



but when I tried LH or ZC or CC or ES I got the futures data for 20170609???

I had just developed the code for tracking futures back when I first put this out and didn't get a lot of troubleshooting in on it. NYMEX and COMEX contracts had issues because the future contracts were being skipped in the code.

It's not too difficult of a fix, though there may be other issues I haven't seen yet. I've uploaded the spreadsheet because posting the code in the forum may not show the proper spacing and you can copy the code over to your existing spreadsheet. There are three areas to address ...

1) In MainCalculation module - add the bit about clsOpt.TypeB1:

'*********** TypeB ... option month details: dte, base volatility, delta scaling factor
Case 3
If InStr(rline, clsOpt.TypeB) = 1 Or InStr(rline, clsOpt.TypeB1) = 1 Then '170611 TypeB1 needed for loading COMEX/NYMEX Fut contracts



2) In COption class module - At the top add pTypeB1:

Private pTypeB As String, pTypeB1 As String, pType8F As String, pType8O As String, pType30


3) Down further in the COption class module - add this new set of code:

Public Property Get TypeB1() As String '170611 needed for loading COMEX/NYMEX Fut contracts
Select Case pCommodity
Case "CL": TypeB1 = "B NYMCL "
Case "GC": TypeB1 = "B CMXGC "
Case "HG": TypeB1 = "B CMXHG "
Case "HO": TypeB1 = "B NYMHO "
Case "NG": TypeB1 = "B NYMNG "
Case "RB": TypeB1 = "B NYMRB "
Case "SI": TypeB1 = "B CMXSI "
Case Else: TypeB1 = "XXXX"
End Select
End Property


I tucked it in between Public Property Get TypeB1() and Public Property Get Type8F(), but anywhere should do. There should be 8 spaces between the last letter of the B code and the last quotation mark.

Let me know if there are any other issues.

Attached Files
Elite Membership required to download: XLS-SPAN (05c).zip
Reply With Quote
Thanked by:
  #473 (permalink)
Pawan Mishra
New Delhi India
 
Posts: 1 since Jun 2017
Thanks Given: 0
Thanks Received: 0


Hi

This is Pawan Mishra. I'm new to PC-SPAN, but I know basics of batch scripting. I'm looking for how to process .spn/.pa2 file using scripting. I tried below suggested way, it is working for .spn / .pa2 span files. But, it is failing while loading .pos file.

1- Getting "Error processing script" while loading .pos file. What could be the reason?

2- How can I create .pos file from my existing .csv or .txt files?

Thanks in advance for your kind help

Thanks and Regards





Dudetooth View Post
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.


Reply With Quote
  #474 (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


Pawan Mishra View Post
Hi

This is Pawan Mishra. I'm new to PC-SPAN, but I know basics of batch scripting. I'm looking for how to process .spn/.pa2 file using scripting. I tried below suggested way, it is working for .spn / .pa2 span files. But, it is failing while loading .pos file.

1- Getting "Error processing script" while loading .pos file. What could be the reason?

2- How can I create .pos file from my existing .csv or .txt files?

Thanks in advance for your kind help

Thanks and Regards

Have you tried the SpanPosConv utility?



It may be something that can help.

Reply With Quote
  #475 (permalink)
illinoisrei
Seattle, WA
 
Posts: 4 since Dec 2016
Thanks Given: 2
Thanks Received: 0


Pawan Mishra View Post
Hi

This is Pawan Mishra. I'm new to PC-SPAN, but I know basics of batch scripting. I'm looking for how to process .spn/.pa2 file using scripting. I tried below suggested way, it is working for .spn / .pa2 span files. But, it is failing while loading .pos file.

1- Getting "Error processing script" while loading .pos file. What could be the reason?

2- How can I create .pos file from my existing .csv or .txt files?

Thanks in advance for your kind help

Thanks and Regards

The SpanPosConv from CME works great for that purpose. I use it every day to convert csv's to .pos (xml files).

However, it does not work consistently when going from .pos to csv. I recommend using the functionality in Excel with the proper xml map (xsd) for that.

Reply With Quote
  #476 (permalink)
illinoisrei
Seattle, WA
 
Posts: 4 since Dec 2016
Thanks Given: 2
Thanks Received: 0


ItalianBmT View Post
Thanks Dudetooth. But unfortunately this doesn't solve the issue even when adding PtrSafe. Thanks anyway and I shan't disturb you further. Hopefully others who are using 64 bit version could chime in if they experience similar instance on their machine?

Thanks.

I had the same problem.

You should only change "Dim lngRetVal As Long" to "Dim lngRetVal As LongPtr"

That should do it.

Reply With Quote
  #477 (permalink)
Hills
Barcelona
 
Posts: 14 since Mar 2015
Thanks Given: 7
Thanks Received: 7

I trade options on currencies futures. Some month ago 6A was the pair with less margin required so the ROI was the best one. Nowadays when I use the SPAN spreadsheet I can't find any pair. Does anyone know if margin in currencies futures has changed?

Reply With Quote
  #478 (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


Hills View Post
I trade options on currencies futures. Some month ago 6A was the pair with less margin required so the ROI was the best one. Nowadays when I use the SPAN spreadsheet I can't find any pair. Does anyone know if margin in currencies futures has changed?

Actually, I was just noticing that issue this morning. It seems like the options are now structured like ES with one code for Mar, Jun, Sep & Dec options, another code for the off months, and another code for weekly options.

It'll take me a little bit to change the code to assimilate the new products.

Reply With Quote
Thanked by:
  #479 (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

There is some sight modifications to the COption Class Module and MainCalculation Module to add the new currency options contracts for months with no underlying futures contract (Jan, Feb, Apr, May, Jul, Aug, Oct, Nov). Option contracts with underlying futures (Mar, Jun, Sep, Dec) still use the older code.

The new codes are located on the Parameters tab (ADU, GBU, CAU, EUU, JPU).

So, if you were scanning for 6A options with 30-90 DTE on the Scan tab you would have one line with AD and one line with ADU to see if either contract meets your time-frame.



It seems to be working correctly, but there may be some bugs ... just let me know if there are any and I'll try to sort them out.

Attached Files
Elite Membership required to download: XLS-SPAN (05c).zip
Reply With Quote
  #480 (permalink)
uuu1965
Riga Latvia
 
Posts: 107 since Jan 2013
Thanks Given: 441
Thanks Received: 72


to @Dudetooth
HI,
some ES contract are displayed on Scan sheet but cann`t work on Track sheet, f.e. EWZ7 P 2565 (I use 05c version of XLS-SPAN). Please see attachment

Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	151
Size:	69.1 KB
ID:	242963  
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