"String was not recognized as valid DateTime" with ASCII DataSet
Author: toothBar2
Creation Date: 12/2/2010 12:22 AM
profile picture

toothBar2

#1
I am trying to import from a text file but keep getting the error: "String was not recognized as valid DateTime"

Error Details:
Line: 0
Field: 1730
Field Name: Time
Field Type: Time

Here are the first lines from the text file:

CODE:
Please log in to see this code.


Field Order i am using:

Date(or Date with Time)
Time
Open
High
Low
Close
Volume

i have gone through the time format and tried each one but it still doesnt seem to work, any ideas ?

Thanks
profile picture

Eugene

#2
Everything is correct and by design - the error is in your data:
QUOTE:
20091201,30,1076.00,1077.75,1075.75,1077.00,1992

The "30" here is a badly formatted value that doesn't correspond to any known .NET DateTime format. Frankly, even "030" would be problematic because the "Hmm" format isn't currently supported (for background and workaround, see this Wiki KB article: Convert unsupported "Hmm" to "HHmm" in intraday ASCII data.

The only solution is to convert your data to another supported format like H:mm (not Hmm) or HHmm - to get rid of the ambiguous time like "30".
profile picture

Eugene

#3
The ASCII Provider will support the "Hmm" and "Hmmss" time formats, starting from version 1.3.
profile picture

EstivBR

#4
Hi, I´m trying to import a .csv created by MetaTrader5 with a 5 min chart data. When I try to import the file to Wealth-Lab, I get "String was not recognized as a valid DateTime".

The attachments show the first lines of the file and the Date Format I´m using.
Any tips ? Thanks
profile picture

Eugene

#5
Hi,

Your data file is incorrect: a Time field is missing altogether. How can you import the data file as 5-min if every row contains the same repeating (Daily) DateTime i.e. 29/08/2016? That's not going to work.
profile picture

EstivBR

#6
Got it right now. Each row had date but also time info now, then it worked for the 5 min chart. Had to play a lot with formats, but worked well at the end. Software is very good, looking forward to buy it if I manage to do what I need. But that is for another topic. Thank you.
profile picture

Eugene

#7
Glad you like it, thanks for the positive feedback.
profile picture

pcdv

#8
Hi,

Hope all well.

I am trying to import tick data from Dukascopy in MT format.

As soon as the time field hits 13:00:00 I receive a parse error (string was not recognized as a valid date time).

I believe the settings and data format to be alright (see attachments), but clearly I am overlooking something.

Can you give me some pointers please?

Thanks
profile picture

Eugene

#9
Hi,

Re: "settings.jpg". I see you like everything lower case, further confirmed by your user profile (petrus de vries) ;-)

Nonetheless, the date/time formats of .NET framework are not forgiving as they're strictly context sensitive. Please click "Formats help..." and follow the link to a Microsoft website with description of custom formats. Specifically, it should be:

Date: yyyyMMdd because "mm" stands for minutes, not month
Time: HH:mm:ss (hh is for 01-12 clock)

P.S. Please use PNG to post screenshots, JPG is truly suboptimal for the purpose.
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).