Skip to main content

Percentage Stocks above 200 MA for Amibroker for Amibroker (AFL)

zebina about 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker, composite

Run composite over your selected index etc, then paste the code into indicator builder to plot the results. Update daily etc.

Modify to other MA intervals as required.

Indicator / Formula

Copy & Paste Friendly
/// Percentage Stocks above 200 MA

Above200Day = C >= MA(C,200);

Buy = 0; AddToComposite(Above200Day, "~200DayMA%", "V" );

/* add one to open interest field (we use this field as a counter) */
AddToComposite( 1, "~200DayMA%", "I" );


PercentageRising200 = Foreign("~200DayMA%", "V") / Foreign("~200DayMA%", "I") *100;

Plot(PercentageRising200,"Pct. of stocks above 200 Day MA", IIf( PercentageRising200 > (MA(PercentageRising200,10)), colorBrightGreen, colorRed),styleThick);

Plot(80,"", colorRed,styleThick);
Plot(30,"", colorBrightGreen,styleThick);
Plot(10,"", colorBrightGreen,styleThick);

0 comments

Leave Comment

Please login here to leave a comment.