# basic afl coding question : applying channels to a MA

#### choubix

##### New Member
Hi there,

I just bought a license a couple of weeks back and I am now toying with AFL.

I would like to code a MA with Fibonacci channels.
The idea is to plot the MA and use the bands created by the Fibonacci numbers as support/resistance.

This is my code but when applied to any currency pairs, the bands are wayyyyy too far to be of any use. Am I doing anything wrong?

thanks

_SECTION_BEGIN("FIBONACCI-ed MA");

//Per = Param("Period", 21, 10, 55,1);

Per = 21;

r1 = C * 1.236;
r2 = C * 1.382;
s1 = C * (1-0.236);
s2 = C * (1-0.382);

MAr1 = MA(r1, Per);
MAr2 = MA(r2, Per);
MAs1 = MA(s1, Per);
MAs2 = MA(s2, Per);

MidPoint=MA(C, Per);

Plot(MidPoint,"",colorGreen,4);
Plot(MAr1,"",colorRed,1);
Plot(MAs1,"",colorRed,1);
Plot(MAr2,"",colorAqua,1);
Plot(MAs2,"",colorAqua,1);

_SECTION_END();

#### choubix

##### New Member
Hmmm... I think my code is conceptually wrong... Fibo uses High and Lows ...
I think I need to dig a little bit more before applying a simple % on top of a MA

If anyone has a code that looks like what I am trying to do, would be nice to share
Thanks!