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

[amibroker] Re: How to exit a stock when quotes end?



PureBytes Links

Trading Reference Links


Tomasz,

I read everything I could find on "pad and align" in the User's Guide 
and archives, and as best I can understand it, it doesn't apply to my 
situation.  This is a snippet from one of your posts from the beta 
board:

 "if your data have unequal length AND if you are using 
indicator/function on foreign security that requires several bars to 
calculate if you are using foreign prices alone that this is not the 
case)AND - if you are backtesting for period longer than the shortest
available history in your database (plus amount of bars needed to 
calculate indicator) All three cases must be fulfilled in order to 
make padding relevant at all."

I'm not referencing a foreign security.  Maybe I didn't explain 
myself clearly (or I'm not understanding you correctly).  If the 
backtester is holding a position in a stock when its data ends, I 
want to simply force an exit at the last closing price.  Right now 
the backtester is holding on to these positions as open trades, and 
its tying up money and distorting the backtest results.  

Thanks, Wayne


--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Hello,
> 
> You can use "Pad and align feature" for that. 
> Reference symbol should be set to some index that is known to have 
quotes on all trading days.
> 
> Then you will be able to detect end-of-trading for particular 
security by 
> checking either volume field or the fact that all price fields 
(OHLC) remain unchanged.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "seneca_kw" <seneca_kw@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Saturday, December 11, 2004 9:08 PM
> Subject: [amibroker] How to exit a stock when quotes end?
> 
> 
> > 
> > 
> > In an earlier post I said I was having trouble with the deleted 
> > stocks in the CSI database.  When a backtest is holding one of 
these 
> > stocks when the data ends, the report shows this as an open 
position 
> > and carries it forward to the end of the backtest.  Maybe the 
worst 
> > effect of this is that it ties up the money held in that position 
and 
> > distorts the returns.
> > 
> > It was suggested to exit stocks when they show zero volume.  I 
> > actually got this to work (Sell=Volume==0;), but the problem is 
that 
> > most stocks do not show zero volume on their last day of data.  
There 
> > are over 6,000 -- too many to manually add on a zero volume bar.
> > 
> > I've spent a couple hours experimenting with other methods, but 
came 
> > up empty.  I think the solution lies in executing a sell whenever 
it 
> > detects there is no data tomorrow.  I tried doing this with the 
> > IsEmpty function but couldn't pull it off.
> > 
> > I was experimenting with this but couldn't get it to work:
> > Y=IsEmpty(Ref(C,1)); 
> > Sell= y; 
> > 
> > Could someone point me in the right direction?  Thanks, Wayne
> > 
> > 
> > 
> > 
> > 
> > 
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> > 
> > Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/