Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: Trend Exploration: Count Number of New Highs
Author/Uploader: marcus - davidsson_marcus [at] hotmail.com
Date/Time added: 2009-07-25 11:46:46
Origin:
Keywords: trend, exploration, new high, high
Level: basic
Flags: exploration

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:


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.

Formula:



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 );

Comments:


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM