Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Number of stocks above/under MA(9) for Amibroker (AFL)
rongreu
about 14 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 2)
Tags:
amibroker, exploration, composite

Number of stocks above/under MA

STEPS:
1) RUN SCAN FOR A GROUP OF WATCHLISTS, TYPICALLY CONSISTING OF FOR INSTANCE, NIFTY STOCKS.
2) SELECT AFL INDICATOR ON THE LEFT PANE OF AMIBROKER CHART WINDOW
3) RIGHT CLICK AND SELECT INSERT INDICATOR. YOU SHOULD BE ABLE TO SEE THE INDICATOR.
4) DIFFERENT TYPE OF MAs CAN ALSO BE USED.
5) PERIOD MA IS USED TO SMOOTH THE INDICATOR.

THIS INDICATOR WOULD BE EFFECTIVE IF USED IN CONJUNCTION WITH THE CHARTS, FOR EG, NIFTY CHART.

THIS INDICATOR IDENTIFIES POTENTIAL TREND REVERSALS.

IF NUMBER OF STOCKS ABOVE 30EMA IS FALLING AND UNDERLYING INDEX RISING, THEN POSSIBLY REVERSAL OF TREND EXPECTED AND VICE VERSA.

THIS AFL DOES NOT GUARANTEE ANY POSITIVE RETURNS.

USE THIS AFL AT YOUR OWN RISK.

THIS AFL WAS DEVELOPED BY HALAN MANOJ KUMAR, MSC,CAIIB,FRM,PRM,CMA,ACMA. HOWEVER IN SOME CASES INDIVIDUAL CODE SNIPPETS ARE FROM DIFFERENT SOURCES AND I THANK THOSE DEVELOPERS.

Similar Indicators / Formulas

General Market Exploration by XeL
Submitted by xel over 12 years ago
Strength & weakness
Submitted by mfoysalar almost 15 years ago
Deel - Average Dollar Price Volatility
Submitted by kaiji almost 15 years ago
Scanning Gap Up and Gap Down
Submitted by vinodsk over 11 years ago
Vol Peak 5 Day [Scan only]
Submitted by lusmomoney over 11 years ago

Indicator / Formula

Copy & Paste Friendly
// Number of stocks above/under MA(20)

_SECTION_BEGIN("Average");
P = ParamField("Field");
Type = ParamList("Type", "Weighted,Lagless-21,Hull-26,Linear Regression-45,Exponential,Double Exponential,Tripple Exponential,Wilders,Simple");
Periods = Param("Periods", 9, 2, 100 );
Displacement = Param("Displacement", 1, -50, 50 );
m = 0;

if( Type == "Weighted" ) 				m=  WMA( P, Periods );
if( Type == "Lagless-21"  )				m=  2*EMA(P, Periods)-EMA(EMA(P, Periods), Periods); 
if( Type == "Hull-26"  )				m=  WMA(2*(WMA(P, Periods/2))-WMA(P, Periods) ,4 );
if( Type == "Linear Regression-45"  ) m=  LinearReg( P, Periods );
if( Type == "Exponential" ) 			m = EMA( P, Periods );
if( Type == "Double Exponential" ) 	m = DEMA( P, Periods );
if( Type == "Tripple Exponential" ) 	m = TEMA( P, Periods );
if( Type == "Wilders" ) 				m = Wilders( P, Periods );
if( Type == "Simple" ) 					m = MA( P, Periods );


//Plot( m, _DEFAULT_NAME(), ParamColor("Color", colorWhite), styleThick, 0, 0, Displacement );


//Plot Price
//barcolor = IIf(C > m, ParamColor("Up Color",colorBrightGreen), IIf(C ==m,colorRed, ParamColor("Dn Color",colorRed))); 
//Plot( C, "Close", barcolor, ParamStyle("Style",styleThick+styleNoLabel) | GetPriceStyle());
_SECTION_END();


_SECTION_BEGIN("Compare with WMA(9)");

// Set Background
//SetChartBkGradientFill(ParamColor("Bg Top",colorBlack),ParamColor("Bg Bottom",colorBlack));

Buy = Sell = 0;
Buy = Cross(C, m);
Sell = Cross(m, C);


// dung de tao chi so composite co gia tri la so luong stocks nam tren hay duoi MA(20)
AddToComposite( C >= m,"~OverWMA","X");
AddToComposite( C < m,"~BelowWMA","X");

// Thiet lap gia tri cho 2 chi so nay
Adv = Foreign("~OverWMA","C");
Dec = Foreign("~BelowWMA","C");

//ve indicator
Plot(Adv,"No stocks over WMA(9)",colorYellow,styleLine);
Plot(Dec,"No stocks below WMA(9)",colorRed,styleLine);

Filter =1; 
AddColumn( Adv ,"Adv WMA(9)",1.1);
AddColumn( Dec ,"Dec WMA(9)",1.1);

_SECTION_END();

Plot((Adv+Dec)/2,"",colorWhite, styleDashed);

1 comments

1. shubhamami

Initially, it worked fine but later on the indicator went flat. The count of stocks isn’t changed from last week. Even run the scan again still count isn’t changing. Please help!

Leave Comment

Please login here to leave a comment.

Back