OPEN-SOURCE SCRIPT
Updated

Extended CANSLIM Indicator

1 618
❖ Extended CANSLIM Indicator.

The Extended CANSLIM indicator is an indicator that concentrates all the tools usually used by CANSLIM traders.
It shows a table where all the stock fundamental information is shown at once first for the last quarter and then up to 5 years back.

The fundamental data is checked against well known CANSLIM validation criteria and is shown over 4 state levels.

1. Good = Value is CANSLIM Compliant.
2. Acceptable = Value is not CANSLIM compliant but still good. value is shown with a lighter background color.
3. Warning = Value deserves special attention. Value is shown over orange background color.
3. Stop = Value is non CANSLIM compliant or indicates a stop trading condition. Value is shown over red background color.

The indicator has also a set of technical tools calculated on price or index and shown directly on the chart.

❖ Fundamental data shown in the table.

The table is arranged in 4 sets of data:

1. Table Header, showing Indicator and Company data.
2. CANSLIM.
3. 3Rs: RS Rating, Revenue and ROE.
4. Extra Data: Piotroski score, ATR, Trend Days, D to E, Avg Vol and Vol today.

Sets 3 and 4 can be hidden from the table.


❖ Indicator and Compay Data.

The table header shows, Indicator name and version.
It then displays Company Name, sector and industry, human size and its capitalization.


❖ CANSLIM Data.

Displays either genuine CANSLIM data from TradinView or custom data as best effort when that data cannot be obtained in TV.

C = EPS diluted growth, Quarterly YoY.
>= 25% = Good, >= 0% = Acceptable, < 0% = Stop
A = EPS diluted growth, Annual YoY.
>= 25% = Good, >= 0% = Acceptable, < 0% = Stop
N = New High as best effort (Cust).
Always Good
S = Float shares as best effort.
Always Good
L = One year performance relative to S&P 500 (Cust),
Positive : 0% .. 50% = Neutral, 50%+ = Leader, 80%+ = Leader+, 100%+ = Leader++
Negative : 0% .. -10% = Laggard, -10% .. -30% = Laggard+, -30%+ = Laggard++
>= 50% = Good, >= 0% = Acceptable, >= -10% Warning, < -10% = Stop

I = Accumulation/Distribution days over last 25 days as a clue for institutional support (Cust).
A delta is calculated by subtracting Distribution to Accumulation days.
> 0 = Good, = 0 = Acceptable, < 0 = Warning, < -5 = Stop

M = Market direction and exposure measured on S&500 closing between averages (Cust).
Varies from 0% Full Bear to 100% Full Bull
>= 80% = Good, >= 60% = Acceptable, >= 40% = Warning, < 40% = Stop



❖ Extra non CANSLIM Data.

RS = RS Rating.
>= 90 = Good, >= 80 = Accept, >= 50 = Warning, < 50 = Stop
Rev. = Revenue Growth Quarterly YoY.
>= 0% = Good, <0% = Stop
ROE = Return on Equity, Quarterly YoY.
>= 17% = Good, >= 0% = Acceptable, < 0% = Stop
Piotr. = Piotroski Score, investopedia.com/terms/p/piotroski-score.asp (TV)
>= 7 = Good, >= 4 = Acceptable, < 4 = Stop
ATR = Average True Range over the last 20 days (Cust).
0% - 2% = Acceptable, 2% - 4% = Ideal, 4% - 6% = Warning, 5%+ = Stop.
Trend Days = Days since EMA150 is over EMA200 (Cust).
Always Good
D. to E. = Days left before Earnings. Maybe not a good idea buying just before earnings (Cust).
>= 28 = Good, >= 21 = Acceptable, >= 14 = Warning, < 14 = Stop
Avg Vol. = 50d Average Volume (Cust).
>= 100K = Good, < 100K = Acceptable
Vol. Today = Today's percentage volume compared to 50d average (Cust).
Always Good.


❖ Historical Data.

Optionally selectable historical data can be displayed for C, A, Revenue and ROE up to 20 quarters if available.
Quarterly numbers can also be displayed for A, C and Revenue.
Information can be shown in Chronological or Reverse Chronological order (default).
Increasing growth quarters are shown in white, while diminuing ones are shown in Yellow.
Transition from Losing to Profitable quarters are shown with an exclamation mark ‘!’
Finally, losing quarters are shown between parenthesis.



❖ MAs on chart.

Displays 200, 100, 50 and 20 days MAs on chart.
The MAs are also automatically scaled in the 1W time frame.


❖ New 52 Week High on chart.

A sun is shown on the chart the first time that a new 52 week high is reached.
The N cell shows a filled sun when a 52 week high is no older than a month, an lighter sun when it’s no older than a quarter or a moon otherwise.


❖ Pocket Pivots on chart.

Small triangles below the price are signaling pocket pivots.


❖ Bases on chart, formerly Darvas Boxes.

Draw bases as defined by Darvas boxes, both top or bottom of bases can be selected to be shown in order to only show resistance or support.


❖ Market exposure/direction indicator.

When charting S&P500 (SPX), Nasdaq 100 Index (NDX), Nasdaq composite (IXIC) or Dow Jownes Index (DJIA), the indicator switches to Market Exposure indicator, showing also Accumulation/Distribution days when volume information is available. This indication which varies from 0% to 100% is what is shown under the M letter in the CANSLIM table which is calculated on the S&P500.


❖ Follow Through Days indicator.

