Measure – Groupcount

Groupcount helps us to get the count of stocks/entries present for a given group with an optional filter. The “grouping” can be selected via the “group/sort” tabs in a widget, as seen below.

Selecting no group from the above-listed groups would run the widget scan assuming a single group for all the *group* functions.


  1. Get the count(after an optional filter) of items grouped by a given sector or industry; the below dashboard lists the total number of stocks, number of positive stocks & number of negative stocks,
  2. Using the count to calculate the % of stocks that have closed positive vs. negative.

21 thoughts on “Measure – Groupcount”

  1. Could you please confirm if you are referring to the size of a candle or the range of band or Pivot levels (to be narrow/wide)?

  2. inadvertantly I tried to change RSI default setting from 14… since then In ‘ charts’ setting is always going to ‘2days’ and ‘5min’ …. How to to go back to defauit settings. Please guide.

  3. How to add the total number of stocks qualified based on the filter in atlas widget.
    If this is not possible, how to add column index so that we can scroll down to see the total number of stocks.

      1. Thank you for the response. I know this part, using group count. I use it to plot graphs as well.
        However, my question was about a widget that lists stocks. In the dashboard, I can use the sector or any other criteria as filter to filter stocks in other widgets. While doing so, I would like to know how many stocks qualified. Since there is no index column as well, I cant see the count.

        # Sym chg
        1. AWL 5%
        2. ITC 4%
        3. BEL 7%

        It would be best if we can display the count, 3, in the header

          1. Hello,

            We can create the same using the dashboard. Please let us know your exact requirements. We will be more than happy to create the same, if possible.

  4. How to add moving average, high, low etc to line graph widget.
    For ex, I have a widget to show how many stocks are above 20DMA, I would like to add lines that show –
    1. moving average of this
    2. high of the values (Resistance)
    3. low of values (Support)
    4. other reference support\resistance levels.

    1. Thank you for the response.
      My question was different. I understand that we can plot SMA of a standard attribute.
      In your example dashboard, can you had 20SMA for the pivot value R1 and S1? Not the close or high or low of the price.

      In my dashboard, I have a line graph drawn using groupcount of stocks above 20SMA to plot market breadth. I want to plot SMA for this groupcount value. I tried creating a custom indicator for the group count and tried to use it in the SMA function; the widget stops working.

      Cust_ind = groupcount( {cash} 1 where close > sma( close , 20 ) )

      I want to plot SMA (Cust_Ind, 20)
      SMA (groupcount( {cash} 1 where close > sma( close , 20 ) ), 20)

  5. Hello Sir,
    Please refer to the second table/block in the dashboard :
    I want to create a line chart of the ‘count of stocks that are up more than 3% AND they were down (% change negative) for a period of prior 4 days’ . I tried using CountStreak but I am not sure if it works and I have no way to find out if it is working. Can you correct and help?

    1. Hello,

      Do you mean today’s close is greater than the previous close by 3% and from the last 4 days close less than its previous close?

      If so, you need to add the below filter in your scan for the last four days down.
      1 day ago count( 4, 1 where latest close < 1 day ago close ) = 4

      1. Hello Sir,
        I wanted to know that can you provide Smoothed Moving Average indicator in indicators list or if possible can you guide me to create it as a custom indicator ?

  6. Is it possible add groupcount as a filter criteria in screener query? Like if advances more then we can show the stocks which meets buy condition?

    1. Hello Santanu, Below I have added some explanation on usage of few Math functions –

      Min – Returns the minimum value from a specific duration. For example, for finding the minimum volume in the last 10 candles, we would use “Latest Min ( 10 , Latest Volume ) “
      Example –

      Max – Retrieves the maximum value of a given attribute (open, high etc..) throughout “n” candles/periods. It can even work on like addition, subtraction and so on.. e.g. “max(20, high + low + close / 3)
      Example – The Current volume is the maximum volume in the previous 50 days volumes.

      Count –
      Returns the count of candles that have met a given filter. To have multiple filters, we can nest or combine 2 or more counts, eg “count( count() + count() equals 2 ) equals 1”
      Example –

      Greatest – Fetches the highest value from a different set of values. For example, if you want the greatest value out of 3 different SMA’s (20, 50, & 100), you can use the greatest function to get this value.

      Example –

  7. The new charts are good.

    1) a watchlist on right side pan is required with results from scans, which can be scrolled with keyboard arrow up/dn for charts on left pan.

    2) a template button which can be saved for view/preferences/indicators etc.

    3) a weekly plan for people who are on the fence to join or test the feature to commit for yearly monthly plan.

    And yes pls get a broker license so that people can automate based on your strategies.

    Great Job Chartink Team

Leave a Reply

Your email address will not be published.