PureBytes Links
Trading Reference Links
|
Herman,
You tweak the code and I do not feel responsible for this.
Since the subject is interesting, read again the
http://groups.yahoo.com/group/amibroker/message/56379
and try to see the difference between OrdNo and catalogue ID.
As for your code, you try to use [ ] - subscript operator with stocks
with different histories.
But, if BGEN has, say, 901 bars in your database, then the last BGEN
close will be C[900].
If, in the same database, MSFT [and the other N100 stocks] has 951
bars, then C[900] will not be the last MSFT close.
The last MSFT close will be C[950], which is "out of range" for the
shorter BGEN.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen" <psytek@xxxx>
wrote:
> Thanks for your comments DT.
>
> Yes, I did try your code and I got "exactly" the same results using
your
> code as using StockNum. I quess you didn't try my code :-) Here is
the
> example highlighting my problem again, this time I include your
code for
> comparison: it doesn't change anything (see chart below, Red is
mine, Blue
> is your code).
>
> The question remains unanswered: why does a stock that stops
trading but
> that remains in the watchlist change the sequence of 'StockNum's in
my
> composite? I expected to see a straight line.
>
> My chart shows that when my stock (#11) stops having data it's
StockNum
> drops to zero and then the offset is added again at position 56.
There is
> probably a very simple explanation but i don't see/understand what
is
> happening.
>
> herman
>
>
>
> Buy=Sell=Short=Cover=0;
> StockNum = Status("StockNum");
>
> function DTid()
> {
> Listnum=0;id=0;
> list = CategoryGetSymbols( categoryWatchlist, listnum );
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> {
> if(sym==Name()) {id=i;}
> }
> return id;
> }
>
> T1[BarCount-StockNum-1] = StockNum;
> AddToComposite(T1,"~T1","X");
> T2[BarCount-StockNum-1] = DTid();
> AddToComposite(T2,"~T2","X");
> SetForeign("~T1");
> Plot(C,"T1",6,1|4);
> SetForeign("~T2");
> Plot(C,"T2",4,1|4);
> GraphXSpace = 5
> -----Original Message-----
> From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
> Sent: January 7, 2004 9:19 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Need a Numerical Stock reference
>
>
> Herman,
> Did you really try the code [after the instructions] and didnīt
work
> reliably ?
> Because it works in my 4.50.6.
> If BEAS is #18 in the superWL60, it will give ID=18 in any
> exploration [current stock, other WL including BEAS, other group
> including BEAS etc].
> This ID=18 will be unique for BEAS and, as far as I understood, it
> was your request.
> Do not forget to move **ALL** stocks into WL60 **BEFORE** any
> exploration.
> I have no doubt it works !!
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen"
<psytek@xxxx>
> wrote:
> > Thanks DT but that doesn't work reliably.
> >
> > Your ID is not permanent across watchlist or with changing
> watchlists. Take
> > my current problem. All I want to do is store StockNumbers in an
> composite,
> > starting with stock zero in the last bar. I intended to use the
> other price
> > fields for temporary stock specific data, as an easy lookup
table.
> I think
> > quite a few users use this method...but see what unexpected
results
> I got.
> > Frankly I can't explain what is happening, perhaps you can?
> >
> > If you have time do me a favour and load this simple code into
your
> AA. Make
> > sure you have BGEN (stopped trading for QP2 2003/11/12) in your
> N100. Run a
> > Scan on All Quotations, then Old-Backtest and click Equity to
see
> the chart.
> > You'll get figure 1, now remove BGEN and repeat, and you'll get
> figure 2.
> > You might also make BGEN current and you'll see that the chart
is
> truncated.
> > All this really messed with my data...
> >
> > thanks for any explanation you may be able to give,
> > herman.
> >
> > Buy=Sell=Short=Cover=0;
> > StockNum = Status("StockNum");
> > T1[BarCount-StockNum-1] = StockNum;
> > AddToComposite(T1,"~T1","X");
> > SetForeign("~T1");
> > Plot(C,"T1",4,1|4);
> > GraphXSpace = 5;
> >
> >
> > Figure 1 - This is what you get with BGEN in the N100
> >
> >
> > Figure 2 - This is how it should look!
> >
> >
> >
> > -----Original Message-----
> > From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
> > Sent: January 7, 2004 7:45 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Need a Numerical Stock reference
> >
> >
> > Herman,
> > The ID will be available if you send all stocks to, say, WL60.
> > Then,
> >
> > Listnum=60;id=0;
> > list = CategoryGetSymbols( categoryWatchlist, listnum );
> > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> > {
> > if(sym==Name())
> > {id=i;}
> > }
> > Filter=1;
> > AddColumn(id,"ID");
> > Dimitris Tsokakis
> > --- In amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen"
> <psytek@xxxx>
> > wrote:
> > > Hello,
> > >
> > > Would anybody know if there is a way to assign, or perhaps
AB
> has
> > it already
> > > internally, a permanent numerical ID to stocks?
> > >
> > > What I need is a fast NumericalStockID <-> Symbol conversion
> > routine (DLL?).
> > > Would it be possible to convert a Symbol's ASCII string to a
> number
> > within
> > > the processing range of AB? I don't like tables because they
> have
> > to be
> > > maintained, loaded and saved.
> > >
> > > It is so much easier to work with permanent reference
numbers as
> > they can be
> > > stored and manipulated in numerical arrays.
> > >
> > > Status("StockNum") doesn't work for me because it changes
with
> the
> > watchlist
> > > or when a stock drops out half-way during an AA operation, I
> found
> > that out
> > > the hard way :-(
> > >
> > > Are there any rules that govern the creation/issue of stock
> symbols?
> > >
> > > many thanks for any help you can give,
> > > herman.
> >
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/
|