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

Trend Exploration: Count Number of New Highs for Amibroker (AFL)
kaiji
almost 15 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 2)
Tags:

This exploration identify price trends by counting the number of new highs (or lows) that a stock has made during the last 50 days and sort the result in descending order.

Indicator / Formula

Copy & Paste Friendly
LK=50;

Filter = Status("lastbarinrange");


A1= IIf( L> Ref(HHV( Close,LK),-5), 1, 0 ); 

A2= Sum( A1, LK ) ;


B1= IIf( H< Ref(LLV( Close,LK),-5), 1, 0 ); 

B2= Sum( B1, LK ) ;


SetOption("NoDefaultColumns", True);

AddTextColumn( Name(), "ticker", 1, textColor=colorBlack,
bkgndColor=colorLime);

AddColumn( DateTime(), "date/time", formatDateTime, colorBlack, colorLime);

AddColumn( A2, "New Highs", 1.0, textColor = colorBlack, bkgndColor =
colorLightOrange  );

AddColumn( B2, "New Lows", 1.0, textColor = colorBlack, bkgndColor =
colorLightOrange  );

AddColumn( Correlation(Cum(1),Close,LK), "Correlation Trend", 1.2, textColor =
colorBlack, bkgndColor = colorLightOrange );

AddColumn( ROC(C,LK), "Percentage Return", 1.0,textColor = colorBlack,
bkgndColor = colorLightOrange  );

AddColumn( ROC(C,LK)/StDev(ROC(C,LK),LK), "Risk Adjusted Returns",
1.0,textColor = colorBlack, bkgndColor = colorLightOrange  );

SetSortColumns( -3 );

0 comments

Leave Comment

Please login here to leave a comment.

Back