PureBytes Links
Trading Reference Links
|
I should have added a speed up to the bottom of the For loop like
this ...
for (VarNo = 0; VarNo < BarCount; VarNo++)
{
VarName = "Var" + NumToStr(VarNo, 1.0);
VarArray[VarNo] = StaticVarGet(VarName);
if (IsEmpty(VarArray[VarNo]))
VarNo = BarCount;
}
--- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@xxx> wrote:
>
> IO uses techniques like the one you are looking for ...
>
> Change the WL number in the first line to a WL you have symbols
in.
>
> You can demonstrate this works by clicking Explore ... Notice that
> the same list of Random Numbers is returned for each symbol
>
> Different Variable Names in this case Var0, Var1 ... VarN are set
for
> each incoming piece of information but only when the first symbol
in
> the WL is being processed. They are retrieved and stored in an
array
> for for every symbol processed.
>
> I'll leave it to you to remove the random number generation and add
> the appropriate file i/o prior to, in and following the while
loop.
>
> List = CategoryGetSymbols(categoryWatchlist, 11);
>
> if (Name() == StrLeft(List, StrLen(Name())))
> {
> VarNo = 0;
> while (VarNo < 10)
> {
> Rand = Random();
> VarName = "Var" + NumToStr(VarNo, 1.0);
> StaticVarSet(VarName, Rand[0]);
> VarNo++;
> }
> }
>
> for (VarNo = 0; VarNo < BarCount; VarNo++)
> {
> VarName = "Var" + NumToStr(VarNo, 1.0);
> VarArray[VarNo] = StaticVarGet(VarName);
> }
>
> Filter = VarArray >= 0;
>
> AddColumn(BarIndex(), "BI", 1.0);
> AddColumn(VarArray, "Var Array", 1.9);
>
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@> wrote:
> >
> > Bruce
> >
> > Thanks for the response.
> >
> > After reading it, something seemed missing, so I read my initial
> question.
> >
> > To restate the issue, the program works but takes far too long
> because of
> > the repeated disk read operations.
> >
> > I realize now my point was not stated clearly.
> >
> > My reason for desiring Static arrays is that I would have to read
> the disk
> > info only once and save it in the Static Array. This should save
a
> lot of
> > time.
> >
> > Appreciate any further comments
> >
> > Ara
> >
> >
> > ----- Original Message -----
> > From: "bruce1r" <brucer@>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Saturday, June 23, 2007 8:46 AM
> > Subject: [amibroker] Re: VBScript / Jscript
> >
> >
> > > Ara -
> > >
> > > I only check in here occasionally, but found your question, and
it
> > > relates to some things that I've done in the past, so I'll try
to
> > > share what I found.
> > >
> > > Bottom line - ATC's are roughly as fast as any alternate,
> > > off-the-shelf solution since they operate out of the ticker
memory
> > > cache - just a little messier if you have you are managing a
large
> > > number of results.
> > >
> > > ATC addresses the main problem in an WL explore, though,
because
> it
> > > performs array truncation and alignment. That issue is this -
as
> each
> > > ticker is looped through, a new default array length with entry
> dates
> > > is defined. This applies to all arrays created in that pass.
For
> > > example, if you had a WL of two tickers - say the RUT-I and
UCPIX
> in
> > > the FT database, the default array would have a start date of
> 9/1/88
> > > for the RUT-I and a start date of 1/29/04 for UCPIX. SO if you
> could
> > > create a static indicator array for the SP-CP ticker and then
> tried to
> > > read it when the UCPIX ticker was executed - it would be too
long
> and
> > > start at the wrong date. ATC's and Foreign's truncate if
> necessary
> > > and align dates. The alignment is even more important if you
mix
> data
> > > from foreign markets that have different market dates and
> holidays.
> > >
> > > If you're still convinced that you need a way to do static
arrays
> and
> > > are willing to use modified settings, let me know and I'll find
> some
> > > time later to write it up.
> > >
> > > -- Bruce R.
> > >
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@>
wrote:
> > >>
> > >> One my issues with Amibroker is the lack of static arrays ...
I
> know
> > > it's coming, but ... I have a backtest that uses sector data
> stored in
> > > ATCs.
> > >>
> > >> Question I have:
> > >>
> > >> If I use jscript or VB script, can I do something like this
> (below)
> > > so that once I define arrays, they stay defined?
> > >>
> > >> Code below to be called only once using #include_once command
> > >>
> > >> Start script
> > >> Declare arrays
> > >> Read disk
> > >> Assign info from disk read to script arrays
> > >>
> > >> continue with rest of code
> > >> call arrays from memory when needed
> > >>
> > >>
> > >> The intent is to avoid reading disk for every symbol I process
> > > during backtest
> > >>
> > >> TIA
> > >>
> > >> Ara
> > >>
> > >
> > >
> > >
> > >
> > > 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 NEW RELEASE ANNOUNCEMENTS and other news always check
DEVLOG:
> > > http://www.amibroker.com/devlog/
> > >
> > > For other support material please check also:
> > > http://www.amibroker.com/support.html
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> >
>
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|