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

Re: [amibroker] Re: valuewhen



PureBytes Links

Trading Reference Links

Hello Dimitris,

I would rather suggest:

ValueWhen( cond1, datenum() % 1000000 );

for 2-digit year format.

See version 3.50 Release Notes for datenum() function
for the details.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message -----
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, September 22, 2001 5:41 PM
Subject: [amibroker] Re: valuewhen


> Thank you Tomasz for reply.
> I think now that
>
> column1=valuewhen(cond1,10000*year()+100*month()+day());
>
> gives exactly the date in YYYYMMDD format, which is a bit
> more friendly than datenum() format.
> Now that Exploration results accept strings, we could have
> perhaps string possibility in valuewhen, or another "pricewhen"
> function accepting equally string or array. I do not know if it is
> possible, but it would be easier for a beginner.
> Best Regards
> Dimitris Tsokakis
> --- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> > Hello,
> >
> > date() function returns single string of currently selected date
> > (not array). As ValueWhen is supposed to work with arrays it
> > can not handle date().I would suggest using datenum() function or
> > 3 calls to year(), month() and day() functions respectively.
> >
> > These functions work well with ValueWhen();
> >
> > ValueWhen( cond1, datenum() );
> >
> > or
> > ValueWhen( cond1, year() );
> > ValueWhen( cond1, month() );
> > ValueWhen( cond1, day() );
> >
> >
> > Best regards,
> > Tomasz Janeczko
> > ===============
> > AmiBroker - the comprehensive share manager.
> > http://www.amibroker.com
> >
> > ----- Original Message -----
> > From: Dimitris Tsokakis
> > To: amibroker@xxxx
> > Sent: Saturday, September 22, 2001 4:34 PM
> > Subject: [amibroker] valuewhen
> >
> >
> > Does valuewhen operates with string expressions ?
> > I tried in an Exploration
> > valuewhen(cond1,date()) or valuewhen(cond1,name())
> > without result(bad arg).
> > Alternative:writeif(cond1,string1,string2) worked well,
> > although did not give exactly what was asked.
> > Any idea to get the date when cond1 was true as result
> > in an Exploration column ?
> > Dimitris Tsokakis
> >
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> >
> > Start here...
> >
> > Height:
> > 345678 ft 01234567891011in
> >
> > Weight:
> > lbs. kg.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>