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.

Moderator: admin

Mogalef Bands

Postby Apprentice » Mon May 23, 2011 5:00 pm

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 1835 times


The indicator was revised and updated
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Mogalef Bands

Postby Terminus » Tue May 24, 2011 3:02 am

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"

Attachments
cac-Mogalef.png
Terminus
 
Posts: 27
Joined: Thu May 19, 2011 1:54 pm

Re: Mogalef Bands

Postby Apprentice » Tue May 24, 2011 5:05 am

Thanks for the warning.
Corrected.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Mogalef Bands

Postby Terminus » Tue May 24, 2011 7:43 am

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
Prorealtime-TS2.png
Terminus
 
Posts: 27
Joined: Thu May 19, 2011 1:54 pm

Re: Mogalef Bands

Postby Apprentice » Tue May 24, 2011 8:41 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Mogalef Bands

Postby Terminus » Tue May 24, 2011 10:08 am

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

Postby Terminus » Tue May 24, 2011 10:17 am

POST SCRIPTUM : this the code for FutureStation Nano WHSelfinvest
Terminus
 
Posts: 27
Joined: Thu May 19, 2011 1:54 pm

Re: Mogalef Bands

Postby Blackcat2 » Tue May 24, 2011 8:31 pm

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

Postby Apprentice » Wed May 25, 2011 3:45 am

Line Style Option Added.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Mogalef Bands

Postby Terminus » Wed May 25, 2011 8:55 am

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.
Terminus
 
Posts: 27
Joined: Thu May 19, 2011 1:54 pm

Next

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 55 guests