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

Re: [amibroker] Re: A simlpe question



PureBytes Links

Trading Reference Links

Dimitris,

There are three data types in AFL: number, string and array (of numbers).
There is no array of strings therefore there are no "previous" values of 
strings.
WriteIf converts "CURRENT" value of array (actually the value of array element
that corresponds to currently selected bar (or last bar in AA))
to single string. Such string variable holds just one single instance of
string.
Your 's' variable has only ONE value that depends on which condition
is met on selected bar. 

In commentary it is the same but when you move the selection
line entire formula is re-evaluated therefore you can see
the values for other 'current' bars.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, May 03, 2003 5:51 PM
Subject: [amibroker] Re: A simlpe question


> Tomasz,
> Below defined s is a string :
> s=WriteIf(StochD()<30,"o/s",WriteIf(StochD()>=30 AND StochD()
> <70,"congestive","o/b"));
> with 3 "values"[to call somehow the result of s].
> In AA, AFAIK, we can not see these "values", the exploration
> s=WriteIf(StochD()<30,"o/s",WriteIf(StochD()>=30 AND StochD()
> <70,"congestive","o/b"));
> Filter=1;
> AddTextColumn(s,"");
> for all quotations will give "o/b" or "congestive" or "o/s" according 
> to the last s value.
> In commentary window, the same s will give the proper value per day.
> I want to read in the same commentary a result like
> 
> ^NDX today is o/b
> Yesterday was congestive .
> I have one solution that works fine
> 
> Name()+" today is "+WriteIf(StochD()<30,"O/S. ",WriteIf(StochD()>=30 
> AND StochD()<70,"congestive. ","O/B. "));
> "Yesterday was "+WriteIf(Ref(StochD(),-1)<30,"O/S. ",WriteIf(Ref
> (StochD(),-1)>=30 AND Ref(StochD(),-1)<70,"congestive. ","O/B. "));
> 
> and I thought if it is possible to have a simpler "Ref(s,-1)" for the 
> previous "value" of a string s.
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
> wrote:
> > Dimitris,
> > 
> > Use
> > WriteVal( Ref( DateTime(), -1 ), formatDateTime );
> > 
> > There is no such thing like "previous value of string".
> > String has one value.
> > 
> > Only arrays can have multiple values (one value per bar).
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > 
> > ----- Original Message ----- 
> > From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Saturday, May 03, 2003 2:17 PM
> > Subject: [amibroker] Re: A simlpe question
> > 
> > 
> > > Anthony,
> > > thank you for your replies.
> > > To be more specific, I was asking for the previous value of a 
> srting, 
> > > like Date().
> > > DT
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" 
> <ajf1111@xxxx> 
> > > wrote:
> > > > Dimitri,
> > > >  
> > > > There are a couple of options....
> > > >  
> > > > load into Guru Commentary...
> > > > 
> > > > x=DateTime();
> > > >  WriteVal(Ref(x,-1),formatDateTime);
> > > > 
> > > > OR
> > > > 
> > > > writeval(ref(datenum(),-1),1);
> > > >  
> > > > 
> > > > Anthony
> > > >  
> > > > -------Original Message-------
> > > >  
> > > > From: amibroker@xxxxxxxxxxxxxxx
> > > > Date: Saturday, May 03, 2003 7:18:46 AM
> > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > Subject: [amibroker] A simlpe question
> > > >  
> > > > How can I read in commentary window the previous date ?
> > > > Ref(Date(),-1) does not work since Ref accepts array and Date() 
> is 
> > > a 
> > > > string...
> > > > DT
> > > >  
> > > >  
> > > > Yahoo! Groups Sponsor
> > > >  
> > > >  
> > > >  
> > > > Send BUG REPORTS to bugs@xxxx
> > > > Send SUGGESTIONS to suggest@xxxx
> > > > -----------------------------------------
> > > > 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 the Yahoo! Terms of 
> Service.
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > 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/ 
> > > 
> > > 
> > >
> 
> 
> 
> 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/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/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/