Skip to main content

Chaloke Not-so-simple Moving Average for Amibroker (AFL)

drkade about 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 2)
  • Tags:
    trading system, amibroker, moving average, chaloke

This formula is a trend-following system.

Credit goes to Uncle Chaloke and K’Kook (www.chaloke.com)

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("NOT_SO_SIMPLE");
cmopds=11;
CMO_1=Sum( IIf( C > Ref( C, -1 ) , ( C - Ref( C ,-1 ) ) ,0 ) ,cmopds ) ;
CMO_2=Sum( IIf( C < Ref( C ,-1 ) , ( Ref( C ,-1 ) - C ) ,0 ) ,cmopds );
Smooth=5;
CMO=100 * (( CMO_1 -CMO_2) /( CMO_1+CMO_2));
AbsCMO=(abs(CMO))/100; 
SC=2/(Smooth+1); 
MM=AMA( C, SC*AbsCMO );
EM1= EMA(C,5);
EM2= EMA(EM1,5);
Dif= EM1-EM2;
EM= EM1+Dif;
x=EM-MM;

color=IIf(EM>MM,colorBrightGreen,colorRed);
Plot(C,"Chaloke Not-So-Simple Moving Average",Color,styleCandle);
Buy= Color==colorBrightGreen AND Ref(Color,-1)==colorRed;
Sell=Color==colorRed AND Ref(Color,-1)==colorBrightGreen;
Short=Sell;
Cover=Buy;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;



PlotShapes( shape, IIf( Buy, colorGreen, colorYellow ), 0, IIf( Buy, Low, High ) );

GraphXSpace = 5;
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.