IIF together with range selection solves my problem. Lastvalue doesn't work 
because of the reason Graham mentioned.

Thanks for everyone's reply.



--- In [email protected], Graham <kavemanpe...@...> wrote:
>
> Remove your IF and replace with IIF
> Chances are your script would work better with iif anyway and be far
> more flexible
> If you absolutely must use IF then do it with a for loop through the
> bars, and give your self a chance at flexibility to scan whatever day
> you want
> To give a proper repsonse to a question that has only given part
> information (remember that what is posted is assumed to be the total
> information), we need to see your entire code, otherwise we go through
> many posts becasue of "Yes But"
> 
> -- 
> Cheers
> Graham Kav
> AFL Writing Service
> http://www.aflwriting.com
> 
> 2009/4/10 conrad_faber <cfa...@...>:
> > Again, your range restrictions should work.
> > But try:
> > Filter=DateNum()==1090403;
> > AddColumn( Close, "Close" );
> >
> >
> > --- In [email protected], "H L" <hulu800@> wrote:
> >>
> >> I need to clarify my question: The AFL script need to be run in 
> >> EXPLORATION mode, not the scan mode in my previous post.
> >>
> >> So I don't think I can use "Buy=DateNum()==1090403;"
> >>
> >> If I use "Last = C;" then Last is an array instead of scalar. This would 
> >> prevent me from using Last in IF-statements, which requires numeric or 
> >> boolean type.
> >>
> >> Any other suggestions?
> >>
> >>
> >>
> >> --- In [email protected], Graham <kavemanperth@> wrote:
> >> >
> >> > Lastvalue gives the last value in your database for that symbol
> >> > Just Use Last = C;
> >> >
> >> > --
> >> > Cheers
> >> > Graham Kav
> >> > AFL Writing Service
> >> > http://www.aflwriting.com
> >> >
> >> >
> >> >
> >> > 2009/4/10 conrad_faber <cfaber@>:
> >> > > Range from/to date restrictions work fine on my side. What you could 
> >> > > do is to set Range to all quotations and extract using 
> >> > > Buy=DateNum()==1090403;
> >> > >
> >> > >
> >> > > --- In [email protected], "H L" <hulu800@> wrote:
> >> > >>
> >> > >> This may be a really simple question. I want to run a scan on a 
> >> > >> certain day (e.g., 3/4/2009) using that day's close data, so I set 
> >> > >> the Range in Automatic Analysis as "from 3/4/2009 to 3/4/2009", in 
> >> > >> the AFL script I used Last=LastValue(Close) to try to get the close 
> >> > >> price on 3/4/2009, but it actually returned today's close price.
> >> > >>
> >> > >> So my question is: how to extract the data on a specific date from 
> >> > >> Close or other array-type price data?
> >> > >>
>


Reply via email to