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

[amibroker] Re: AFL script questions



PureBytes Links

Trading Reference Links


--- In amibroker@xxxxxxxxxxxxxxx, "mattdiaz78" <mattdiaz78@xxxx>
wrote:
> 
> 
> I've just started to tinker around with AB and have a few questions.
> 
> 1. Can I get an example of a script that gets the highest close
since
> 1-1-2000?
> 
> 2. Just to clarify, in functions like hhv() is the definition of a
> "period" a trading day? Thus Saturdays and Sundays are not counted
as
> periods?
> 
> 3. In a function such as hhv() why does the function return an array
> when it is returning the highest value of an array? I realize an
array
> can have just a single element, so is it just a matter of AB always
> working with arrays? I guess I'm just trying to get a little
> perspective on AB's design.
> 
> 4. What is the best way to debug a scan or exploration? Since there
is
> no debugger what is the best way to examine the value of variables
> used in a script?
> 
> Thanks for any help.


I think the following code will answer your questions. Put it in the
formula editor (or IB window if you are using ver. 4.60) and click
apply to make a plot. Use the code in the AA window and set the range
at 12/31/99 to present and run an Explore for the present symbol.

You will see that HHV makes an array because it has a different value
each day. What you want is the LastValue of HHV.

There are other ways to do debugging using the _TRACE() function, but
until you have a function to send the desired parts of arrays to
_TRACE(), it works best on single values, and the AA Exploration
method is probably the simplest way to display array values.

Good luck, Bill

// Code starts here

HiVal	= HHV(C, BarsSince(DateNum()==991231) );

Plot(Close, "Close", 32);
Plot(HiVal, "HHV", 43);

Filter = 1;
AddColumn(HiVal, "HHV");





------------------------ 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/