Fibonacci Bands

jlmalhotra

Active Member
#2
Can anyone help me convert this to Metastock




// Bollinger Fibonacci Bands - Beachie41 26/11/04 //
/* as used in the VT trading platform -
see outline of FX trading system by mezarashii on
Moneytec http://www.moneytec.com/forums/_showthread/_threadid-11630/_s-
*/
GraphXSpace = 3;
per = Param("Period",20,10,55,1);
TH =IIf(Ref(C,-1) > H,Ref(C,-1),H);

TL=IIf(Ref(C,-1) < L,Ref(C,-1),L);
TR = TH-TL;
TRa= Wilders(TR,per);
UpperBand3 =MA( C, per) + ( 4.2360 * TRa);
UpperBand2=MA( C, per) + ( 2.6180 * TRa);
UpperBand1=MA( C, per) + ( 1.6180 * TRa);

MidPoint=MA(C, per);

LowerBand1=MA( C, per) - ( 1.6180 * TRa);
LowerBand2=MA( C, per) - ( 2.6180 * TRa);
LowerBand3=MA( C, per) - ( 4.2360 * TRa);


Plot(MidPoint,"",colorGreen,4);
Plot(UpperBand1,"",colorRed,1);
Plot(LowerBand1,"",colorRed,1);
Plot(UpperBand2,"",colorAqua,1);
Plot(LowerBand2,"",colorAqua,1);
Plot(UpperBand3,"",colorYellow,1);
Plot(LowerBand3,"",colorYellow,1);



PlotOHLC(O,H,L,C,"",colorWhite,64);
 

AJAY

Active Member
#3
Hi Malhotra,
In case you want this fib. bands for a 20 period exponential moving average,

Mov(C,20,E)*(1+.01618) for upper band
Mov(C,20,E)*(1-.01618) for lower band

you may build the bands for other fib levels in the similar fashion and you may choose the moving average periodicity as you wish by replacing the number 20 as I took 20 in this case only as an example.

If this needs any further improvement, please post with some clear example.

Happy practicing technicals

Ajayakumar
 

Similar threads