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

[amibroker] Filter question - JAYSON



PureBytes Links

Trading Reference Links




Jayson,
 
look what goodie TJ has sent me regarding our 
recent discussion on how to use filter with 
Addtocomposite.
 
Hope you find it worthwhile - and, of course, 
everybody else!!
 
Peace
 
Markus
----- Original Message ----- 
From: <A 
title=tj@xxxxxxxxxxxxx href="">Tomasz Janeczko 
To: IVA 
GmbH 
Sent: Monday, May 05, 2003 8:03 PM
Subject: Re: Filter question

Hello,
 
You can but the syntax is different.
 
Without using if-else:
 


Filter=Minimum=<FONT 
face="Courier New" color=#0000ff>MA<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>Volume<FONT face="Courier New" 
color=#6600aa>,50<FONT 
face="Courier New" color=#6600aa>)>=<FONT face="Courier New" 
color=#ff00ff>20000;
sym="~"<FONT 
face="Courier New" color=#6600aa>+<FONT face="Courier New" 
color=#0000ff>IndustryID<FONT face="Courier New" 
color=#6600aa>(1<FONT 
face="Courier New" color=#6600aa>); <FONT face="Courier New" 
color=#0000ff>
AddToComposite(Filter * 
C<FONT 
face="Courier New" color=#6600aa>,sym,<FONT face="Courier New" 
color=#ff00ff>"C"<FONT face="Courier New" 
color=#6600aa>);
AddToComposite(Filter * 
O<FONT 
face="Courier New" color=#6600aa>,sym,<FONT face="Courier New" 
color=#ff00ff>"O"<FONT face="Courier New" 
color=#6600aa>);
AddToComposite(Filter * 
H<FONT 
face="Courier New" color=#6600aa>,sym,<FONT face="Courier New" 
color=#ff00ff>"H"<FONT face="Courier New" 
color=#6600aa>);
AddToComposite(Filter * 
L<FONT 
face="Courier New" color=#6600aa>,sym,<FONT face="Courier New" 
color=#ff00ff>"L"<FONT face="Courier New" 
color=#6600aa>);
AddToComposite(Filter * 
V<FONT 
face="Courier New" color=#6600aa>,sym,<FONT face="Courier New" 
color=#ff00ff>"V"); 

AddToComposite(Filter * 
1<FONT face="Courier New" 
color=#6600aa>,sym,"I"<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#000000>
Buy=<FONT 
face="Courier New" color=#ff00ff>0<FONT face="Courier New" 
color=#6600aa>;
 
Using if-else (this is faster):

Filter=Minimum=<FONT 
face="Courier New" color=#0000ff>MA<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>Volume<FONT face="Courier New" 
color=#6600aa>,50<FONT 
face="Courier New" color=#6600aa>)>=<FONT face="Courier New" 
color=#ff00ff>20000;
if( LastValue( Filter ) ){
 sym="~"<FONT 
face="Courier New" color=#6600aa>+<FONT face="Courier New" 
color=#0000ff>IndustryID<FONT face="Courier New" 
color=#6600aa>(1<FONT 
face="Courier New" color=#6600aa>); <FONT face="Courier New" 
color=#0000ff>
 AddToComposite<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>C<FONT face="Courier New" 
color=#6600aa>,sym,"C"<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#0000ff>
 AddToComposite<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>O<FONT face="Courier New" 
color=#6600aa>,sym,"O"<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#0000ff>
 AddToComposite<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>H<FONT face="Courier New" 
color=#6600aa>,sym,"H"<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#0000ff>
 AddToComposite<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>L<FONT face="Courier New" 
color=#6600aa>,sym,"L"<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#0000ff>
 AddToComposite<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>V<FONT face="Courier New" 
color=#6600aa>,sym,"V"<FONT 
face="Courier New" color=#6600aa>); <FONT face="Courier New" 
color=#0000ff>
 AddToComposite<FONT face="Courier New" 
color=#6600aa>(1<FONT 
face="Courier New" color=#6600aa>,sym,<FONT face="Courier New" 
color=#ff00ff>"I");
}<FONT 
face="Courier New" color=#000000>
Buy=<FONT 
face="Courier New" color=#ff00ff>0<FONT face="Courier New" 
color=#6600aa>;
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE dir=ltr 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  IVA GmbH 
  To: <A title=tj@xxxxxxxxxxxxx 
  href="">Amibroker (Tomasz) 
  Sent: Monday, May 05, 2003 2:23 PM
  Subject: Filter question
  
  TJ,
   
  could I filter out stocks to be excluded from my 
  addtocomposites like this:
   
  
  Filter<FONT face="Courier New" 
  color=#6600aa>=Minimum=<FONT face="Courier New" 
  color=#0000ff>MA(<FONT 
  face="Courier New" color=#000000>Volume<FONT face="Courier New" 
  color=#6600aa>,50<FONT 
  face="Courier New" color=#6600aa>)>=<FONT face="Courier New" 
  color=#ff00ff>20000;
  sym="~"<FONT 
  face="Courier New" color=#6600aa>+<FONT face="Courier New" 
  color=#0000ff>IndustryID<FONT face="Courier New" 
  color=#6600aa>(1<FONT 
  face="Courier New" color=#6600aa>); <FONT face="Courier New" 
  color=#0000ff>
  AddToComposite<FONT face="Courier New" 
  color=#6600aa>(<FONT face="Courier New" 
  color=#000000>C<FONT face="Courier New" 
  color=#6600aa>,sym,<FONT face="Courier New" 
  color=#ff00ff>"C"<FONT face="Courier New" 
  color=#6600aa>);
  AddToComposite<FONT face="Courier New" 
  color=#6600aa>(<FONT face="Courier New" 
  color=#000000>O<FONT face="Courier New" 
  color=#6600aa>,sym,<FONT face="Courier New" 
  color=#ff00ff>"O"<FONT face="Courier New" 
  color=#6600aa>);
  AddToComposite<FONT face="Courier New" 
  color=#6600aa>(<FONT face="Courier New" 
  color=#000000>H<FONT face="Courier New" 
  color=#6600aa>,sym,<FONT face="Courier New" 
  color=#ff00ff>"H"<FONT face="Courier New" 
  color=#6600aa>);
  AddToComposite<FONT face="Courier New" 
  color=#6600aa>(<FONT face="Courier New" 
  color=#000000>L<FONT face="Courier New" 
  color=#6600aa>,sym,<FONT face="Courier New" 
  color=#ff00ff>"L"<FONT face="Courier New" 
  color=#6600aa>);
  AddToComposite<FONT face="Courier New" 
  color=#6600aa>(<FONT face="Courier New" 
  color=#000000>V<FONT face="Courier New" 
  color=#6600aa>,sym,<FONT face="Courier New" 
  color=#ff00ff>"V"); 
  
  AddToComposite(<FONT 
  face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
  color=#6600aa>,sym,<FONT face="Courier New" 
  color=#ff00ff>"I"<FONT face="Courier New" 
  color=#6600aa>);
  Buy=<FONT 
  face="Courier New" color=#ff00ff>0<FONT face="Courier New" 
  color=#6600aa>;
  <FONT face=Arial color=#000000 
size=2>






Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.