PureBytes Links
Trading Reference Links
|
Before attempting any solution, I want to make clear your request :
You want to automatically move all stocks of "GoodOne" for the lat 6
bars to WL1 and all the rest to WL2.
Correct ?
Please advise.
My next question re: the 6 last days. If MSFT is GoodOne for the last
day and Not(GoodOne) the very previous day, in which WL you want to
send it ?
As for the exploration:
1. When you explore, you actually ask all the stocks which were
GoodOne even for one of the 6 last days.
2. If MSFT was a GoodOne the 4 of the last 6 days, it will appear 4
times in the total sum of the exploration results. the most probable
is to have 200 results for an 100 stocks database.
You should ask *the same thing* from the WL code.
Your request should be Sum(GoodOne,6)>=1
Example:
// Some 4.46.0 applications
// Remove symbols from WLs
CategoryRemoveSymbol( Name(), categoryWatchlist, 30 );
CategoryRemoveSymbol( Name(), categoryWatchlist, 31 );
// Stochastic O/B criteria
OVERBOUGHT=StochD()>70;
SIXBARS=Sum(OVERBOUGHT,6)>=1;
WLNumber=IIf(SIXBARS,30,31);
z=StrToNum(NumToStr(WLNumber));
// add symbols to the respective WLs
CategoryAddSymbol(Name(),categoryWatchlist,z);
Filter=1;
AddColumn(SIXBARS,"",1.0);
AddColumn(NOT(SIXBARS),"",1.0);
Explore for the n=1 last quotations to send to WL30 all these stocks
which they were OVERBOUGHT at least once during the last 6 bars.
See also, since StrToNum, NumToStr are not yet fully described, the
selectedvalue( ARRAY ) documentation :
"In AA window 'selected element' means THE LAST BAR of currently
selected
analysis range. It is the last available bar for "all quotes"
and "last n quotes" range."
You should read all these properties very well before changing codes
and settings.
You will have the same results with
// Some 4.46.0 applications
// Remove symbols from WLs
CategoryRemoveSymbol( Name(), categoryWatchlist, 30 );
CategoryRemoveSymbol( Name(), categoryWatchlist, 31 );
// Stochastic O/B criteria
OVERBOUGHT=StochD()<50;
SIXBARS=Sum(OVERBOUGHT,6)>=1;
WLNumber=IIf(SIXBARS,30,31);
z=SelectedValue(WLNumber);
// add symbols to the respective WLs
CategoryAddSymbol(Name(),categoryWatchlist,z);
Filter=1;// EXPLORE FOR THE N=1 LAST QUOTATIONS, PLEASE
AddColumn(SIXBARS,"",1.0);
AddColumn(NOT(SIXBARS),"",1.0);
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Joey Lin" <lzhiyi@xxxx> wrote:
> Ok. Here is the script I used to test. I run it with range set "n
last days"
> n =6. The result panel shows 130 records, why list 1 only a few. If
you run
> it, maybe you will know what's my problem.
>
> Thanks
>
> joey
>
______________________________________________________________________
_____
> //category watch list testing.
>
> //CategoryRemoveSymbol("",categoryWatchlist,0);
> CategoryRemoveSymbol("",categoryWatchlist,1);
> //CategoryRemoveSymbol("",categoryWatchlist,2);
>
> Condition1 = BarsSince (Volume <= MA(Volume, 15)*2 )>= 1 ; //volume
increase
> twice average
> Condition2 = MA(Volume, 15) > 500000; // average volume greater
than 500,000
>
> GoodOne = Condition1 AND Condition2 ;
>
> WLNum = IIf(GoodOne, 1, 2);
> z=StrToNum(NumToStr(WLNum));
> CategoryAddSymbol(Name(), categoryWatchlist, z);
>
> Filter = Condition1 AND Condition2 ;
> Buy = Filter;
> Sell = BuyPrice * 0.05;
>
> AddColumn(Close, "Close ");
> AddColumn(Volume, "Volume ");
> AddColumn(LastValue(MA(Volume,3)), "last 3 day average volume");
> AddColumn(MA(Volume,15), "average volume");
> AddColumn(LinRegSlope(C, 100), "long ter slop");
>
>
______________________________________________________________________
______
> -----Original Message-----
> From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
> Sent: Monday, October 27, 2003 10:35 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Organize your WatchLists in Daily basis
>
> No, the results are not added as you expect.
> There is a CategoryRemoveSymbol() statement at the beginning of the
> exploration. It REMOVES all stocks from the WL. Then the selected
> stocks are added. If this statement was not included, WLs would
> contain all stocks in a few days.
> What do you search, beyond this code. Do you want to create a WL
with
> the ADVISSUES of March1, 2003 for example ? Is it possible to
explain
> your request ? Do not ask from a code to do everything, check if it
> does what promisses to do.
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Joey Lin" <lzhiyi@xxxx> wrote:
> > Well, I am expecting that the result shown in the result panel
will
> all be
> > added into the watch list instead of just today's. The point is
> there is a
> > discrepancy of result between what's inserted into the watch list
> and result
> > panel, and I don't how to resolve this.
> >
> > Thanks
> >
> > joey
> >
> > -----Original Message-----
> > From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
> > Sent: Monday, October 27, 2003 9:09 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Organize your WatchLists in Daily basis
> >
> > But, it is written :"Explore all stocks, n=1 last quotations
> with..."
> > Is it not enough ?
> > Dimitris Tsokakis
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "Joey Lin" <lzhiyi@xxxx> wrote:
> > > Hi
> > >
> > > Thanks all for the great example for automation of watch list.
> But
> > it seems
> > > can only for the stocks that qualify the conditions for the
> current
> > date. I
> > > setup some conditions, and no matter how I choose the date
range
> > either last
> > > 10 dates or from 10/14/2003 to 10/24/2003(today) the result
panel
> > gets a lot
> > > of results, which seems right, but watch list only get the
result
> > from
> > > today, far fewer than the list in the result panel.
> > >
> > > I am new for the AB programming and I don't know what's logic
> behind
> > > exploration dialog, so can someone shed some light onto this?
> > >
> > > Thanks
> > >
> > > joey
> > >
> > > -----Original Message-----
> > > From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
> > > Sent: Sunday, October 26, 2003 6:30 AM
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: [amibroker] Re: Organize your WatchLists in Daily basis
> > >
> > > Tomasz,
> > > thank you for the simplified example.
> > > BTW, how should I know this "emtpy string means current
symbol" ??
> > > I have met this "" in your code for GetCategorySymbols(
category,
> > > index )
> > > You write [and I use]
> > >
> > > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> > >
> > > Does it mean "sym not equal to current symbol" ??
> > > Because, in this looping, current symbol *will be included* in
> the
> > > search...
> > > What I understood from this !="" was : all symbols [no matter
how
> > > many]. Did I miss something in this [important] loop ?
> > > Dimitris Tsokakis
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko"
> > <amibroker@xxxx>
> > > wrote:
> > > > Dimitris,
> > > >
> > > > No you dont need StrToNum() at all. and you don't need Name()
> > > because "" emtpy string means current symbol.
> > > >
> > > > Your code therefore can be simplified to:
> > > >
> > > > // Some 4.46.0 applications
> > > > // Remove symbols from WLs
> > > > CategoryRemoveSymbol( "", categoryWatchlist, 30 );
> > > > CategoryRemoveSymbol( "", categoryWatchlist, 31 );
> > > > CategoryRemoveSymbol( "", categoryWatchlist, 32 );
> > > > CategoryRemoveSymbol( "", categoryWatchlist, 33 );
> > > > CategoryRemoveSymbol( "", categoryWatchlist, 34 );
> > > > CategoryRemoveSymbol( "", categoryWatchlist, 35 );
> > > > // Stochastic O/B, O/S criteria
> > > > OVERBOUGHT=LastValue(StochD()>70);
> > > > OVERSOLD=LastValue(StochD()<30);
> > > > WLNumber=IIf(OVERBOUGHT,30,IIf(OVERSOLD,32,31));
> > > > // add symbols to the respective WLs
> > > > CategoryAddSymbol(Name(),categoryWatchlist,WLNumber);
> > > > // Adv, Dec criteria
> > > > Adv=LastValue( C>Ref(C,-1) );
> > > > Dec=LastValue( C<Ref(C,-1) );
> > > > WLNumber1=IIf(Adv,33,IIf(Dec,35,34));
> > > > CategoryAddSymbol(Name(),categoryWatchlist,WLNumber1);
> > > > Filter=1;
> > > > AddColumn(C,"C");
> > > >
> > > > Best regards,
> > > > Tomasz Janeczko
> > > > amibroker.com
> > > > ----- Original Message -----
> > > > From: Dimitris Tsokakis
> > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > Sent: Sunday, October 26, 2003 12:04 PM
> > > > Subject: [amibroker] Organize your WatchLists in Daily basis
> > > >
> > > >
> > > > The fresh 4.46.0, Oct22, 2003 gives some excellent
> > possibilities
> > > to automatically organize your WatchLists.
> > > > Example:
> > > > Select some Watchlists not in use, say WL30, WL31, WL32 to
be
> > the
> > > stochastic O/B, CONGESTIVE, O/S respectively and
> > > > WL33, WL34, WL35 to be the ADVISSUES, UNCISSUES and
DECISSUES
> > > respectively.
> > > > Right after the new EODs download, Explore all stocks, n=1
> > last
> > > quotations with
> > > >
> > > > // Some 4.46.0 applications
> > > > // Remove symbols from WLs
> > > > CategoryRemoveSymbol( Name(), categoryWatchlist, 30 );
> > > > CategoryRemoveSymbol( Name(), categoryWatchlist, 31 );
> > > > CategoryRemoveSymbol( Name(), categoryWatchlist, 32 );
> > > > CategoryRemoveSymbol( Name(), categoryWatchlist, 33 );
> > > > CategoryRemoveSymbol( Name(), categoryWatchlist, 34 );
> > > > CategoryRemoveSymbol( Name(), categoryWatchlist, 35 );
> > > > // Stochastic O/B, O/S criteria
> > > > OVERBOUGHT=StochD()>70;
> > > > OVERSOLD=StochD()<30;
> > > > WLNumber=IIf(OVERBOUGHT,30,IIf(OVERSOLD,32,31));
> > > > z=StrToNum(NumToStr(WLNumber));
> > > > // add symbols to the respective WLs
> > > > CategoryAddSymbol(Name(),categoryWatchlist,z);
> > > > // Adv, Dec criteria
> > > > Adv=C>Ref(C,-1);
> > > > Dec=C<Ref(C,-1);
> > > > WLNumber1=IIf(Adv,33,IIf(Dec,35,34));
> > > > z1=StrToNum(NumToStr(WLNumber1));
> > > > CategoryAddSymbol(Name(),categoryWatchlist,z1);
> > > > Filter=1;
> > > > AddColumn(C,"C");
> > > >
> > > > then hit View->RefreshAll and all above WatchLists will be
> > > automatically updated for further use.
> > > > Through Symbol->Categories->WatchLists->EditName you may
name
> > the
> > > respective WatchLists.
> > > > You may create now your own organization with various
> > conditions.
> > > > Note1: the new function CategoryAddSymbol( symbol,
category,
> > > number ) does not accept a variable inrut for "number", but
the
> > > > StrToNum(NumToStr(variable)) will overcome this obstacle.
> > > > Dimitris Tsokakis
> > > >
> > > > Yahoo! Groups Sponsor
> > > > ADVERTISEMENT
> > > >
> > > >
> > > >
> > > >
> > > > 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@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@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/
------------------------ 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/ybSovB/hP.FAA/3jkFAA/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/
|