AFL development : Ergodic Oscillator

#1
Dear Trader Friends,

This is new indicator and may be helpful to all of us, so we need to develop the AFL for this. This indicator is available in trading software of Ensign Software.

The detail information about this is attached in text document.
also some screenshots are uploaded on rapidshare because of the attachment limit here is the link
Your Download-Link #1: http://rapidshare.de/files/46388860/ScreenshotsERG.rar.html


I request Casoni brother and The Saint to develop this AFL for all members.:thumb:
 
#2
Also little help.
I have AFL of Force Index , its a indicator developed Dr Alexander Elder.
I want to modify this AFL for better visulisation.
Below 0 i.e. for -ve values i like to fill the area between zero line and FI with red and vice versa Green i.e. above 0 line and +ve values for Force Index;
The AFL code is here:
******
_SECTION_BEGIN("Force index");
FI=EMA(((C-Ref(C,-1))*V),13);


Plot(FI,"FI",12,5);
Plot(0,"ZERO LINE",colorWhite,styleThick);
_SECTION_END();
******
 

kenneth

Well-Known Member
#3
_SECTION_BEGIN("Ergodic Candle Oscillator");
// from "Momentum, Direction and Divergence" by William Blau

// John Wiley & Sons



function Ergodic_CSI(f1)

{

Cmtm = Close - Open; //Candlestick momentum



NUM = EMA(EMA(Cmtm,f1),5);

DEN = EMA(EMA((H-L),f1),5);



return (NUM / DEN) * 100;

}





f1 = Param("EMA 1",3,1,1000,1);

f2 = Param("Signal",5,1,100,1);



Plot( Ergodic_CSI(f1) ,"ErgodicCSI("+f1+",5)",colorDarkGreen,styleLine);

Plot(EMA(Ergodic_CSI(f1),f2),"Signal Line ("+f2+")",colorRed,styleLine);



PlotGrid(0,colorWhite);

_SECTION_END();
 
#4
_SECTION_BEGIN("Ergodic Candle Oscillator");
// from "Momentum, Direction and Divergence" by William Blau

// John Wiley & Sons



function Ergodic_CSI(f1)

{

Cmtm = Close - Open; //Candlestick momentum



NUM = EMA(EMA(Cmtm,f1),5);

DEN = EMA(EMA((H-L),f1),5);



return (NUM / DEN) * 100;

}





f1 = Param("EMA 1",3,1,1000,1);

f2 = Param("Signal",5,1,100,1);



Plot( Ergodic_CSI(f1) ,"ErgodicCSI("+f1+",5)",colorDarkGreen,styleLine);

Plot(EMA(Ergodic_CSI(f1),f2),"Signal Line ("+f2+")",colorRed,styleLine);



PlotGrid(0,colorWhite);

_SECTION_END();
Dear friend

pl, find following attach doc, you will find error so,pl, rectify.

Thanks

Pra
 

kenneth

Well-Known Member
#5
Prs,

sorry to note that you have not copied the afl properly. I find the following lines are missing
_SECTION_BEGIN("Ergodic Candle Oscillator");
// from "Momentum, Direction and Divergence" by William Blau

// John Wiley & Sons



function Ergodic_CSI(f1)

{

Copy the entire afl and I am sure will work

Regards
ken
 
#6
Dear friend

i have ami5.1 & attached the afl which i have copied but problem is same as stated above. pl, check this afl & reply me. Thanks for your great service.
 

kenneth

Well-Known Member
#7
pra

Afl is ok and should work. If not go the the edit and press the analysis button if there is problem the line will be highted see at teh bottom comment and see the problem and rectify

Regadrs
ken
 
#8
Pra,
The error is

Plot( Ergodic_CSI(f1) ,"ErgodicCSI("+f1+",5)",colorDarkGreen,styleLin e);

The error is the last word "styleline" ,where the word appears as stylelin E);

Copythe line as given below & paste it there or remove the space before "e" letter

Plot( Ergodic_CSI(f1) ,"ErgodicCSI("+f1+",5)",colorDarkGreen,styleLine);
 
#9
Thanx to both of u buddies. But I not feeling satisfied. Please somebody cross check the AFL with the formulas and screenshots::)

Formulas Used to Calculate the Ergodic Oscillator
True Strength Indicator (TSI) a True Momentum Indicator
TSI(close,r,s) = (100)*EMA{EMA[mtm,r],s} / EMA(EMA{|mtm|,r},s)

Numerator
mtm = close [today] close [yesterday]
(one-day momentum)
EMA(mtm,r) = r-day EMA of the momentum
EMA(EMA(mtm, r),s) = s-day EMA of the EMA(mtm,r)
(double smoothing of momentum)

Denominator
mtm = close [today] close [yesterday]
(one-day momentum)
EMA(mtm,r) = r-day EMA of the momentum
EMA(EMA(mtm, r),s) = s-day EMA of the EMA(mtm,r)
(double smoothing of the absolute value of momentum)

Ergodic Oscillator
Ergodic (close, r) = TSI (close, r, 5)
Signal Line (close, r) = EMA[TSI(Close, r,5),5]



Please look at the screenshots.
 
#10
I am not a programmer . I have found following AFL for ergodic oscilator & TSI in net. Pl, copy & paste.


// Blau: TSI & Ergodic Oscillator

Len_r = Param( "TSI period 'r':", 32 , 1 , 100 );
Len_s = Param( "TSI period 's':", 5 , 1 , 100 );
Len_5 = 5 ;

Mtm = C - Ref ( C, -1 );
AbsMtm = abs ( Mtm );
//===============================
Num_T = EMA ( EMA ( Mtm, Len_r ), Len_s );
Den_T = EMA ( EMA ( AbsMtm, Len_r ), Len_s );

TSI = 100 * Nz ( Num_T / Den_T );
//===============================
Num_E = EMA ( EMA ( Mtm, Len_r ), Len_5 );
Den_E = EMA ( EMA ( AbsMtm, Len_r ), Len_5 );

Ergodic = 100 * Nz ( Num_E / Den_E );
SigLin = EMA ( Ergodic, Len_5 );
//===============================
GraphXSpace = 2 ;
//Plot( TSI, "TSI", colorGreen, styleLine );
ErgCol = colorBlue ;
Plot( Ergodic, "Ergodic Osc.", ErgCol, styleLine
);
Plot( SigLin, "", colorDarkYellow, styleLine );
//===============================
Hist = Ergodic - SigLin;
HistCol = IIf ( Hist>= 0, colorGreen, colorRed );
Plot(Hist, "Histogram", HistCol, styleHistogram |
styleThick |
styleNoLabel );
//===============================
Title = EncodeColor( colorDarkBlue ) + FullName() +
" [" + Name() + "]
" +
EncodeColor( colorDarkGrey ) + WriteVal( DateTime(),
formatDateTime ) +
"\n" +
EncodeColor( colorBrown ) + "Blau: The Ergodic
Oscillator, EO(" +
EncodeColor( ErgCol ) + "r" + EncodeColor(
colorBrown ) + ",5,5 ) " +
EncodeColor( ErgCol ) + "r_Pds: " + Len_r +
EncodeColor( colorGrey40 ) + " (Adjustable).";
//===============================
 
Last edited:

Similar threads