Mike,
you seem to know your onions... While I'm here can I ask you another
question...
Can you clear up for me exactly 'how' AFL executes it's code...
When I say 'how', this is what I mean. Coming from C# world, it's
pretty clear that trading type software tends to work on a bar by bar
basis... i.e. you have an event driven call, of the like,
OnNewBar()... in that event call you place the code that you want
executed on each bar...
It's not clear to me 'how' AFL is called. If I'm applying an
indicator, how many times is that indicator code called...??
The reason I ask is, generally the way AFL works with arrays seems
very efficient... until perhaps you start having to loop through
arrays as part of your code... for example,
for(i=1;i<BarCount;i++)
{
Value9[i]=IIf(Value7[i]!=Value8[i],((Value6[i]-Value8[i])/(Value7[i]-Value8[i])-0.5)+0.5*Value9[i-1],Value9[i]);
Value9[i]=IIf(Value9[i]>0.9999,0.9999,Value9[i]);
Value9[i]=IIf(Value9[i]<-0.9999,-0.9999,Value9[i]);
Value10[i]=IIf(Value9[i]!=1,0.25*log((1+Value9[i])/(1-Value9[i]))+0.5*Value10[i-1],Value10[i]);
}
I have recently added this code to one of my indicators and it does
seem very slow when scrolling through graphs. Perhaps my code is
inefficient...??
I'm running a beast of a machine here, so speed should not be an issue.
If I can understand 'how' AFL excutes... it might help me understand
bottlenecks.
Many Thanks
--- In [email protected], "Mike" <[EMAIL PROTECTED]> wrote:
>
> Nope, you're not alone.
>
> The topic pops up, in one form or another, every couple of weeks or
> so. Sounds like you understand the concept now.
>
> Good luck.
>
> Mike
>
> --- In [email protected], "sidhartha70" <sidhartha70@>
> wrote:
> >
> > Thanks Mike.
> >
> > So it seems I'm not the only one coming from more 'traditional'
> > languages to struggle with this concept.
> >
> > The bottom line it seems is that you cannot recursively alter the
> > value of any array by referencing other values of that array... at
> > least not directly.
> >
> >
> > --- In [email protected], "Mike" <sfclimbers@> wrote:
> > >
> > > Read thread #122034 for a similar discussion, including
> explanation.
> > >
> > > Mike
> > >
> > > --- In [email protected], "sidhartha70" <sidhartha70@>
> > > wrote:
> > > >
> > > > Hi All,
> > > >
> > > > Can someone clear this up for me... I am simply trying to
> cumulate
> > > the
> > > > value of an array. My intial thoughts were to do something like
> the
> > > > following,
> > > >
> > > > Value1=0;
> > > > Value2=log(Close);
> > > > Value1=Ref(Value1,-1)+Value2;
> > > >
> > > > However, that doesn't seem to work... So I've ended up with,
> > > >
> > > > Value2=log(Close);
> > > > Value1=Cum(Value2);
> > > >
> > > > Which does seem to work. I can't see why the first doesn't.
> > > >
> > > > Can anyone explain...? Thanks
> > > >
> > >
> >
>