[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: ODBC/SQL plugin



PureBytes Links

Trading Reference Links

Hello,
I had the same problem.  All data is stored as text.  This did not
work for me as format is yyyymmdd.  I did not use Tomasz' suggestion
that the text format should be yyyy-mm-dd.  In access I converted the
text field to date/time same as system format ie. dd/mm/yyyy.  I made
sure the table design was also date/time format since the VBA did not
do this automatically.  The example code that Tomasz provided worked
and I was able to read arrays of data eg NTA bar by bar, Truely fantastic.
regards
franc

ps: code that reads my access DB is below

//Study to connect and read ASX Fundamental Data

//Each month fundamental data available for all ASX as *.csv file
//Every symbol has numerous columns (fields) of data including DATE
(yyyymmdd)
//ie. symbol has a unique record for each month's fundamental data
//allowing to build a historical fundamental database
//Fields are:-
//ID, Fullname, ASX, Date, TxtDate,
Shareprice,NTA,SHAREPRICE/NTA,PE,EPS,..etc (33 fields)
//fields are type text,
//except Date(dd/mm/yyyy) which is type Date/time from TxtDATE(yyyymmdd)

//Windows XP Control panel setup used to connect to ODBC driver - "MS
Access Files"
//Filename - "ASXFundi.mdb"
//tablename - "Stocktable"
//odbcA plugin loaded into AB

//establishes the connection to the odbc source.
odbcOpenDatabase("DSN=MS Access Files");

//assigns alias for SYMBOL & DATE fieldnames
odbcSetFieldNames("ASX", "DATE");

//cast error since DATE is type text, not AB type datenum
//any/all forms of Date as text format causes an error

//current ticker eg.EWC, retrieve array NTA from database
//-> SELECT NTA, DATE FROM stocktable WHERE ASX='EWC' ORDER BY DATE ASC
MyNTA	= odbcGetArray("Stocktable", "", "NTA");
MyP_NTA= odbcGetArray("Stocktable", "", "[SHAREPRICE/NTA]");

//_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi
%g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue(
ROC( C, 1 ) ) ));
//Plot(MyNTA,"NTA",ParamColor("Color",colorWhite),ParamStyle("Style"));
//IT WORKS !!!!! aligned to the price data so can use in scans/
explorations etc


--- In amibroker@xxxxxxxxxxxxxxx, "dosnik" <dosnik@xxx> wrote:
>
> the problem not solved
> CODEEN	        Xtime
> MAINPARX	10:28:32 AM
> MAINPARX	10:29:02 AM
> MAINPARX	10:29:32 AM
> MAINPARX	10:30:02 AM
> 
> this is the format of data in access
> the field is in format : General date
> thank you.
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@> wrote:
> >
> > ODBC/SQL expects YYYY-MM-DD format.
> > There should not be a problem with Date/Time fields,
> > because they are not stored as texts but numbers which
> > are format-independent,
> > but if your field is text type and you are trying to access it
> > as date, then YYYY-MM-DD format is required.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "dosnik" <dosnik@>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Wednesday, November 08, 2006 1:21 AM
> > Subject: [amibroker] ODBC/SQL plugin
> > 
> > 
> > >i connect with database in access
> > > i have a problem with date/time
> > > when amibroker takes data i see 
> > > this wrong date 12/30/2155 where is the problem?
> > > thank u
> > > 
> > > 
> > > 
> > > 
> > > Please note that this group is for discussion between users only.
> > > 
> > > To get support from AmiBroker please send an e-mail directly to 
> > > SUPPORT {at} amibroker.com
> > > 
> > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > > http://www.amibroker.com/devlog/
> > > 
> > > For other support material please check also:
> > > http://www.amibroker.com/support.html
> > > 
> > > Yahoo! Groups Links
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> >
>




Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.11/542 - Release Date: 11/20/2006