PureBytes Links
Trading Reference Links
|
Hi Herman, thanks for trying. What Terry istrying
to do is actually append a section of code containing AFL functions to a prior
line of code. The code to be appended is:
Min(Ref(L,-3) +3*
LinRegSlope(L, 5)
and as you can see, this
would be easier done in AFL but I don't know how to call the LinRegSlope()
function from VBScript. Also, the "3" in "Min(ref(L,3) etc" needs to be
incremented. In earlier e-mails there was a "work-around" for loops done
in AFL but I cannot find them (tried searching Yahoo and got every e-mail ever
written). So, it boils down to being able to do a loop in AFL or coding
the AFL function in VBScript but again, I don't know the formula for LinRegSlope
so am stopped both ways. If I remember correctly, AFL functions can be
called from "objects" in VBScript but that will take some more reading to verify
and learn how to do it. Kind of an interesting problem and an important
'next step' for me. Let us know if you have any further thoughts on
it.
Best Regards -
loul
<FONT
face="Courier New">---------------------
<BLOCKQUOTE
>
>>...Perhaps some kind
soul will take pity on a couple of flounderingmud-fish with advice on"for
next loops" and or function calls fromVBscript...>>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 dobasic looping in several examples. Search for:AFL
Scripting HostIt may look complicated at first. The best way to get
started is to copy anexample, test it out and then change ONE small line
at a time. Testingwhether everything still works as you go along. It is
just amazing what youcan "program" without knowing how to program :-)all
it takes is somepatience.Looping IS THE THING to know and the
sooner you learn it the better. It willremove many of the stumbling blocks
that are repeatedly discussed on thislist.Take care and good
luck,Herman.-----Original Message-----From: Lou Howard
[mailto:loul@xxxx]Sent: Saturday, April 27, 2002 7:40 PMTo:
amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker] Re: opt
thisTerry, have you heard the expression "Open mouth and insert
foot"? Well, Ijust did it. I thought I'd write you a short
code and solve all yourproblems but the problem is, it is not
practicable. The lines of code youhave 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 butwhen 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 thesubject at
AmiBroker. Perhaps some kind soul will take pity on a couple
offloundering mud-fish with advice on "for next loops" and or function
callsfrom VBscript. If I recall correctly, the function calls must
come from orto an "object" but I haven't gotten to that yet. I was
just thinking, thereare some pretty bright people on this forum, how does
TJ stay ahead of allof 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 thatthe
'lines of code' in incremented by the 'input variable', i.e.,2,3,4,
etc. This sounds like a loop that can be executed fromVBscript using
the variable as both a counter and insertion into theformula. Does
this sound right?Your use of Yahoo! Groups is subject to the
Yahoo! Terms of Service.Your use of Yahoo! Groups is
subject to the Yahoo! Termsof
Service.
|