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

[amibroker] Re: Help file help (WAS) FILTER questions.



PureBytes Links

Trading Reference Links

Hi Yuki:

Here's where I'm confused.  You say n=1 will look at the last bar to
see if the condition is true.  I entered this:
test=C>Ref(C,-1);
Filter=test;
AddColumn(C,"true",1);
n=1

I got one report with the total of times the condition was true for
the whole chart, symbol A=29.  I then entered n=100.  Now I get 59
separate reports for symbol A.

I'm beginning to wonder if "n" should be renamed "reports"! 

Dominick







--- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> Hi William,
> 
> A couple of quick comments in line below . . .
> 
> Monday, September 15, 2003, 5:53:50 AM, you wrote:
> 
> WP> This is a perfect opportunity for AFL beginners to learn by
> WP> DOING, as Ron said just having to get it all down in a readable
> WP> fashion is an effort that will pay dividends.
> 
> WP> Below, I have written a non-techie answer to a post by Glen which
> WP> asked about the setting n=1 in AA.
> 
> WP> Also, please suggest changes if you have idea's of  how to make
> WP>this description clearer.
> 
> WP>
=======================================================================
> 
> WP> When you set n=1, AA will check only the latest dated bar in your
> WP> database in order to see if your AFL conditions has been met on
> WP> only the latest dated bar.  However, while Amibroker is executing
> WP>  your particular AFL instructions, it still needs to
> WP> retrieve  data from earlier dated bars in order to produce
> WP> things  such as moving average calculations, and other
> WP> calculations  that will be required by your AFL coding.     
> 
> I would change "latest dated bar" (above) to "most recent bar".  I am
> also not sure that the additional information about what AB is doing
> while it is executing the instruction is relevant.  It is nice to
> have, perhaps, but it also could be confusing, because I think some
> people might take the following logic after reading it: "Oh, it needs
> to retrieve data from earlier bars, so how the heck do I make sure
> that it can do that?"
> 
> WP> When you set n=10, Amibroker will follow  exactly the
> WP> same procedure that it did when you  set n=1. The only difference
> WP> is , Amibroker will first check the bar that is positioned 10
> WP> periods back from the present bar.  A  period will be in seconds,
> WP> minutes, hours, days, months, or whatever you  happen to
> WP> have available in your database for Amibroker to  check.   Once
> WP> Amibroker is through checking the 10'th bar back, it
> WP> moves forward to check the 9'th bar, then on to the 8'th
> WP> bar,  and so on, till it finally checks the n=1 bar last.
> 
> WP> ====================================================================
> 
> I will give my shot here:
> 
> In the AA window, what does 'n' equal?
> 
> 'N' equals the number of most recent bars that you want to analyze in
> an AA analysis.
> 
> When you set n=1 in the AA window, the analysis will apply only to
> the most recent bar in your database.  If your database is daily, it
> will apply only to the most recent day.  If your database uses
> another time period (5-minute bars, for example), the analysis will
> apply only to the most recent 5-minute bar.  Whatever the period of
> time for the bars in your database, the number you specify as 'n'
> will tell AA to analyze that number of most recent bars in your
> analysis.
> 
> If you set n=10 in the AA window, the analysis will first be done on
> the 10th most recent bar, then the 9th most recent, etc., until the
> most recent bar (n=1) is done.  So in this case, the analysis would
> be done 10 times . . . for each issue that you are analyzing.  If you
> analyze 1000 issues, the analysis would be done 10,000 times.
> 
> Tip:
> 
> If the condition you are filtering for (the output you want to see)
> is likely to be frequently true, setting 'n' to a large number and
> including a large number of issues to be tested will likely produce a
> very large output. Realize that every bar for every issue where the
> condition was true during the period of 'n' will be output. If you
> test 1000 issues setting n=25, and the condition is likely to be true
> for approximately every 5th bar (20 percent true), you can expect an
> output of approximately 5,000 lines (1000 x 25 x 20%).
> 
> Practical application:
> 
> You have an EOD buy or sell signal that you want to test for each
> night: You create an exploration and run it each night, including all
> the issues you want to test for, and setting n=1 to see if that
> condition was true for any of those issues on the most recent bar.
> 
> You want to generate a list of daily prices for the past week to send
> to a friend:  You create an exploration that will output the price
> data, include all the issues you want the data for, and set n=5 (this
> assumes a daily database).  The output will be five lines for each
> issue, the five most recent bars.
> 
> ======
> 
> I'm sure somebody can improve upon this.  But what I would key in on
> is keeping the basic explanation as clutter free as possible, then
> including some kind of tip (might be a warning, too) and a practical
> application.
> 
> Yuki


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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