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

RE: [amibroker] Re: opt this



PureBytes Links

Trading Reference Links

>>...Perhaps some kind soul will take pity on a couple of floundering
mud-fish with advice on "for next loops" and or function calls from
VBscript...>>

In it's simplest form:

// example in VBScript
<%
myArray = AFL("close")
sum = 0for i = 0 to UBound( myArray )
sum = sum + myArray( i )
next
%>

There is a nice section in the AB help on this, it will show you how to do
basic looping in several examples. Search for: AFL Scripting Host

It may look complicated at first. The best way to get started is to copy an
example, test it out and then change ONE small line at a time. Testing
whether everything still works as you go along. It is just amazing what you
can "program" without knowing how to program :-) all it takes is some
patience.

Looping IS THE THING to know and the sooner you learn it the better. It will
remove many of the stumbling blocks that are repeatedly discussed on this
list.

Take care and good luck,
Herman.

-----Original Message-----
From: Lou Howard [mailto:loul@x...]
Sent: Saturday, April 27, 2002 7:40 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: opt this


Terry, have you heard the expression "Open mouth and insert foot"? Well, I
just did it. I thought I'd write you a short code and solve all your
problems but the problem is, it is not practicable. The lines of code you
have use AFL functions which I haven't learned to handle from VBscript yet
(I understand that they can if one knows how). The alternative is to do
'for next loops' in AFL. There is a work-around that was in the e-mails but
when I searched Yahoo, I got every e-mail that has been written.
(apparently a lot of "for's" and "next's"). Also found nothing on the
subject at AmiBroker. Perhaps some kind soul will take pity on a couple of
floundering mud-fish with advice on "for next loops" and or function calls
from VBscript. If I recall correctly, the function calls must come from or
to an "object" but I haven't gotten to that yet. I was just thinking, there
are some pretty bright people on this forum, how does TJ stay ahead of all
of them? Will work on it as soon as I get a little more time.

loul

---------------------------------------------------------



Lou, I don't know anything about VBscript. Thanks, Terry

--- In amibroker@xxxx, "Lou Howard" <loul@xxxx> wrote:
> Hi Terry -
> Well, I'm just starting out in this stuff but it seems that
the 'lines of code' in incremented by the 'input variable', i.e.,
2,3,4, etc. This sounds like a loop that can be executed from
VBscript using the variable as both a counter and insertion into the
formula. Does this sound right?


Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.