If I understand what you are trying to do, you want to get ami to 
plot and evaluate your actual trades, as stored in a database?

It seems to me that you need to set the buy and buyprice arrays from 
the values in the database.

Try this:
buyprice = odbcgetarraysql("select price, tradedatetime from rawdata 
where symbol='FLWS' and action='buy'");
buy = buyprice != ref(buyprice,-1);


You will also need statements for sellprice, shortprice, coverprice, 
etc.

This expoits that fact that where there is no value returned for a 
bar, ami will use the value from the last bar.  Will not work if two 
adjacent trades are at the same price.

--- In [email protected], "murthysuresh" <mo...@...> wrote:
>
> that is one area i have always felt challenged.
> for eg. i store all my trades in a mysql database. i have always 
> wanted to plot the realtime trades. how would you do the following.
> here is the sql that will return my trade info. but running it thro 
> ab is something of a challenge for me
> 
> select symbol, tradedatetime, action,price  from rawdatas where  
> symbol='FLWS'
> 
> this geneates a list of rows. but how do i get it thro amibroker. 
any 
> assistance is highly apprecited.
> 
> if, i can get it to work properly. i will post it in UKB
> --- In [email protected], "dloyer123" <dloyer123@> wrote:
> >
> > I just had a good experience using the odbc database driver with 
> > amibroker.
> > 
> > I built a tick database, about 75GB worth.  From that, I can 
> calculate 
> > volume at price, vwap and other data.  I use postgress, a free 
open 
> > source database.
> > 
> > I thought that I would have to write my own trade match and 
> backtest 
> > code in sql, but then I found the odbc sql interface to pull the 
> data 
> > into amibroker.
> > 
> > I was plesantly surprised how fast the odbc/amibroker interface 
> was.  
> > Working with tick data is never fast, but each sql query from ami 
> was 
> > only a handful of ms.  
> > 
> > -Doug
> >
>


Reply via email to