Import a Close only ASCII CSV file
Author: mikesblack
Creation Date: 4/29/2010 12:09 AM
profile picture

mikesblack

#1
Greetings.

I am attempting to import a .csv file that contains a date field and a Close field only. The date field is in the format. e.g. 1/3/2005, and the Close field is represented by system equity( from a back test)e.g. 250000. While attempting to create a new DataSet in the Data Manager two problematic issues arrise. Given Field Order : Date, Close Date format: MMddyyyy

1. String was not recognized as a valid DateTime error.
2. View Data File in Notepad displays data from a file that I did not choose from my directory.

Perhaps you can direct my efforts and suggest possible options to explore.

Thanks.
profile picture

Eugene

#2
1 - "1/3/2005" is not "MMddyyyy". Have you visited the helpful date format reference link in the User Guide > Data ... ASCII provider?
2 - This is expected. It can show the data for the 1st symbol with such file extension in a directory. As long as all files are expected to have exactly the same format, it doesn't really matter.

Also, make sure you've checked out this method from the Community.Components library:

FillSeriesFromFile

If you don't plan to "trade" the imported equity as a regular symbol but just use the series in a Strategy, FillSeriesFromFile might be what you need.
profile picture

mikesblack

#3
Thanks Eugene. I'll study the references.
profile picture

mikesblack

#4
Eugene- What advantage/s does this method have over just creating and importing a separate dataset, assuming I will not use it it for trading?

By the way, the issue I had was related to more than one folder having different formats. I created a new folder and cut and pasted the file I am interested in and was able to create this new dataset. I would think that I could access this data as I am doing now as per the example below.
CODE:
Please log in to see this code.


Additionally, I had mentioned date sequenced btests in an earlier post and I hope this question does not get perceived wrong, so please accept it in good faith. I have interest in having the ability to test money management rules by either scaling out of position that grow disproportionately to account equity size, or adjusting in and out of all positions if market volatility grows or decreases. With this in mind, can importing portfolio equity or cash levels, as I am now figuring out, be used in a way that allows for these tests to occur? I haven't given it a great deal of thought yet, but if you have any ideas about this, I'd appreciate it.

new topic to follow// unrelated to above.
profile picture

Eugene

#5
The GetExternalSymbol( string DataSet... ) overload has a live bug in 5.6, so we suggest avoiding it until next build.
profile picture

mikesblack

#6
Thanks, hasn't been a problem on this end. I use it every day.
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).