Page 1 of 3

Mogalef Bands

PostPosted: Mon May 23, 2011 5:00 pm
by Apprentice
Mogalef.png

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
(4.33 KiB) Downloaded 1453 times


The indicator was revised and updated

Re: Mogalef Bands

PostPosted: Tue May 24, 2011 3:02 am
by Terminus
Hello Apprentice,

thank you for your reply.
But to see your attachment picture this is not the same.
Look my attachment and you can have informations about this indicator here :
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"


Re: Mogalef Bands

PostPosted: Tue May 24, 2011 5:05 am
by Apprentice
Thanks for the warning.
Corrected.

Re: Mogalef Bands

PostPosted: Tue May 24, 2011 7:43 am
by Terminus
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

Re: Mogalef Bands

PostPosted: Tue May 24, 2011 8:41 am
by Apprentice
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.

Re: Mogalef Bands

PostPosted: Tue May 24, 2011 10:08 am
by Terminus
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");



Re: Mogalef Bands

PostPosted: Tue May 24, 2011 10:17 am
by Terminus
POST SCRIPTUM : this the code for FutureStation Nano WHSelfinvest

Re: Mogalef Bands

PostPosted: Tue May 24, 2011 8:31 pm
by Blackcat2
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

Re: Mogalef Bands

PostPosted: Wed May 25, 2011 3:45 am
by Apprentice
Line Style Option Added.

Re: Mogalef Bands

PostPosted: Wed May 25, 2011 8:55 am
by Terminus
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 ?
Tanks for your answer.