PC-SPAN (Page 3) - Options on Futures | futures.io
futures.io futures trading
 

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Traders Hideout > Options on Futures


PC-SPAN
Started:October 23rd, 2013 (09:36 AM) by ron99 Views / Replies:41,405 / 403
Last Reply:November 19th, 2016 (08:49 AM) Attachments:100

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike
     

Reply
 100  
 
Thread Tools Search this Thread

PC-SPAN

Old November 15th, 2013, 12:20 AM   #21 (permalink)
Market Wizard
OH
 
Futures Experience: Advanced
Platform: QST
Broker/Data: QST, DeCarley Trading, Gain
Favorite Futures: Options on Futures
 
Posts: 2,323 since Jul 2011
Thanks: 634 given, 3,902 received
Forum Reputation: Legendary

I hate to bother you but my sub does everything down to doing the batchfile and for one second the DOS window flashes on my screen but it doesn't run.

But if I click on the batch file in Windows Explorer it works OK. So it's not the batchfile.

I tried running the batchfile as a separate sub and it still doesn't run. It just flashes for one second.

Sub RunSPANBatchfile()
batchfile = "C:\Span4\Bin\SPANBatch.bat"
RetVal = Shell(batchfile, 1)
End Sub


I am using Excel 2010 with VBA 7.0.

Reply With Quote
     

Old November 16th, 2013, 09:49 AM   #22 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received


ron99 View Post
But if I click on the batch file in Windows Explorer it works OK. So it's not the batchfile.

I tried running the batchfile as a separate sub and it still doesn't run. It just flashes for one second.

