MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Ergodic Indicator by William Blau
 


Ergodic Indicator

{ 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@earthlink.net }

{ (C)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)

 

 

More at: "Momentum, Direction, and Divergence", Author: William Blau, Published: March 1995, ISBN: 0471027294

Source / From: TOP

http://www.metastocktools.com/

 


Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!