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

Re: [amibroker] AA Window



PureBytes Links

Trading Reference Links

Ronbo, 

Try the following:

CategoryRemoveSymbol( "", categoryWatchlist, 0 );
CategoryRemoveSymbol( "", categoryWatchlist, 1 );
Buy=Cross( MACD(), Signal() );
//Sell=Cross(Signal(), MACD() );

Filter=Buy;
AddColumn (Buy, "test");

if (LastValue(Buy) == 1)
{
CategoryAddSymbol("", categoryWatchlist, 0);
}

Using the Lastvalue() function and compare operator "==" seemed to 
do it.  The conditional IF needs to have numeric values to work 
properly.  

I hopes this answers most of your questions.

Perry


--- In amibroker@xxxxxxxxxxxxxxx, "ronbo" <ronbo@xxxx> wrote:
> i have been trying for day, all kinds of combinations of IIF, and 
If to get
> CategoryAddSymbol("",categoryWatchlit, 0) to write ONLY the 
symbols meeting
> the Buy criteria, and to get CategoryAddSymbol
("",categoryWatchlit, 1) to
> write ONLY the symbols meeting the Sell criteria.
> 
> I have used Filter=Buy or Filter=Sell immediately before the above 
commands,
> but i ALWAYS get the whole list of symbols written into Watch list 
0 or 1.
> What am i doing wrong with the Filter?  or the CAS command??
> 
> My simple code is:
> 
> CategoryRemoveSymbol( "", categoryWatchlist, 0 );
> CategoryRemoveSymbol( "", categoryWatchlist, 1 );
> Buy=Cross( MACD(), Signal() );
> //Sell=Cross(Signal(), MACD() );
> 
> Filter=Buy;
> AddColumn (Buy, "test");
> CategoryAddSymbol("", categoryWatchlist, 0);
> 
> The Filter works for the Column in the Explore Result---only Buys 
are shown,
> and in the "test" column, only a "1" is shown, but All scanned 
symbols are
> in Watchlist 0.
> 
> i'm missing something serious here.  it probably has something to 
do with
> Arrays, and requirement of the IIf and if, then, else commands 
which i do
> not understand.
> 
> Not only would i like the code, or a real pointer what i am doing 
wrong, but
> i would like an explanation what is the correct way---or point me 
to a web
> page, help section.
> 
> i would like, using scan or exploration:
> 1. a test of Buy to write the symbol into Watchlist 0,
> 2. a test of Sell to write the symbol into Watchlist 1,
> 
> AND caution--if you are going to copy this code to try it, change 
the watch
> list numbers--0 and 1--otherwise you will delete your current 
watchlists---0
> and 1.
> 
> thanks much for the help,
> ron
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.659 / Virus Database: 423 - Release Date: 4/15/2004



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/