PC-SPAN - Options on Futures | futures io social day trading
futures io futures trading


PC-SPAN
Updated: Views / Replies:53,008 / 478
Created: by ron99 Attachments:113

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 113  
 
Thread Tools Search this Thread
 

PC-SPAN

  #441 (permalink)
Trading Apprentice
Java/IN
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: gold
 
Posts: 12 since Nov 2013
Thanks: 2 given, 0 received

I am not sure whether vba just skips when there is error because i do not get the prompt that the file exists, it just gors strUght to m5 unable to download

Reply With Quote
 
  #442 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 214 since Sep 2012
Thanks: 26 given, 240 received

I may have an idea of what may be happening. I should have a fix for you to try tomorrow. It may be related to the 64-bit version of Office.

Reply With Quote
 
  #443 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 214 since Sep 2012
Thanks: 26 given, 240 received

Possible fix


@ItalianBmT

It looks as though Office 64-bit has issues with some functions. The Lib "urlmon" may need to have "PtrSafe" added to the beginning and the Long variables as LongPtr to safely run in 64-bit Office. I don't currently have the 64-bit version of Office, so I am not sure if this will solve the issue.

Try going into the Download module at the top under "Option Explicit" and replacing:

Private Declare Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long


with this:

Private Declare PtrSafe Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As LongPtr, _
ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As LongPtr, _
ByVal lpfnCB As LongPtr) As LongPtr


Let me know if we need to adjust.

Reply With Quote
 
  #444 (permalink)
Trading Apprentice
Java/IN
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: gold
 
Posts: 12 since Nov 2013
Thanks: 2 given, 0 received

When I run, another part of the code sprung an error

Got a mismatch error here.

Private Function SaveWebFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then SaveWebFile = True
End Function

Reply With Quote
 
  #445 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 214 since Sep 2012
Thanks: 26 given, 240 received


ItalianBmT View Post
When I run, another part of the code sprung an error

Got a mismatch error here.

Private Function SaveWebFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then SaveWebFile = True
End Function

You mat need to change:
Private Function SaveWebFile to Private PtrSafe Function SaveWebFile

or perhaps:
Dim lngRetVal As Long to Dim lngRetVal As LongPtr

I'm afraid I won't be of much help with actually troubleshooting the code, but this may help:
https://msdn.microsoft.com/library/gg264421.aspx

It looks like there are a limited number of areas where you may encounter errors running VBA in Office 64-bit according to the article above. It would seem as though if you change the declarations that you should be OK.

Hope this helps.

Reply With Quote
 
  #446 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Beginner
Platform: Zaner360
Broker/Data: DeCarley
Favorite Futures: Options on Futures
 
Posts: 62 since May 2017
Thanks: 47 given, 113 received

@Dudetooth,

I'm very impressed by your XLS-Span tool, you did amazing work; thank you so much for taking the time do build this for us.

