Creating a series from an excel file
Author: zshiner
Creation Date: 3/24/2010 4:50 PM
profile picture

zshiner

#1
I've been lurking here teaching myself how to program strategies from this site for a while now, but I seem to have come to a problem I can't find the solution to (not to say it doesn't exist, just that I can't find it). What I am trying to do is create a series to display the put/call ratio in a 30 minute scale. I borrowed a code from Eugine which gather's the daily data, and I was hoping to manipulate it for 1/2 hour data.

CODE:
Please log in to see this code.


Of course, CBOE does not publish hourly data, so I created a .csv file on my computer with all the necessary information. I only need to use it for back testing purposes, so it doesn't need to constantly update. Of course, I know nothing of programing in C#, only how to alter codes slightly, but I was wondering how I would go about manipulating this code to:

1) Gather the data from a file on my computer rather than from the internet.
2) Create the data series on a half hour interval.

I appreciate any help anyone could provide.
profile picture

Eugene

#2
As long as Bars pcratio was created, this code makes it accessible via Wealth-Lab's global memory. This means that you can use this Bars object in any other strategy window until the application is closed. As long as you Synchronize the Bars object, you can chart it on a half hour chart. Saving the Bars object is also possible - see Bars.SaveToFile in the QuickRef.

Good news: I'm already developing the CBOE static data provider that will download the complete Put/Call Ratio history (Total, Equity, Index and VIX) starting from 1995 (code above is limited to 2003). Most likely, it will see the light next month.
profile picture

zshiner

#3
I'm not quite sure if I didn't make the question clear enough or if I just merely didn't understand your response.

The issue I'm facing is that CBOE's spreadsheet only lists the daily put call ratio; since there isn't any 30 minute data, when I set the scale to 30 minutes the first bar of the day reflects the daily change and the rest of the bars remain static. This really throws the Bollinger bands in the strategy. Since I could not find the half hour ratio anywhere online now I have a spreadsheet with all the data that I need to upload to fidelity.

I am not sure what you mean by "synchronize the Bars object", but I think it's a matter of the data not even existing in the first place.

By the way Eugene. When I talk about a strategy I'm making what I really mean is a strategy you made me. Pretty much everything I have created is modified from something you wrote and I've resolved countless problems from your posts in the forum. Although you have no idea who I am, I wanted to let you know that you have basically taught me how to program in C# (I called it C-pound sign when I started programing). Thanks for all the help you've unknowingly provided.
profile picture

Eugene

#4
Thank you for all the good words.

Now I realize the problem is not in accessing the daily CBOE bars in intraday trading strategies (and the CBOE provider can't help since it takes the same daily data series) like I initially thought. The problem is right in its "look", or the stair-step pattern of the CBOE series that "confuses" the Bands.

Well, if you have 1 data point for a day, how do you know the intraday dynamics? The value should stay constant throughout the day. You can't create the data series on a half hour interval***, because they are already created - with the help of Synchronize. The daily series, and as we know there are no other bar scales, are synchronized to your 30-minute chart, resulting in the static line.

***Unless you know the actual half-hour P/C ratio data for today (only), as presented by the CBOE web site.
profile picture

zshiner

#5
QUOTE:
***Unless you know the actual half-hour P/C ratio data for today (only), as presented by the CBOE web site.


I don't understand why I would need today's data only presented by the CBOE website. Since they don't list that, I got the data from somewhere else. The problem now is that I have it in a file sitting on my computer rather than sitting on the internet somewhere. What I want to do is just create an artificial series to represent the half hour data. From my understanding of the code, it does this


QUOTE:

Define the ratio as daily information
Locate the data on the internet
If the program hasn't already done what it's about to do
Download the file from the internet
Parse it
Create the data series


What I want to do is set up the program to upload the data from a file on my computer rather than download it from CBOE. I also want to set it up to upload in half hour intervals rather than daily ones. I would assume that changing that has something to do with the line: "new Bars( "PCRATIO", BarScale.Daily, 0)." Perhaps the code I am using is too different from what I want it to do - I'm not sure.
profile picture

Eugene

#6
Ah. So you've got some 3rd party P/C data. Simply use the ASCII data provider to import it.
profile picture

zshiner

#7
Haha... It's almost humorous how hard I can make things on myself. After a quick detour reading up about ASCII data providers I got it uploaded. Now to figure out the code to manipulate it into what I want.

Thanks for all the help.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).