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,372 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

  #161 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,384
Thanks Received: 10,206


Dudetooth View Post
I haven't used that utility in a few months, so I've forgotten quite a bit already. You batch and script look the same as the last versions I used. I set up a test and got the same error as your second (error saving the log). I still got the reports, but the rptBatch.log was not saved, nor the rptBatch.err. I'm pretty sure I had seen that error before, but I'm afraid I can't remember why it was happening or if I was able to fix it. CME's help file on it didn't really help other than to list the default locations where the reports and logs go.

If it were me, I'd just ignore the error ... your still getting the reports. Sorry, that probably wasn't much help either.

I've been having the error consistently for several weeks, doesn't seem to effect anything. I wouldn't worry except that I'm finally about to start automating the dozens of portfolio's I'm running and their reports and am worried that the error message will cause the code execution to break. I might try contacting CME but in my past experience their customer service is not good.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
Increase in trading performance by 75%
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Spoo-nalysis ES e-mini futures S&P 500
14 thanks
  #162 (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

SMCJB,

I think I may have a solution for you.

Try running your "c:\SPAN4\RptModule\spanReport.hta C:\SPAN4\Risk.xml" as a separate batch file and have it placed in the "C:\Span4\RptModule" or any other subfolder within "C:\Span4". It appears as though the spanReport.hta is looking to find the Reports folder in a particular location.

One the error it states: "..//reports/rptBatch.log" which looks sort of like the old DOS command when you would type in "CD.." backing you out one folder level. When I did this it ran the reports and did not generate an error. Even tried placing it in the "C:\Span4\Data" and it worked as well.

Reply With Quote
  #163 (permalink)
Mo111
Detroit MI/USA
 
Posts: 21 since Jan 2014
Thanks Given: 12
Thanks Received: 10


Hi @Dudetooth,

I'm using your spreadsheet to do some backtesting - I'm looking up prior option premiums for a certain strike in the past at different dates. It works well by typing in the prior date in the past in A1, and then downloading the data, and then copying down the premium and IM. Then I'd repeat with another date.

I was wondering if there is anyway to put in multiple dates, and have it download and calculate the margin and premium at a certain strike for different dates?

Thanks!

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


Mo111 View Post
I was wondering if there is anyway to put in multiple dates, and have it download and calculate the margin and premium at a certain strike for different dates?

If you can hang on a few more days, I'm ironing out the last few kinks in a new spreadsheet that includes the ability to track an option history. I'm hoping to post it by this weekend at the latest.

Thanks.

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

Here's the latest and greatest.

Here's a few of the features:
-Added Scanner and Historic tools
-Internalized calculations to eliminate the need of a Temp tab
-Extracted more data from pa2 files, reducing need for data to present in the code and making it easier to add new commodities
-Increased the speed of the code by utilizing arrays to minimize the number of times the pa2 files need to be scanned
-Added the ability to select SPAN or Total IM
-Added futures price, historic volatility and implied volatility to option data extracted

Special thanks to Ron, Kevin and Jay for ideas and troubleshooting to help me make this better.

Beta updates:
-Fixed ROI sort on scanner to include column G
-Fixed contract sort on scanner to include column G
-Fixed contract sort on scanner to sort by futures then option then strike
-Fixed issue with SOM compounding on tracker that was calculating incorrect margin
-Added sort ROI / contract on tracker
-Added erase all results on tracker
-Cell A3 is now selected on historic after changing dates / before running calculations
-Fixed blank rows causing error in calculation
-Changed ROI to 365/DTE/12*net premium/(IM*IM Multiplier)
-Changed instructions on hist tracker added a helpful hints form
-pa2 files are now saved with date in name unless Setup A18 is changed, then back to old way
-Added clear tracker results if no option data in columns A-D
-Cabinet settlement price displayed as 0.5
-Fixed grain price adjustment
-Added more date tools for historic
-Fixed error with option at expiration causing error in calculations

