PureBytes Links
Trading Reference Links
|
Thanks much for the reply, Graham. i get this error.
WLnumber = IIf(Buy,0,1);
CategoryAddSymbol(Name(),categoryWatchlist,WLnumber);
----------------------------------------------------^
Error 2.
Bad arguments
I have tried some similar, but i think the number, in my case 0 or 1, needs
to be an integer. the help file sez--
"0..63 for categorySector, categoryWatchlist".
That's why i asked for some kind of "Test" for a Buy (i assume if a test for
Buy works then a test for Sell work the same way---and there will lots of
times when it is neither) so after the test, i would do the CAS to the
appropriate Watchlist...
btw, the "" means current symbol, ---Why do you think the Filter does not
work in my original example---it lets every symbol get written? am i using
it wrong?
i tried this too (with the // deleted) and it fails with the "^" under the
last "}"---so this test/operation is no good.
Error 3.
Condition in IF, WHILE, FOR statements
has to be Numeric or Boolean type.
You can not use array here,
//if (Buy)
//{
//CategoryAddSymbol( "", categoryWatchlist, 0);
//}
//else
//{
//CategoryAddSymbol( "", categoryWatchlist, 1);
//}
ron
-----Original Message-----
From: Graham [mailto:gkavanagh@xxxxxxxxxxxxx]
Sent: Saturday, April 17, 2004 4:36 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] How do i write the results of a scan or
exploration to a watchlists??
Ron, With any luck this may work :)
CategoryRemoveSymbol( "", categoryWatchlist, 0 );
CategoryRemoveSymbol( "", categoryWatchlist, 1 );
Buy=Cross( MACD(), Signal() );
Sell=Cross(Signal(), MACD() );
Filter=buy or sell;
AddColumn (Buy, "B",1);
AddColumn (Sell, "S",1);
WLnumber = iif(buy,0,1);
CategoryAddSymbol(Name(),categoryWatchlist,WLnumber);
You could explore, or maybe try scan
Cheers,
Graham
http://e-wire.net.au/~eb_kavan/
-----Original Message-----
From: ronbo [mailto:ronbo@xxxxxxxxxxxxxx]
Sent: Sunday, April 18, 2004 7:20 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] How do i write the results of a scan or exploration to
a watchlists??
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
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
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
---
Incoming 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
---
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/
|