Thanks Jules. Very informative.

"This is why you should always try and use the built in functions and array 
arithmetic operators where possible."

Or indeed code any looping structures that can't be avoided in AFL and are 
called regularly in C++ as a DLL.

--- In [email protected], "jooleanlogic" <joole...@...> wrote:
>
> For loops and array access, yes there is a significant speed difference in C.
> 
> Just think of it this way Sid,
> your afl loop in a dll will take about as long as any other inbuilt afl 
> function does.
> If an MA call on your machine takes a few milliseconds, then that's roughly 
> as long as your afl loop in a dll will take, depending of course on what 
> you're doing in that loop.
> 
> To give you an idea, on my computer, the following simple afl code takes 
> about 200ms on half a million bars. The equivalent Cum(1) call takes about 
> 5ms.
> 
> mycum = 0;
> for (bar=1; bar<BarCount; bar++){
>       mycum[bar] = mycum[bar-1] + 1;
> }
> 
> Going by the Amibroker profiler, it's roughly 100ms for the loop itself and 
> 40-50ms for each array access. In C, the loop itself is virtually a non event 
> of a few milliseconds, freeing up a couple of hundred ms for your actual code 
> inside the loop.
> This is why you should always try and use the built in functions and array 
> arithmetic operators where possible.
> 
> Jules.
> 
> 
> --- In [email protected], "Rob" <sidhartha70@> wrote:
> >
> > Hi,
> > 
> > Sorry if this is a silly question... but having come a long way with AFL 
> > and feeling like I can do pretty much everything I need to within AFL, I am 
> > now wondering about the use of JScipt/VBScript and DLL's...
> > 
> > In what circumstances would one use JScipt/VBScript or write a custom 
> > DLL...? What are the advantages to their use...?
> > 
> > If someone would be kind enough to just give me a brief outline I'd 
> > appreciate it...
> > 
> > TIA
> >
>


Reply via email to