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

[amibroker] Re: Array question



PureBytes Links

Trading Reference Links

1.) Show the chart of QQQQ (data from March 2000 to present)
2.) Click analysis, commentary.  Click load and open the script
containing only the two lines shown below.
3.) Click apply, then commentary tab.  Says "barcount is 1,634.000"
4.) Close Commentary
5.) Click analysis, formula editor, open same script opened in
Commentary.  Click apply indicator.  Get the "Subscript out of
range..." error.



--- In amibroker@xxxxxxxxxxxxxxx, neurotic self <neuroticself@xxxx> wrote:
> Uh? it works for me as expected in a commentary window on a single
> symbol, just fails if I put a number >= BarCount
> 
> Where/how do you run the last script?
> 
> On 9/3/05, sam_92841 <sam_92841@xxxx> wrote:
> > Thanks neuro.  I think I understand what Graham said however I am
> > still having problems.  The following script indicates there are 1684
> > bars for QQQQ but the script still fails with the same error.
> > 
> > "barcount is " + NumToStr(BarCount);
> > TestArray[800] = 0;  // test
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, neurotic self
<neuroticself@xxxx> wrote:
> > > Hi Sam,
> > >
> > > just a clarification, ignore if useless to you.
> > >
> > > TickerScore[800] = 0;
> > >
> > > AFAIK this is NOT declaring an 800 items array, just trying to
assign
> > > zero to the 800th element. All arrays are implicitly declared with
> > > BarCount elements, that's why Graham suggested creating a fake
symbol
> > > with more history.
> > >
> > > neuro
> > >
> > > On 9/3/05, Graham <kavemanperth@xxxx> wrote:
> > > > for starters there are only 64 watchlists, 0.....63
> > > > Param( "Watchlist", 5, 0, 63, 0 );//
> > > >
> > > >
> > > > to create a larger ticker length, just create a new ticker
then using
> > > > excel create a long history for it in a csv file and import
this to
> > > > AB.
> > > >
> > > >
> > > > I just loaded into AB and not really cerain what it is meant
to do but
> > > > i got no error messages
> > > >
> > > > On 9/3/05, sam_92841 <sam_92841@xxxx> wrote:
> > > > > I modified the following script as a test to try to declare
an array
> > > > > with 800 elements.  The error message is:
> > > > > Error 10
> > > > > Subscript out of range.
> > > > > You must not access array elements outside 0..(BarCount-1)
range.
> > > > >
> > > > > If there is a way to make a larger array please point me to the
> > > > > section in the help file.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Sam
> > > > >
> > > > > Listnum = Param( "Watchlist", 5, 0, 100, 0 );// Watchlist to
> > display.
> > > > >
> > > > > // the start point of comparision will be StartPoint bar
> > > > > sp = Param( "Startpoint %", 55, 1, 100, 1 );
> > > > > startpoint = int(BarCount*(sp/100));
> > > > >
> > > > > // Here is a base line - We Use Currenty Selected Ticker.
> > > > > // (Use an Index as your Base eg XAO,XEJ,XMJ Etc...)
> > > > > price = Close;
> > > > > baseline = 100 * ( price/ValueWhen( Cum(1) == startpoint, price
> > ) - 1 );
> > > > >
> > > > > // base line chart (flat line)
> > > > > Plot ( baseline - baseline,Name(),6,1);
> > > > > TickerScore[800] = 0;  // test
> > > > >
> > > > > list = CategoryGetSymbols( categoryWatchlist, listnum );
> > > > > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> > > > >  {
> > > > >
> > > > >
> > > > >    price = Foreign( sym, "C" );
> > > > >
> > > > >         Plot (100 * ( price/ValueWhen( Cum(1) == startpoint,
> > price ) - 1 )-
> > > > > baseline,sym,6+i,1);
> > > > >  }
> > > > >
> > > > >
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx>
wrote:
> > > > > > create a new larger array ticker to the size you want
> > > > > >
> > > > > > On 9/1/05, sam_92841 <sam_92841@xxxx> wrote:
> > > > > > > http://www.amibroker.com/library/formula.php?id=434
> > > > > > >
> > > > > > > I found this script which attempts to rank stocks, however
> > it fails if
> > > > > > > the number of tickers in the watchlist is greater than
BarCount.
> > > > > > >
> > > > > > > Is it possible to create an array with more elements than
> > barcount?  I
> > > > > > > cannot find a way to do that.
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Sam
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Please note that this group is for discussion between users
> > only.
> > > > > > >
> > > > > > > To get support from AmiBroker please send an e-mail
directly to
> > > > > > > SUPPORT {at} amibroker.com
> > > > > > >
> > > > > > > For other support material please check also:
> > > > > > > http://www.amibroker.com/support.html
> > > > > > >
> > > > > > >
> > > > > > > Yahoo! Groups Links
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Cheers
> > > > > > Graham
> > > > > > AB-Write >< Professional AFL Writing Service
> > > > > > Yes, I write AFL code to your requirements
> > > > > > http://e-wire.net.au/~eb_kavan/ab_write.htm
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Please note that this group is for discussion between users
only.
> > > > >
> > > > > To get support from AmiBroker please send an e-mail directly to
> > > > > SUPPORT {at} amibroker.com
> > > > >
> > > > > For other support material please check also:
> > > > > http://www.amibroker.com/support.html
> > > > >
> > > > >
> > > > > Yahoo! Groups Links
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Cheers
> > > > Graham
> > > > AB-Write >< Professional AFL Writing Service
> > > > Yes, I write AFL code to your requirements
> > > > http://e-wire.net.au/~eb_kavan/ab_write.htm
> > > >
> > > >
> > > >
> > > > Please note that this group is for discussion between users only.
> > > >
> > > > To get support from AmiBroker please send an e-mail directly to
> > > > SUPPORT {at} amibroker.com
> > > >
> > > > For other support material please check also:
> > > > http://www.amibroker.com/support.html
> > > >
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Janeczko for President!
> > 
> > 
> > 
> > 
> > 
> > Please note that this group is for discussion between users only.
> > 
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> > 
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> > 
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Janeczko for President!




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Help Sudanese refugees rebuild their lives through GlobalGiving.
http://us.click.yahoo.com/hjNroD/EbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/