I have a question related to spread margins. Is this something you calculate in the tool (I couldn't figure out how you got the numbers)? Or is it something you get from the CME data? I couldn't find good references on how to calculate it online and was hoping for your guidance on that.

Thanks again for the excellent tool; and thanks in advance for your help.

Reply With Quote
 
  #447 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 214 since Sep 2012
Thanks: 26 given, 240 received

Thank you, glad that it is helpful.

Margin on spreads is derived from the data in the risk files from CME & ICE and calculated, based on the SPAN methodology. Check out http://www.cmegroup.com/clearing/files/span-methodology.pdf

Let me know if you have any other questions or want some specific details.

Reply With Quote
 
  #448 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Beginner
Platform: Zaner360
Broker/Data: DeCarley
Favorite Futures: Options on Futures
 
Posts: 62 since May 2017
Thanks: 47 given, 113 received

Thanks Dudetooth.

Can you think of a way to extract a few variables for each option that would allow us to calculate spread margins across options?

Your documentation says the following about calculating spread margins: [Position IM for all legs= Net * (Initial to Maintenance Ratio * Max(Risk Scenarios 1-16, Short Option Minimum)); Initial to Maintenance Ratio extracted from PA2].

If I understand correctly, the formula in the VBA code is:
If calcType = 3 Then
'*********** Risk scenarios added together for spreads
dicSprd.Item("R1") = dicSprd.Item("R1") + clsOpt.r1
dicSprd.Item("R2") = dicSprd.Item("R2") + clsOpt.R2
dicSprd.Item("R3") = dicSprd.Item("R3") + clsOpt.R3
dicSprd.Item("R4") = dicSprd.Item("R4") + clsOpt.R4
dicSprd.Item("R5") = dicSprd.Item("R5") + clsOpt.R5
dicSprd.Item("R6") = dicSprd.Item("R6") + clsOpt.R6
dicSprd.Item("R7") = dicSprd.Item("R7") + clsOpt.R7
dicSprd.Item("R8") = dicSprd.Item("R8") + clsOpt.R8
dicSprd.Item("R9") = dicSprd.Item("R9") + clsOpt.R9
dicSprd.Item("R10") = dicSprd.Item("R10") + clsOpt.R10
dicSprd.Item("R11") = dicSprd.Item("R11") + clsOpt.R11
dicSprd.Item("R12") = dicSprd.Item("R12") + clsOpt.R12
dicSprd.Item("R13") = dicSprd.Item("R13") + clsOpt.R13
dicSprd.Item("R14") = dicSprd.Item("R14") + clsOpt.R14
dicSprd.Item("R15") = dicSprd.Item("R15") + clsOpt.R15
dicSprd.Item("R16") = dicSprd.Item("R16") + clsOpt.R16

'*********** Short option minimum added together for spreads
dicSprd.Item("PosSOM") = dicSprd.Item("PosSOM") + clsOpt.PosShortMin

'*********** Write all risk scenarios to array and find max scenario/SOM to define total risk
If iArrPos = totOpt Then
vArrayS = dicSprd.items()
Risk2 = Application.WorksheetFunction.Max(vArrayS)
If Risk2 = 0 Then Risk2 = 1
dicFut(i)("SprdRisk") = Risk2
End If
End If
To make this work I think we would have to extract the initial maintenance ratio, R1-16 and the PosSOM for each option. With that information we should be able to calculate the spread IM in Excel fairly easily. Would you agree?

Thanks

Reply With Quote
 
  #449 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 214 since Sep 2012
Thanks: 26 given, 240 received

I guess I'm not tracking what you are looking to do. It seems as though you are asking how to get XLS-SPAN to calculate spread IM ... It already does that (extracting all the needed info for each option from the pa2 files). Am I misunderstand?

Reply With Quote
 
  #450 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Beginner
Platform: Zaner360
Broker/Data: DeCarley
Favorite Futures: Options on Futures
 
Posts: 62 since May 2017
Thanks: 47 given, 113 received


Sorry, I should've explained.

I'm looking to back test different strategies more quickly. So far I've exported complete ES put data from XLS-Span to a database. I'm now querying the database to back test different strategies.

The problem is I can only get option level data (the standard output from the "Scan" capability of XLS-Span). To allow me to quickly test spread strategies, I would need to load enough information in the database to be able to independently calculate the spread margin.

So that's why I'm wondering if it's possible to export the data necessary to calculate spread margins at the option level. That way I can combine any group of options and get the spread IM requirement with database queries instead of relying on XLS-Span to do the calculation.

Hopefully that clarifies my purpose.

Reply With Quote

Reply



futures io > > > > PC-SPAN

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Monte Carlo Analysis w/Kevin Davey

Elite only
 

How-to Choose a Futures Broker w/Lynette Lim @ Phillip Capital

Sep 20
 

Alternative Views on Traditional Tools w/Rhonda Jones

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current PC Specs tderrick Tech Support 45 October 28th, 2012 03:40 PM
Any PC Gamers in here? forrestang Off-Topic 61 October 10th, 2012 02:37 PM
Virtual PC setup how? boze man Tech Support 5 September 8th, 2012 03:59 PM
I need PC help Boomer34 Tech Support 5 January 22nd, 2012 02:28 PM
PC Question NMTrader Off-Topic 0 July 12th, 2009 10:56 PM


All times are GMT -4. The time now is 07:15 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-09-20 in 0.13 seconds with 21 queries on phoenix via your IP 54.158.248.167