I had a similar problem with one of my batch files. I think it is related to the path (I can't find any definitive proof). Most of my batch files were located in the C:\Span4 folder, but I had 2 in the sub-folder C:\Span4\SpanPosConv. The name of the Batch had a space in it and it just flashed the cmd window when I tried to run it in VBA as "C:\Span4\SpanPosConv\SpanPosConv RJO.bat". My other batch files in the C:\Span4 folder had spaces in their name and worked fine when called through VBA.

I removed the space in the name of the batch and was able to call it as "C:\Span4\SpanPosConv\SpanPosConvRJO.bat". I also tried moving the batch to the C:\Span4 folder and leaving the name with the space and that also worked calling "C:\Span4\SpanPosConv RJO.bat".

You mentioned that your batch works fine when you click on it, so it should not be an error in the batch. The name of your batch does not have a space, but it is in a sub folder. I have no idea why it would have issues with the path, but I would recommend moving the batch to the C:\Span4 folder and modify your sub:

Sub RunSPANBatchfile()
Dim RetVal
Dim batchfile as string
batchfile = "C:\Span4\SPANBatch.bat"
RetVal = Shell(batchfile, 1)
End Sub


Hopefully this will take care of the issue.

Reply With Quote
     
The following user says Thank You to Dudetooth for this post:
     

Old November 16th, 2013, 09:54 AM   #23 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received



ron99 View Post
I'll just not call my format sub. Not that big of a deal.

I was able to get this to work by editing only a few lines of that text that was in the file I upload. Now I can run one sub that can call multiple batch files, wait for each to complete before running the next, and then run additional code. I can walk you through that if you are interested.

Reply With Quote
     

Old November 17th, 2013, 04:15 PM   #24 (permalink)
Market Wizard
OH
 
Futures Experience: Advanced
Platform: QST
Broker/Data: QST, DeCarley Trading, Gain
Favorite Futures: Options on Futures
 
Posts: 2,323 since Jul 2011
Thanks: 634 given, 3,902 received
Forum Reputation: Legendary


Dudetooth View Post
I had a similar problem with one of my batch files. I think it is related to the path (I can't find any definitive proof). Most of my batch files were located in the C:\Span4 folder, but I had 2 in the sub-folder C:\Span4\SpanPosConv. The name of the Batch had a space in it and it just flashed the cmd window when I tried to run it in VBA as "C:\Span4\SpanPosConv\SpanPosConv RJO.bat". My other batch files in the C:\Span4 folder had spaces in their name and worked fine when called through VBA.

I removed the space in the name of the batch and was able to call it as "C:\Span4\SpanPosConv\SpanPosConvRJO.bat". I also tried moving the batch to the C:\Span4 folder and leaving the name with the space and that also worked calling "C:\Span4\SpanPosConv RJO.bat".

You mentioned that your batch works fine when you click on it, so it should not be an error in the batch. The name of your batch does not have a space, but it is in a sub folder. I have no idea why it would have issues with the path, but I would recommend moving the batch to the C:\Span4 folder and modify your sub:

Sub RunSPANBatchfile()
Dim RetVal
Dim batchfile as string
batchfile = "C:\Span4\SPANBatch.bat"
RetVal = Shell(batchfile, 1)
End Sub


Hopefully this will take care of the issue.

I moved the batchfile to SPAN4. And then copied and pasted your sub. I now get the error that SPANData.dll is not on my computer. I moved the SPANData.dll from the Bin folder to the SPAN4 folder and I still get the same error message.

I have used too much time on trying to get this to work. I need to move on. Your download risk files sub has been a big help thanks.

Reply With Quote
     

Old November 17th, 2013, 04:17 PM   #25 (permalink)
Market Wizard
OH
 
Futures Experience: Advanced
Platform: QST
Broker/Data: QST, DeCarley Trading, Gain
Favorite Futures: Options on Futures
 
Posts: 2,323 since Jul 2011
Thanks: 634 given, 3,902 received
Forum Reputation: Legendary

Futures Edge on FIO

Dudetooth View Post
I was able to get this to work by editing only a few lines of that text that was in the file I upload. Now I can run one sub that can call multiple batch files, wait for each to complete before running the next, and then run additional code. I can walk you through that if you are interested.

I may be crazy to try but can you easily do that?

Reply With Quote
     

Old November 17th, 2013, 08:34 PM   #26 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received


ron99 View Post
I have used too much time on trying to get this to work. I need to move on.

I'm sorry that it didn't help. I know the dll file needs to be in the same folder as the spanit.exe. The error makes me think that there might be something in the batch file or span script that might be throwing it off (file name or path of batch that has changed). If you decide later to give it another go, I'll be happy to try to help you troubleshoot.

Reply With Quote
     

Old November 17th, 2013, 08:50 PM   #27 (permalink)
Elite Member
Steubenville Ohio
 
Futures Experience: Intermediate
Platform: OX, OEC, RJO
Favorite Futures: Options on Futures
 
Posts: 179 since Sep 2012
Thanks: 24 given, 198 received


ron99 View Post
I may be crazy to try but can you easily do that?

It's pretty painless.
1- copy all the code from the text file uploaded and paste it above all of your other code in your module.
(all of the "Option Explicit", "Private Declare Function" and "Private Const" lines need to be on top, above all the subs ... if you have any other "Private Declare Functions" they'll have to be moved above the subs as well)

2- edit the "Sub Run_bat()" as needed. It is currently set to run 2 batch files and then call another sub "copy_data_RJO" in my spreadsheet ... just change the name/path of the batch files:
"C:\Span4\SPAN Risk RJO.bat" and "C:\Span4\SPAN RiskRep RJO.bat" and insert code to call other subs as needed.

Attached Files
Register to download File Type: txt Code.txt (3.3 KB, 23 views)

Last edited by Dudetooth; November 17th, 2013 at 08:56 PM. Reason: minor edits
Reply With Quote
     

Old November 17th, 2013, 11:56 PM   #28 (permalink)
Market Wizard
OH
 
Futures Experience: Advanced
Platform: QST
Broker/Data: QST, DeCarley Trading, Gain
Favorite Futures: Options on Futures
 
Posts: 2,323 since Jul 2011
Thanks: 634 given, 3,902 received
Forum Reputation: Legendary


Dudetooth View Post
I'm sorry that it didn't help. I know the dll file needs to be in the same folder as the spanit.exe. The error makes me think that there might be something in the batch file or span script that might be throwing it off (file name or path of batch that has changed). If you decide later to give it another go, I'll be happy to try to help you troubleshoot.

I got it to work. I changed my SPANBatch from

spanit C:\Span4\Bin\SPANScript.txt

to

C:\Span4\Bin\spanit C:\Span4\Bin\SPANScript.txt

Looks like it needed the full path for spanit.

You mentioning the path made me think of this.

Reply With Quote
     

Old November 18th, 2013, 02:45 AM   #29 (permalink)
Elite Member
Qld, Australia
 
Futures Experience: Beginner
Platform: Excel/Hoadley/PC-SPAN
Broker/Data: OX
Favorite Futures: Options
 
Posts: 28 since Mar 2012
Thanks: 6 given, 39 received

Hi,

You guys will be fully fledged programmers soon!

Do you happen to know an easy way to get the margins on a list of OX symbols such as the following list out of SPAN:

ESZ31400P
ESF41300P
CLF4115C
CLF475P
CLG4120C
NGZ34.15C
NGZ33.25P
NGG45.5C
NGH45.7C
GCG41700C
KCH41600C
SF41060P
SH41600C
ECZ31.405C

I am thinking that simply listing them into a portfolio csv file and loading them up with SpanPosConv (net position of 1 each) and calculating the perf bond req will calculate the margins for each as part of a spread within the portfolio etc - 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....

Cheers
Scott

Reply With Quote
     

Old November 18th, 2013, 11:02 AM   #30 (permalink)
Market Wizard
OH
 
Futures Experience: Advanced
Platform: QST
Broker/Data: QST, DeCarley Trading, Gain
Favorite Futures: Options on Futures
 
Posts: 2,323 since Jul 2011
Thanks: 634 given, 3,902 received
Forum Reputation: Legendary


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.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


This is how it would look if you put them into the SPAN program.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
     
The following 3 users say Thank You to ron99 for this post:
     

Reply



futures.io > Futures Trading, News, Charts and Platforms > Traders Hideout > Options on Futures > PC-SPAN

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

NinjaTrader 8: Features and Enhancements, Tips and Tricks

Dec 6
 

Al Brooks: Stop Losing when a Good Trade goes Bad, Correcting Mistakes

Elite only
 

Trading Technologies: Algo Design Lab hands-on

Dec 13
     

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


All times are GMT -4. The time now is 11:37 AM.

Copyright © 2016 by 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 2016-12-03 in 0.14 seconds with 20 queries on phoenix via your IP 54.167.155.163