If you are an adept of the Low-cheat entry, then you will be highly interested by the Follow Through days indicator as measured in the S&P 500 and shown as diamonds on the chart.
The follow-through days are calculated on S&P500 but shown in current stock chart so you don’t need to chart the S&P 500 to know that a follow through day occurred.
Follow Through days show correctly on Daily time frame and most are also shown on the Weekly time frame as well.
They are also classified according to the market zone in which they occur:
0%-5% from peak = Pullback : FT day is not shown.
5%-10% from peak = Minor Correction : Minor FT days is shown.
10%-20% from peak = Correction : Intermediate FT days us shown
20+% from peak = Bear Market : Makor FT days is shown


❖ RS Line and Rating indicator.

A RS Line and Rating indicator can be added to the chart.

Relative Strength Rating Accuracy.
Please note that the RS Rating is not 100% accurate when compared to IBD values.


❖ Earning Line indicator.

An Earning Line indicator can be added to the chart.


❖ ATR Bands and ATR Trade calculator.

The motivation for this calculator came from my own need to enter trades on volatile stocks where the simple 7% Stop Loss rule doest not work.
It simply calculates the number of shares you can buy at any moment based on current stock price and using the lower ATR band as a stop loss.

A few words about the ATR Bands.

On this indicator the ATR bands are not drawn as a classical channel that follows the price.
The lower band is drawn as a support until it’s broken on a closing basis. It can’t be in a down trend.
The upper band is drawn as a resistance until it’s broken on a closing basis. It can’t be in an up trend.
The idea is that when price starts to fall down from a peak, it should not violate its lower band ATR and that means that we can use that level as a Stop Loss.
You must look back for the stock volatility and find out which ATR multiplier works well meaning that the ATR bands are not violated on normal pullbacks. By default, the indicator uses 5x multiplier.


❖ Extra things, visual features and default settings.

The first square cell of current quarter displays a check mark ‘V’ if the CANSLIM criteria is OK or acceptable or a cross ‘X’ otherwise.
The first square cell of historical C and Rev show respectively the count of last consecutive positive quarters.

There are different color themes from “Forest” to “Space” you can chose from to best fit your eyes.
You also have different table sizes going from “Micro” to “Huge” for better adjustment to the size of your display.

The default settings view show: Pocket Pivots, FT Days, MA50, RS Line and ATR Bands.

That's all, Enjoy!
Release Notes
Release 14.8.2
  • Changed “Base Creation Period” to “Base Minimum Bars” and set the default to 4.
  • Set Default Max Base Duration to 12. These defaults values are optimum for weekly charts.
  • Changed lookback years in both Base Locator to 5 and ATR Bands to 1.
  • Fixed, when removing all historical data, the first square box remains.
  • Fixed, Row labels missing when displaying historical data in chronological order.
Release Notes
Release 15.3.6

The Following Features have been added to this new release.


❖ A completely new “Dynamic” view of the indicator.

This new view follows the chart timeline and allows you to see the Earnings and Sales quarterly anchored to the chart. It displays the Month ending the quarter and the year, followed by the YoY Earnings and Sales Growth for that quarter.
Below the numbers, you have a small colored box showing if the quarter meets Earnings and Sales criteria and on the last quarter, you have the state for all the CANSLIM data plus RSR (Rel. Strength Rating).
This view is portable device friendly! The information scales to the size of the pane so the numbers can also be readable on your smartphone.
Note that this view is only available in the Daily and Weekly time frames.


❖ Highest volume TTM and Ever indicator.

This indicator appears in the form of a star below the bar with the highest volume ever (filled star) and the highest volume TTM (empty star).


❖ MAs alignment indicator.

This indicator shows with a 3 parallel lines symbol when the 4 MAs (20/50/100/200) are all aligned bringing more confirmation for a possible new trend.

❖ Three weeks tight indicator.

This indicator shows a 3 weeks tight pattern by drawing a resistance line above the highest high of the 3 weeks.
There are 2 coherence checks made before any indication.
1 - Short term up trend verification by checking that there is no higher high in the last 15 bars.
2 - Verification that we are not in the process of building a base as this pattern is considered a follow up buy opportunity, it won’t show when inside a base but only between bases.

❖ Market Cycle indicator.

Below the quarter numbers and quarter qualification boxes, a line shows the market cycle according to S&P 500.
A New Bear Cycle starts when the Market exposure goes below 30%, shown here in red and a new Bull Cycle starts when it goes above 75%. If you plot the S&P500, you will see that the indicator is capable of capturing the majority of a bull market while avoiding the majority of the bear markets (>20% correction).

❖ Base count indicator.

The Base Locator has been augmented with a base count indicator.

The base locator is based on the Darvas Boxes and the counting is made following WON CANSLIM rules including the reset count rule.

Know that the default parameters of the indicator (6,24) are optimized for the weekly time frame.
The base count is increased by one when the distance from the prior base pivot point is at least 20%. As a pivot point inside a base cannot be determined, I use the 75% level from the low of the prior base to calculate the distance, I think it’s a good compromise to the alternative of simply using the top of the base.

When the 20% requirement is not met but still above, the base is called a “base on base” and is part of the previous counted base so it has the same count with a letter appended to it. 1a, 1b, etc…
When a new base form below the current one without undercutting the previous it gets the same count as it's simply an extension of the current one.
When the price undercuts the previous base, the base count is reset to 1 and a ‘R’ is appended to the base that undercut its predecessor. This reset rule applies to bases only, not bases on bases.
As the indicator is up trend oriented, every base with a top or bottom below a previous base that was reset, will be labelled as a reset base as well as the reset condition will still be true.
An additional rule resets the counter if the time from previous base to last base is greater than a year and the base is lower than the previous one. When that happens, a “Y” will be appended to the base number.
Finally a visual actionable 50% base level was added (dashed line) to the bases. The aim is to help spot correct Cup with Handles bases as handles should normally form in the higher half of the cup in the base.
Release Notes
Update 15.4.8

Fixed Leader/Laggard indicator.
Removed debug logs.
Fixed some typos in code comments.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.