Enjoy.

Attached Files
Elite Membership required to download: XLS-SPAN.xls
Reply With Quote
  #166 (permalink)
 
Physicsman's Avatar
 Physicsman 
London + Great Britain
 
Experience: Master
Platform: Interactive Brokers, OptionsXpress, TradeMonster, RJO, AmiBroker, Wealthlab
Trading: Futures, Options, Equities
Posts: 19 since May 2013
Thanks Given: 85
Thanks Received: 25

Just clicking the "Thanks" button wasn't adequate to express just how extraordinarily good your Excel SPAN margin calculator sheet is now!! I'm pretty much out of superlatives - I think "Wow" gets close though!

Thank you very much @Dudetooth!! It is appreciated more than you could know!

Reply With Quote
  #167 (permalink)
Mo111
Detroit MI/USA
 
Posts: 21 since Jan 2014
Thanks Given: 12
Thanks Received: 10

Thank you @Dudetooth! This excel sheet will definitely open up new ways to analyze and backtest strategies.

I'm having trouble with the spreadsheet. I have Windows 8 64 bit and excel 2010. I got this error when I click on anything in the sheet:





Any thoughts? I had no trouble using the previous (v3) sheet.

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


Mo111 View Post
Any thoughts? I had no trouble using the previous (v3) sheet.

A minor addition seems to be the source of the problem.


In the Functions Module delete:

'Written: October 07, 2007
'Author: Leith Ross
'Summary: Add Minimize, and Maximize/Restore buttons to a VBA UserForm

Private Const GWL_STYLE As Long = -16
Public Const MIN_BOX As Long = &H20000
Public Const MAX_BOX As Long = &H10000

Const SC_CLOSE As Long = &HF060
Const SC_MAXIMIZE As Long = &HF030
Const SC_MINIMIZE As Long = &HF020
Const SC_RESTORE As Long = &HF120

Private Declare Function GetWindowLong _
Lib "user32.dll" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong _
Lib "user32.dll" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

'Redraw the Icons on the Window's Title Bar
Private Declare Function DrawMenuBar _
Lib "user32.dll" _
(ByVal hwnd As Long) As Long

'Returns the Window Handle of the Window accepting input
Private Declare Function GetForegroundWindow _
Lib "user32.dll" () As Long

Public Sub AddToForm(ByVal Box_Type As Long)

Dim BitMask As Long
Dim Window_Handle As Long
Dim WindowStyle As Long
Dim Ret As Long

If Box_Type = MIN_BOX Or Box_Type = MAX_BOX Then
Window_Handle = GetForegroundWindow()

WindowStyle = GetWindowLong(Window_Handle, GWL_STYLE)
BitMask = WindowStyle Or Box_Type

Ret = SetWindowLong(Window_Handle, GWL_STYLE, BitMask)
Ret = DrawMenuBar(Window_Handle)
End If

End Sub


View the code of the Help form and delete:

Private Sub UserForm_Activate()
AddToForm MIN_BOX
End Sub

Reply With Quote
  #169 (permalink)
Mo111
Detroit MI/USA
 
Posts: 21 since Jan 2014
Thanks Given: 12
Thanks Received: 10


Dudetooth View Post
A minor addition seems to be the source of the problem.


In the Functions Module delete:

It worked like charm! This excel sheet is truly amazing. I still cant believe it can do all this. My jaw literally just dropped.

WOW @Dudetooth

Thank you!


Reply With Quote
  #170 (permalink)
CafeGrande
St Paul, MN, USA
 
Posts: 200 since Jan 2014
Thanks Given: 131
Thanks Received: 207


Thanks again! Very impressive. I think adding the volatility measures can help everyone become a better risk manager, if not trader.

One question: Does the PC-SPAN documentation tell you how many trading days are used for the historical volatility (HV) calculation, and does the day count vary across exchanges?

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