PureBytes Links
Trading Reference Links
|
David, the previous example of the Ergodic code was set at crossover
signals as default - you've probably plotted it on a chart with either
insufficient data and/or no available signals.
Try the original indicator code below:
=======
Ergodic
=======
---8<---------------------------
{ William Blau's Ergodic indicator v2.0 }
{ Incorporating auto overbought/sold levels,
and Ergodic/Signal line crossover signals }
{ With thanks to William Schamp at:
ProfLogic@xxxxxxxxxxxxx }
{ ©Copyright 2004~2005 Jose Silva
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }
{ User inputs }
choose:=Input("Version: [1]Basic, [2]Proflogic's Ensign",1,2,2);
pds1:=Input("Proflogic's Ensign orig: EMApds 28, SmoothPds 84",0,0,0);
pds1:=Input("EMA periods",1,252,21);
pds2:=Input("Smoothing periods",1,252,5);
pds3:=Input("Signal periods",1,252,10);
plot:=Input("[1]Ergodic, [2]Histogram, [3]Crossover Signals",1,3,1);
{ Ergodic }
x:=Mov(Mov(H-L,pds1,E),pds2,E);
x:=If(x>0,x,.000001);
ergo1:=(Mov(Mov(C-O,pds1,E),pds2,E)/x)*100;
{ Proflogic's Ensign Ergodic version:
EMA periods = 28, Smoothing periods = 84 }
ergo2:=
Mov(Mov(Mov(C-Ref(C,-1),pds1,W),pds2,W),pds1,W)
/Mov(Mov(Mov(Abs(C-Ref(C,-1)),pds1,W),pds2,W),
pds1,W)*100;
{ Selected Ergodic version }
ergodic:=If(choose=1,ergo1,ergo2);
{ Ergodic signal & histogram }
signal:=Mov(ergodic,pds3,E);
ergoPlot:=If(plot=1,ergodic,ergodic-signal);
{ Ergodic/Signal crossovers }
long:=Cross(ergodic,signal);
short:=Cross(signal,ergodic);
{ Average (zero-line) }
ergoPlotAvg:=
Cum(ergoPlot)/Cum(IsDefined(ergoPlot));
{ Auto overbought/sold boundaries }
Pk:=Ref(ergoPlot,-1)=HHV(ergoPlot,3)
AND Ref(ergoPlot,-1)>ergoPlotAvg;
PkVal:=ValueWhen(1,Pk,Ref(ergoPlot,-1));
Obought:=Cum(PkVal)/Cum(IsDefined(PkVal));
Tr:=Ref(ergoPlot,-1)=LLV(ergoPlot,3)
AND Ref(ergoPlot,-1)<ergoPlotAvg;
TrVal:=ValueWhen(1,Tr,Ref(ergoPlot,-1));
Osold:=Cum(TrVal)/Cum(IsDefined(TrVal));
{ Plot in own window }
If(plot=1,signal,If(plot=2,ergoPlotAvg,0));
If(plot=3,long-short,Obought);
If(plot=3,long-short,Osold);
If(plot=3,long-short,ergoPlot)
---8<---------------------------
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, "david castley" <drc1939@xxxx>
wrote:
> Jose - when I try copy and pasting the indicator I get a straight
> zero line. Am I doing something wrong? David
> ----- Original Message -----
> From: Jose
> To: equismetastock@xxxxxxxxxxxxxxx
> Sent: 28 February 2005 6:55 AM
> Subject: [EquisMetaStock Group] Re: Ergodic Theory
>
>
>
> Kevin, try this updated Ergodic indicator code:
>
> =======
> Ergodic
> =======
> ---8<---------------------------
>
> { William Blau's Ergodic indicator v2.0 }
> { Incorporating auto overbought/sold levels,
> and Ergodic/Signal line crossover signals }
> { With thanks to William Schamp at:
> ProfLogic@xxxx }
>
> { ©Copyright 2004~2005 Jose Silva
> The grant of this license is for personal use
> only - no resale or repackaging allowed.
> All code remains the property of Jose Silva.
> http://www.metastocktools.com }
>
> { User inputs }
> choose:=Input("Version: [1]Basic, [2]Proflogic's Ensign",1,2,2);
> pds1:=Input("Proflogic's Ensign orig: EMApds 28, SmoothPds 84",0,0,
0);
> pds1:=Input("EMA periods",1,252,21);
> pds2:=Input("Smoothing periods",1,252,5);
> pds3:=Input("Signal periods",1,252,10);
> plot:=Input("[1]Ergodic, [2]Histogram, [3]Crossover Signals",1,3,
3);
>
> { Ergodic }
> x:=Mov(Mov(H-L,pds1,E),pds2,E);
> x:=If(x>0,x,.000001);
> ergo1:=(Mov(Mov(C-O,pds1,E),pds2,E)/x)*100;
>
> { Proflogic's Ensign Ergodic version:
> EMA periods = 28, Smoothing periods = 84 }
> ergo2:=
> Mov(Mov(Mov(C-Ref(C,-1),pds1,W),pds2,W),pds1,W)
> /Mov(Mov(Mov(Abs(C-Ref(C,-1)),pds1,W),pds2,W),
> pds1,W)*100;
>
> { Selected Ergodic version }
> ergodic:=If(choose=1,ergo1,ergo2);
>
> { Ergodic signal & histogram }
> signal:=Mov(ergodic,pds3,E);
> ergoPlot:=If(plot=1,ergodic,ergodic-signal);
>
> { Ergodic/Signal crossovers }
> long:=Cross(ergodic,signal);
> short:=Cross(signal,ergodic);
>
> { Average (zero-line) }
> ergoPlotAvg:=
> Cum(ergoPlot)/Cum(IsDefined(ergoPlot));
>
> { Auto overbought/sold boundaries }
> Pk:=Ref(ergoPlot,-1)=HHV(ergoPlot,3)
> AND Ref(ergoPlot,-1)>ergoPlotAvg;
> PkVal:=ValueWhen(1,Pk,Ref(ergoPlot,-1));
> Obought:=Cum(PkVal)/Cum(IsDefined(PkVal));
> Tr:=Ref(ergoPlot,-1)=LLV(ergoPlot,3)
> AND Ref(ergoPlot,-1)<ergoPlotAvg;
> TrVal:=ValueWhen(1,Tr,Ref(ergoPlot,-1));
> Osold:=Cum(TrVal)/Cum(IsDefined(TrVal));
>
> { Plot in own window }
> If(plot=1,signal,If(plot=2,ergoPlotAvg,0));
> If(plot=3,long-short,Obought);
> If(plot=3,long-short,Osold);
> If(plot=3,long-short,ergoPlot)
>
> ---8<---------------------------
>
>
> To reference above Ergodic signals for an exploration:
>
> long:
> Fml("Ergodic")=1
>
> short:
> Fml("Ergodic")=-1
>
>
> jose '-)
> http://www.metastocktools.com
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "Kevin and Heather Howard"
> <kjhoward@xxxx> wrote:
> I have found the Ergodic discussion very useful and a
> big thanks to Jose for coding up this indicator for Metastock.
>
> At the risk of sounding extremely dumb, is it possible
> to modify Jose's code to capture the up cross over of the signal
> line by the EMA line (buy) and the down cross over of the signal
> line by the EMA line (Sell) as a separate indicator (latch) and/or
> exploration? That is 1 for former and zero for later? I have not
> been able to log onto trader online for several days, so if it is
> already there, my apologies.
>
> Thanks a lot.
>
> Kevin
>
>
> "A Society grows great when old men plant trees whose shade they
> know they will never sit in."
>
>
> -----Original Message-----
> From: murusprimus [mailto:no_reply@xxxxxxxxxxxxxxx]
> Sent: Sunday, 27 February 2005 1:43 AM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: [EquisMetaStock Group] re: Ergodic Theory
>
> From someone called 'Jose':
> http://www.metastocktools.com/MetaStock/Ergodic.txt
>
> and:
> http://trader.online.pl/MSZ/e-w-ECO-
> ergodic_Candlestick_Oscillator.html
>
> Wallace.
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|