Buy = DateNum() == 1020101; Sell = DateNum ==1060101; But markets are closed on Jan 1 so you won't have any data for that day and will probably need to chnage it to 1020102 or whatever is the next day with data. See DateNum function for details.
Steve ----- Original Message ----- From: "ted_j_webb" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, September 28, 2008 12:17 AM Subject: [amibroker] Rookie question - Back Test for a particular time frame > Hi folks, I'm a AmiBroker rookie, so please be patient and > understanding! What I want to do is backtesting with a single issue > and simply buy all shares on a particular date and sell all shares on a > particular date. Then look at the gain/loss. > > I have had success with buying and selling with 'close' > crossing 'MA', 'MA' crossing 'MA', Etc. But I simply can not get > the 'date' thing worked out. > > What would be the code for the following action: > > Buy all shares on 1 Jan 2002 > > Sell all shares on 1 Jan 2006 > > Thanks! > > > ------------------------------------ > > **** IMPORTANT **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > ********************* > TO GET TECHNICAL 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 > > > >
