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

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



PureBytes Links

Trading Reference Links

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@xxxxxxxxx>
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 --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/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/