## Mogalef Bands

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

### Mogalef Bands

Median = LinearReg((Open+High+Low+(2*Close))/5);
Deviation = StandardDev(Median);

Top Band = Median + Multiplier*Deviation;
Bottom Band = Median -Multiplier*Deviation;

if Median[period]<Top[period-1] and Median[period] > Bottom[period-1] then
DEV[period]= DEV[period-1];
Top[period] = Top[period-1];
Bottom[period] =Bottom[period-1];
Median[period]= Median[period-1];
end
Mogalef.lua

The indicator was revised and updated

Apprentice
FXCodeBase: Confirmed User

Posts: 25428
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Mogalef Bands

Hello Apprentice,

But to see your attachment picture this is not the same.
http://www.mogalef.com

Recall of the code in pro Realtime language :

Code: Select all
`CP=(open+high+low+2*close)/5 F=LinearRegression[3](CP) E=std[7](F) if barindex<8 then Mediane = undefined BandeHaute = undefined BandeBasse = undefined Else BandeHaute = F+(E*2) BandeBasse = F-(E*2) if F<BandeHaute[1] and F>BandeBasse[1] then E=E[1] BandeHaute=BandeHaute[1] BandeBasse=BandeBasse[1] endif Mediane =(BandeHaute+BandeBasse)/2 Endif return BandeHaute coloured (255,154,51) as"Mogalef Bande Haute", Mediane coloured (102,0,204) as "Mogalef Mediane", BandeBasse coloured (0,204,255) as "Mogalef Bande Basse" `
Attachments
Terminus

Posts: 27
Joined: Thu May 19, 2011 1:54 pm

### Re: Mogalef Bands

Thanks for the warning.
Corrected.

Apprentice
FXCodeBase: Confirmed User

Posts: 25428
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Mogalef Bands

Thank you very much for you're reactivity.
It seems to be near Mogalef bands but without the same reactivity
the gap of the bands is later in you code than this of prorealtime code
Look the comparaison of the two graphics EURUSD in Daily
Attachments
Terminus

Posts: 27
Joined: Thu May 19, 2011 1:54 pm

### Re: Mogalef Bands

The problem is that I got Partial and three of four different formulas for this indicator.
So I'm not sure that it the right one.

Apprentice
FXCodeBase: Confirmed User

Posts: 25428
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Mogalef Bands

ok , i understand you because the divulgation of this code is very recent.
I know that the ProRealtime code i give you has been validate by Eric Lefort (one of the the authors)

Maby the problem is her (traduction):
"C'est bien la régression linéaire du cours pondéré qui est prise en compte dans la cassure des bandes, et non pas le cours pondéré lui-même. "
"It is good the linear regression of the balanced course(price) which is taken into account in the break of bands(strips), and not the balanced course(price) itself. "

if t-you speak french you have a lot of informations in the web site www/.pro-at.com
you

HERE i find the code by the autor (Reference version for free distribution):
Code: Select all
`express MOGALEFBands // Version de référence pour diffusion gratuite vars input \$N(2,10,3),\$ET(5,15,7); series MogH,MogB,MogM,etyp; series xx,yy,zz,e,mm; numeric i,SumXY,SumX2,SumY,SumX,a,b; series X,Y,Z,MogRegLin,CoursP; calculation // Calcul du cours pondéré Mogalef CoursP = ((h+l+o+c+c)/5); // Fin du calcul // on calcule la régression linéaire---------------------------------------- for i = 0 to \$N-1 begin X = i; Y = CoursP; SumX = SumX + X; SumX2 = SumX2 + Power(X,2); SumXY = SumXY + X*Y; SumY = SumY + Y; end b = (SumXY - SumX*SumY/\$N)/(SumX2 - (1/\$N)*Power(SumX,2)); a = (SumY - b*SumX)/\$N; Z = a + b*X[0]; SumX = 0; SumX2 = 0; SumXY = 0; SumY = 0; if Z = void then // Si rég lin pas définie MogRegLin = Close; else MogRegLin = Z; // Fin régression linéaire--------------------------------- // Calcul des bandes Mogalef------------------------------------------------ // Reprise des niveaux Mogalef précédents. StdDev(MogRegLin,etyp,\$ET); //calcul écart type de longueur ET xx=MogH[1]; yy=MogB[1]; e=etyp[1]; zz=Z[1]; mm=MogM[1]; // Pas de décalage si la RegLine est à l'intérieur des anciennes bandes If ((MogRegLin < xx) and (MogRegLin >yy)) then begin etyp=e; MogH=xx; MogB=yy; MogM=mm; end else //Si décalage tracé des nouvelles bandes begin MogH= (MogRegLin + (etyp*2)); MogB= (MogRegLin - (etyp*2)); MogM= MogRegLin; end // Fin calcul bandes Mogalef--------------------------------------- interpretation begin end // Affichage plot (MogH,Yellow,2); plot (MogB, cyan,2); plot (MogM,blue,1); plotband (MogH,"Yellow",2,MogM,"blue",1,"lightgreen"); plotband (MogM,"Blue",1,MogB,"cyan",2,"lightred"); `
Terminus

Posts: 27
Joined: Thu May 19, 2011 1:54 pm

### Re: Mogalef Bands

POST SCRIPTUM : this the code for FutureStation Nano WHSelfinvest
Terminus

Posts: 27
Joined: Thu May 19, 2011 1:54 pm

### Re: Mogalef Bands

This is an interesting indicator... I'm currently testing this..

How many % identical compared to the original / intended code?

Can I please have the option to change line width and style?

Thanks..
BC
Blackcat2
FXCodeBase: Initiate

Posts: 118
Joined: Wed May 19, 2010 12:42 am

### Re: Mogalef Bands

Apprentice
FXCodeBase: Confirmed User

Posts: 25428
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Mogalef Bands

Hello Aprentice,

have you seen my new post with the code source based of the author for the mogalef Bands?
Are you understand it .(FutureStation Nano WHSelfinvest language)
Is it different of the proRealtime version who had problem with a candle delay ?