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

Re: [amibroker] Re: Auto-Analysis Question



PureBytes Links

Trading Reference Links

Not reslly certain what your problem is as you ahve produced the results
basically in description of the functions, valuewhen(x,Y,1) looks back
to the last occurence of X before the bar you are analysing. If your
exploration bar is before the first occurence then there are null
results.
lastvalue looks to the last bar of the array, and then reverts to
looking backwards to the last value of your occurence. If you ahve
only one X as you do in the status stuff in this example then then.
if X occurs on the barindex()== 1000 then any search using only
valuewhen before the 1000th bar will not give results as the X did not
occur before this bar.
using lastvalue will always give a result because you are using the
last bar of the array to look backwards adn this will always see the X
occurence

The main thing to remember is that lastvalue will always only ever
give a single result.
Valuewhen will provide an array of results

Hope this helps

--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 5/3/06, wlandry01 <wlandry01@xxxxxxxxx> wrote:
> Graham,
>
> Thanks for the quick response and help.
>
> The only approach that I can think of using the functions that you
> suggested is the following:
>
> AABarCount=ValueWhen(Status("lastbarinrange")==1,BarIndex(),1)
> -ValueWhen(Status("firstbarinrange")==1,BarIndex(),1)+1;
>
> This works so that's great.
>
> I notice, however, that "AABarCount" shows the count only on the last
> line of the exploration output for each symbol.  If I use the
> following, it will place the count on each line:
>
> Range=LastValue(AABarCount);
>
> My understanding is that "ValueWhen" produces an array and that
> "LastValue" produces a number.  If so, it seems that "AABarCount"
> would generate an entry for each line of output and that "Range", if
> anything, would generate a single output.  Do you have any idea as to
> why these produce the results they do?
>
> Thanks,
>
>
> Wayne
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
> >
> > here is a direction for you
> > status( ''statuscode'' )
> > "barinrange" - returns 1 when current bar is within current
> > auto-analysis From-To range
> > "firstbarinrange" and "lastbarinrange". They return 1 (or True) on the
> > first/last bar of analysis range.
> >
> > --
> > Cheers
> > Graham
> > AB-Write >< Professional AFL Writing Service
> > Yes, I write AFL code to your requirements
> > http://e-wire.net.au/~eb_kavan/ab_write.htm
> >
> >
> >
> > On 5/3/06, wlandry01 <wlandry01@xxx> wrote:
> > > Hi,
> > >
> > > I'm trying to determine the number of bars in the Auto Analysis
> > > range for use in calculating average values.  I would like to
> > > calculate, for example, the average change in the Close over the
> > > Auto Analysis range and output that in the Exploration.
> > >
> > > I can't see, however, how to do that with the various "bar" functions,
> > > including the "Status" functions.  If someone could point me in the
> > > right direction I would appreciate it.
> > >
> > >
> > > Thanks,
> > >
> > >
> > > Wayne
> > >
> > >
> > >
> > >
> > >
> > >
> > > Please note that this group is for discussion between users only.
> > >
> > > To get support from AmiBroker please send an e-mail directly to
> > > SUPPORT {at} amibroker.com
> > >
> > > For other support material please check also:
> > > http://www.amibroker.com/support.html
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>
>
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
GFT Forex Trading Accounts As low as $250 with up to 400:1 Leverage. Free Demo.
http://us.click.yahoo.com/lpv1TA/jlQNAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/