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

[amibroker] Reading in trades from a CSV file



PureBytes Links

Trading Reference Links

Hi,

I'm trying to read in trades from a CSV file, whose format is :

TICKER,(LONG OR SHORT),DATE,ENTRY PRICE,EXIT PRICE

This part I can kind of do (I know how to read and write to files). 
However, I'd like to use this data in backtests for a few thousand
symbols with intraday data.  My confusion comes when I'm trying to
figure out how to read in all the data from the CSV file and then use
it to generate buy and sort signals in the backtester.  For example,
if a line in my CSV file is:

INTC,Long,08/08/2006,17.40,17.45

I want to be able to extract that information in my AFL code, and as
I'm backtesting through many symbols, when the backtester gets to
INTC, I want it to have a BUY signal for INTC on 08/08/2006 with a buy
price of 17.40.  In case you're interested, I'm backtesting to try to
optimize the best time of day to exit my trades since I recently
subscribed to an intraday data service.

Efficiency may also be an issue, but for now I'd just love for it to
work.  Can anyone help me get started?  I know how to open the file
and grab the strings, but that's about it.

Thank you very much!

Tyler