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

Re: [amibroker] Re: How to solve in AFL.....



PureBytes Links

Trading Reference Links

Dimitris,

You are right *IF* 'a' and 'b' are NOT placeholders of more complex
statements that are evaluated each bar OR they are not arrays.

If 'a' and 'b' are arrays your assumptions are not correct.

I already sent response to this post but Yahoo somehow 
'forgot' it, so here it is again:

Assumption: a and b are arrays.

Using AMA/AMA2:
=============

x = AMA( a * b, Condition == True );

Using loops:
========

for( i = 1; i < BarCount; i++ )
{
   if( Condition[ i ] )
   {
    x[ i ] = a[ i ] * b[ i ];
   }
   else
   {
    x[ i ] = x[ i - 1 ];
  }
}
 



Best regards,
Tomasz Janeczko
amibroker.com

----- Original Message ----- 
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, May 08, 2003 1:43 PM
Subject: [amibroker] Re: How to solve in AFL.....


> Your x, as described, is always a*b. Suppose day1 with true 
> condition, then
> day1
> COND=TRUE
> X=a*b
> day2
> COND=FALSE
> X should be its previous value, ie a*b again
> Agree?
> DT
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
> wrote:
> > As it is written, Condition may be TRUE, FALSE or something else ?
> > DT
> > --- In amibroker@xxxxxxxxxxxxxxx, "Keith Bennett" <kbennett@xxxx> 
> > wrote:
> > > 
> > > Hi,
> > > 
> > > The following situation frequently occurs, but it doesn't seem 
> > > possible to solve directly due to the self reference.
> > > 
> > > How do you tackle this in AFL:
> > > 
> > > x = IIF(Condition is TRUE, a * b,
> > >     IIF(Condition is FALSE, Ref(x,-1),NULL));
> > > 
> > > Thanks
> > > Keith
> 
> 
> 
> 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 Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/YoVfrB/XP.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/