PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Hello Dt,
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>here is some code I played with to compare In-Line vs
AddToComposite() methods. The code create a normalcomposite but could easily be
modified to create Adv/Dec issues. I found that Nz() was required to give me the
full length composites... please correct me if this code is
incorrect.
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>Herman.
<FONT face=Arial color=#0000ff
size=2>
//
In-Line vs AddToComposite Demo<FONT
color=#000000> for AA// First
Scan then Explore All Quotations on Selected
Watchlist<FONT
color=#000000> WatchListNumber = 3<FONT
color=#000000>; // <<<<== Set to your
Filter-watchlist number!<FONT
face=Arial> <FONT
color=#ff0000>Buy=<FONT
color=#ff0000>Sell=<FONT
color=#ff0000>Short=<FONT
color=#ff0000>Cover=<FONT
color=#ff00ff>0<FONT
color=#000000>; SetOption<FONT
color=#000000>("NoDefaultColumns"<FONT
color=#000000>,True<FONT
size=2>); Scan = <FONT
color=#0000ff>Status(<FONT
color=#ff00ff>"Action")==<FONT
color=#ff00ff>3<FONT
color=#000000>; Explore = Status<FONT
color=#000000>("Action"<FONT
color=#000000>)==4<FONT
size=2>; FirstStock = <FONT
color=#0000ff>Status(<FONT
color=#ff00ff>"StockNum")==<FONT
color=#ff00ff>0<FONT
color=#000000>; <FONT
color=#ff0000>Filter<FONT
face=Arial>=FirstStock; O1=H1=L1=C1=n1=<FONT
color=#ff00ff>0<FONT
color=#000000>; List = <FONT
color=#0000ff>GetCategorySymbols( <FONT
color=#ff0000>categoryWatchlist<FONT
face=Arial>, WatchListNumber); <FONT
color=#ff0000>function<FONT
face=Arial> CreateComposite() {
for<FONT
color=#000000>( n=0;
(Ticker=StrExtract( List,
n))!= ""<FONT
face=Arial>; n++) {
<FONT
color=#0000ff>SetForeign<FONT
color=#000000>(Ticker); O1=O1+<FONT
color=#0000ff>Nz(<FONT
color=#ff0000>O<FONT
color=#000000>); H1=H1+<FONT
color=#0000ff>Nz(<FONT
color=#ff0000>H<FONT
color=#000000>); L1=L1+<FONT
color=#0000ff>Nz(<FONT
color=#ff0000>L<FONT
color=#000000>); C1=C1+<FONT
color=#0000ff>Nz(<FONT
color=#ff0000>C<FONT
color=#000000>); n1 = n1 + <FONT
color=#0000ff>Nz(<FONT
color=#ff0000>O><FONT
color=#ff00ff>0<FONT
color=#000000>); <FONT
color=#0000ff>RestorePriceArrays<FONT
face=Arial>(); }
<FONT
color=#ff0000>return<FONT
face=Arial> n1; } <FONT
color=#ff0000>if(Explore <FONT
color=#ff0000>AND<FONT
color=#000000> FirstStock) n1 = CreateComposite(); <FONT
color=#0000ff>AddColumn(<FONT
color=#0000ff>BarIndex(),<FONT
color=#ff00ff>"Bar#",<FONT
color=#ff00ff>1.0<FONT
color=#000000>); AddColumn<FONT
color=#000000>(n1,"iln1"<FONT
color=#000000>,1.0<FONT
size=2>); <FONT
color=#0000ff>AddColumn(O1/n1,<FONT
color=#ff00ff>"ilO1",<FONT
color=#ff00ff>1.2<FONT
color=#000000>); AddColumn<FONT
color=#000000>(H1/n1,"ilH1"<FONT
color=#000000>,1.2<FONT
size=2>); <FONT
color=#0000ff>AddColumn(L1/n1,<FONT
color=#ff00ff>"ilL1",<FONT
color=#ff00ff>1.2<FONT
color=#000000>); AddColumn<FONT
color=#000000>(C1/n1,"ilC1"<FONT
color=#000000>,1.2<FONT
size=2>); <FONT
color=#ff0000>if<FONT
color=#000000>(Scan) { <FONT
color=#0000ff>AddToComposite(<FONT
color=#ff0000>O,<FONT
color=#ff00ff>"~TestComp",<FONT
color=#ff00ff>"O",<FONT
color=#ff00ff>1|<FONT
color=#ff00ff>2|<FONT
color=#ff00ff>16<FONT
color=#000000>); AddToComposite<FONT
color=#000000>(H<FONT
color=#000000>,"~TestComp"<FONT
color=#000000>,"H"<FONT
color=#000000>,1<FONT
color=#000000>|2<FONT
color=#000000>|16<FONT
size=2>); <FONT
color=#0000ff>AddToComposite(<FONT
color=#ff0000>L,<FONT
color=#ff00ff>"~TestComp",<FONT
color=#ff00ff>"L",<FONT
color=#ff00ff>1|<FONT
color=#ff00ff>2|<FONT
color=#ff00ff>16<FONT
color=#000000>); AddToComposite<FONT
color=#000000>(C<FONT
color=#000000>,"~TestComp"<FONT
color=#000000>,"C"<FONT
color=#000000>,1<FONT
color=#000000>|2<FONT
color=#000000>|16<FONT
size=2>); <FONT
color=#0000ff>AddToComposite(<FONT
color=#ff00ff>1,<FONT
color=#ff00ff>"~TestComp",<FONT
color=#ff00ff>"V",<FONT
color=#ff00ff>1|<FONT
color=#ff00ff>2|<FONT
color=#ff00ff>16<FONT
color=#000000>); } n2 = <FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~TestComp",<FONT
color=#ff00ff>"V"<FONT
color=#000000>); O2 = Foreign<FONT
color=#000000>("~TestComp"<FONT
color=#000000>,"O"<FONT
size=2>)/n2; H2 = <FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~TestComp",<FONT
color=#ff00ff>"H"<FONT
color=#000000>)/n2; L2 = Foreign<FONT
color=#000000>("~TestComp"<FONT
color=#000000>,"L"<FONT
size=2>)/n2; C2 = <FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~TestComp",<FONT
color=#ff00ff>"C"<FONT
color=#000000>)/n2; AddColumn<FONT
color=#000000>(n2,"atcn2"<FONT
color=#000000>,1.0<FONT
size=2>); <FONT
color=#0000ff>AddColumn(O2,<FONT
color=#ff00ff>"atcO2",<FONT
color=#ff00ff>1.2<FONT
color=#000000>); AddColumn<FONT
color=#000000>(H2,"atcH2"<FONT
color=#000000>,1.2<FONT
size=2>); <FONT
color=#0000ff>AddColumn(L2,<FONT
color=#ff00ff>"atcL2",<FONT
color=#ff00ff>1.2<FONT
color=#000000>); AddColumn<FONT
color=#000000>(C2,"atcC2"<FONT
color=#000000>,1.2)
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial
size=2>-----Original Message-----From: DIMITRIS TSOKAKIS
[mailto:TSOKAKIS@xxxxxxxxx]Sent: December 15, 2003 5:30
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re:
AdvIssues over WatchList<FONT face=Arial
size=2>Tomasz,thank you for the clarification, I didnīt have the
opportunity to verify this.Phsst,After this you should check the
WLs fro probable holes.Dimitris Tsokakis--- In
amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
wrote:> Of course it works regardless of number of symbols. It is
just slower when there are more symbols.> > Best
regards,> Tomasz Janeczko> amibroker.com> ----- Original
Message ----- > From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>>
To: <amibroker@xxxxxxxxxxxxxxx>> Sent: Monday, December 15, 2003
9:33 AM> Subject: [amibroker] Re: AdvIssues over WatchList>
> > > Phsst,> > there was a recent Tomasz
suggestion to avoid using CategoryGetSymbols> > () function for
great WatchLists [more than 100 tickers or so]. > > Unfortunately I
do not have WLs with 500 or 1000 stocks to check if > > it is
just slow or if it becomes wrong as the population increases.> >
The results for my N100 database [101 tickers] were correct in > >
repeated uses.> > Anyway, all these examples may be treated through
AddToComposite() > > scans and I hope you are familiar with this
technique.> > Dimitris Tsokakis> > --- In
amibroker@xxxxxxxxxxxxxxx, "Phsst" <phsst@xxxx> wrote:> > >
Dimitris,> > > > > > I had tried your IB version
earlier tonight and had mixed results.> > > > >
> When I ran it against a WL that contained 600+ issues, it failed
to> > > produce any results.> > > > > >
Then when I ran it against WL's that contained 3 and 130+- issues>
> > respectively, it worked.> > > > > > Now,
when I run your new EXPLORE, I am having the same issue. > > >
> > > When I run it against the 3 and 130+- issue WL, it works
fine.> > > > > > But when I run it against the
larger 600+ WL, I get no results in > > the> > >
Results window at all.> > > > > > Sorry that I
cannot give you any more info than that.> > > > > >
Getting late here. I'll look at it some more tomorrow. The reason >
> I'm> > > interested is that I am having a similiar problem
with another > > explore> > > using the same 600+ issue
WL that is not producing any results.> > > > > >
Regards,> > > > > > Phsst> > > >
> > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" > >
<TSOKAKIS@xxxx>> > > wrote:> > > >
John,> > > > The formula was for Indicator builder.>
> > > You should add some lines to make it work in AA.> >
> > Here is the adv/unch/dec/total for WL20.It will work in either
IB > > or > > > > AA windows.> > > >
> > > > WLno=20;> > > > Adv
= 0; Dec=0;unch=0; > > > > for( i = 0; (
sym=StrExtract(CategoryGetSymbols( > > > > categoryWatchlist,
WLno)> > > > , i ) ) != ""; i++ ) > > >
> {> > > > SetForeign(sym);> >
> > r=ROC(C,1);> > > > adv=(r>0)+adv;> >
> > unch=(r==0)+unch;> > > > dec=(r<0)+dec;>
> > > }> > > > Plot(adv,"adv",colorBlack,1);>
> > > Plot(unch,"unch",colorRed,1);> > > >
Plot(dec,"dec",colorGreen,1);> > > >
Plot(adv+dec+unch,"total",colorIndigo,8);> > > >
Filter=1;> > > > AddColumn(adv,"adv",1.0);> > >
> AddColumn(unch,"unch",1.0);> > > >
AddColumn(dec,"dec",1.0);> > > >
AddColumn(adv+unch+dec,"total",1.0);> > > > > > >
> Now, for the exploration part,> > > > Select any stock,
no matter if it belongs to WL20 or not, select > > a >
> > > date [or a range of dates] and explore. The result will be
> > > > independent of the selected stock.> > >
> Dimitris Tsokakis> > > > --- In
amibroker@xxxxxxxxxxxxxxx, "john gibb" <jgibb1@xxxx> wrote:>
> > > > Hi DT,> > > > > > > > >
> I got a blank panel using an N100 Watchlist (WLno=0), and > >
from/to => > > > > 12/12/2003?> > > > >
> > > > > What are your 'Apply To', 'Range' (and/or any
other 'Settings') > > > > values here?> > >
> > > > > > > thanks> > > > >
> > > > > -john> > > > > ----- Original
Message ----- > > > > > From: "DIMITRIS TSOKAKIS"
<TSOKAKIS@xxxx>> > > > > To:
<amibroker@xxxxxxxxxxxxxxx>> > > > > Sent: Sunday,
December 14, 2003 8:16 AM> > > > > Subject: [amibroker] Re:
AdvIssues over WatchList> > > > > > > > >
> > > > > > > For WatchList12> > > >
> >> > > > > > WLno=12;> > > >
> > Adv = 0; Dec=0;unch=0;> > > > >
> for( i = 0; (
sym=StrExtract(CategoryGetSymbols(> > > > > >
categoryWatchlist, WLno)> > > > > > , i ) ) != "";
i++ )> > > > > > {> > > > >
> SetForeign(sym);> > > > > >
r=ROC(C,1);> > > > > > adv=(r>0)+adv;> >
> > > > unch=(r==0)+unch;> > > > > >
dec=(r<0)+dec;> > > > > > }> > > >
> > Plot(adv,"adv",colorblack,1);> > > > > >
Plot(unch,"unch",colorred,1);> > > > > >
Plot(dec,"dec",colorgreen,1);> > > > > >
Plot(adv+dec+unch,"total",colorindigo,8);> > > > > >
Dimitris Tsokakis> > > > > > --- In
amibroker@xxxxxxxxxxxxxxx, "salil_gangal" > > > >
<salil_gangal@xxxx>> > > > > > wrote:> >
> > > > > Friends,> > > > > >
>> > > > > > > Functions
AdvIssues/Decssues/UncIssues work over > > the 'Market' in>
> > > > > > which the current Issue exists. However,
are there any > > > > functions> > > > >
> > similar to this that work over the 'WatchList' instead > >
> > of 'Market' ?> > > > > > >> >
> > > > > Regards,> > > > > > > -
Salil V Gangal> > > > > >> > > > >
>> > > > > >> > > > > > Send
BUG REPORTS to bugs@xxxx> > > > > > Send SUGGESTIONS to
suggest@xxxx> > > > > >
-----------------------------------------> > > > > >
Post AmiQuote-related messages ONLY to: > >
amiquote@xxxxxxxxxxxxxxx> > > > > > (Web page:
<FONT
face=Arial
size=2>http://groups.yahoo.com/group/amiquote/messages/)<FONT
face=Arial size=2>> > > > > >
--------------------------------------------> > > > > >
Check group FAQ at:> > > > > <A
href=""><FONT
face=Arial
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT
face=Arial size=2>> > > > > >> > > > >
> Your use of Yahoo! Groups is subject to > > > > <A
href=""><FONT face=Arial
size=2>http://docs.yahoo.com/info/terms/<FONT face=Arial
size=2>> > > > > >> > > > > >>
> > > > >> > > > > > >
> Send BUG REPORTS to bugs@xxxx> > Send SUGGESTIONS to
suggest@xxxx> > ----------------------------------------->
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx >
> (Web page: <A
href=""><FONT face=Arial
size=2>http://groups.yahoo.com/group/amiquote/messages/)<FONT
face=Arial size=2>> >
--------------------------------------------> > Check group FAQ at:
<A
href=""><FONT
face=Arial
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT
face=Arial size=2> > > > > Your use of Yahoo! Groups is
subject to <FONT
face=Arial size=2>http://docs.yahoo.com/info/terms/<FONT face=Arial
size=2> > > > > > ><FONT
face=Arial size=2>Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS
to suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page:
<FONT
face=Arial
size=2>http://groups.yahoo.com/group/amiquote/messages/)<FONT
face=Arial size=2>--------------------------------------------Check group
FAQ at: <A
href=""><FONT
face=Arial
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT
face=Arial size=2> Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
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.
|