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

Re: [amibroker] Counting the bars



PureBytes Links

Trading Reference Links

Thanks Paul
you can pad out to a reference ticker in AA Window - Settings -
General Settings about half way down is box to tick and fill in your
reference ticker. I use XAO.
This can help when using data that is not padded already. Just
remember that in straight AFL if the particular does not have data it
will not use that days data in a foreign stock, and thus I had trouble
getting what I wanted.

Thanks for the code. I will have to catch up on some of the param
stuff that has been introduced. I totally lack understanding of it,
only because I have not seen uses for it except in the chart
parameters.
Gives me something to investigate this week :)



On Sun, 23 Jan 2005 18:27:48 +1100, Paul Ho <paultsho@xxxxxxxxxxxx> wrote:
> its indeed quite tricky Graham,  I am not sure if you turnoff and on padding
> within AFL, if it is possible, you could use optimize to have 2 runs, the
> 1st run with padding selected to obtain value for XAOFB, and the second time
> with padding turn off to obtain LQ. I looked but could not find how AA turns
> it off.
> Without that, One could use param to run it 2 times with out changing the
> code itself.
> -----------------------------
> 
> 
> XAOFB = ParamDate("Startdate", "2004-08-31"); 
> 
> run = Param("run", 0, 0, 1, 1); // run 1 is to obtain the XAOFB date 
> 
> XAOPer = 100; 
> 
> if(run ) { 
> 
> XAOFB = LastValue(Ref(DateNum(),-100)); 
> 
> }
> 
> Per = BarsSince( Cross( DateNum(), XAOFB ) ) + 1; 
> 
> LQ = LastValue(Per)/XAOPer; 
> 
> Filter=LQ > 0.95; 
> 
> WhenDate = ValueWhen( BarIndex()==(BarCount-101), DateNum() ); 
> 
> WhenBars = BarsSince( Cross(DateNum(), WhenDate) ); 
> 
> AddColumn( WhenDate, "date ?", 1 ); 
> 
> AddColumn( WhenBars, "bars=100 ?", 1 ); 
> 
> AddColumn( LQ, "LQ"); 
> 
> AddColumn(XAOFB, "XAOFB"); 
> 
> AddColumn(XAOPer, "XAOPer"); 
> 
> AddColumn(Per, "Per");
>  
>  
> -----Original Message-----
> From: Graham [mailto:kavemanperth@xxxxxxxxx] 
> Sent: Sunday, 23 January 2005 10:52 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Counting the bars
> 
> I want to run and exploration over the past 100 bars of actual market
> days in an unpadded database. However is does not seem to be as easy
> as I thought to do it is a single step. If I do it straight off I get
> different first dates for tickers as some days are not traded. but if
> I reference it to padding to a reference ticker, eg an index, then
> every ticker has the same number of bars in the reports whether they
> traded all the time or not.
> Essentially I want to explore for tickers that have trade more than
> 95% of the past 100 market days.
> I can do it in 2 steps by finding the date of 100 days ago in the
> index, then manually put this date into my explorations
> 
> Step 1, explore on index
> XAOPer = 100;
> XAOFB = ValueWhen( BarIndex()==(BarCount-1-XAOper), DateNum() );
> Filter=1;
> AddColumn( XAOFB, "datenum", 1 );
> 
> Step 2
> XAOFB = 1040831; // manually enter from previous explore results
> Per = BarsSince( Cross( DateNum(), XAOFB ) ) + 1;
> LQ = ( LastValue(Per)/XAOPer ) > 0.95;
> 
> 
> With this code I have tried the AA settings to pad and not pad, but
> does not give me the right results as explained above
> 
> WhenDate = ValueWhen( BarIndex()==(BarCount-101), DateNum() );
> WhenBars = BarsSince( Cross(DateNum(), WhenDate) );
> Filter=1;
> AddColumn( WhenDate, "date ?", 1 );
> AddColumn( WhenBars, "bars=100 ?", 1 ); 
> 
> 
> 
> 
> Hoping someone can help
> 
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> 
> 
> 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 the Yahoo! Terms of Service. 


-- 
Cheers
Graham
http://e-wire.net.au/~eb_kavan/


------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/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/