Parts 1) & 2)
n = 0.3 //approx. 4 point swing on ES
fibs = [-.62 -.27 0 .38 .5 .62 1 1.27 1.62]; //symmetric
for(i=1;i=10;i++)
{
PeakCondition=PeakBars(H,n)==0;
p[i] = ValueWhen(PeakCondition,H,i);
p[i] = IIf(p[i] >= HHV(p,i),p[i],0); //set to zero if not HH
TroughCondition=TroughBars(L,n)==0;
t[i] = ValueWhen(TroughCondition,L,i);
t[i] = IIf(t[i] <= LLV(t,i),t[i],0); //set to zero if not LL
for(j=1;j=10;j++)
{
for(k=1;k=9;k++)
{
array = t[i] + fibs[k] * (p[j] - t[i]); // calc fib levels
}}}
I'm unsure of the last line - how to assign the fib levels to an array for
sorting. Thanks in advance for any help.
Kevin
--- In [email protected], "kevinoversby" <kevinover...@...> wrote:
>
> I have not found an AFL implementation of this so decided to develop my own.
> I'm doing it here as there are a couple of coding issues I'm unsure of.
> Constructive comments and tips most welcome.
>
> Process:
>
> 1) Find i last higher peaks and j last lower troughs
> 2) For each peak/trough pair, calculate fib levels and add to array
> 3) Sort array
> 4) Discard a level if distance to next level > tolerance
> 5) Plot remaining levels, preferably at left or right edge like volume at
> price (VAP) to simplify chart.
>
> (A thought just occurred that this would also be a useful exercise with VAP
> levels - investigate later).
>
>
> Kevin
>