Watchlist unusually high percent above average daily volume


Category:
0
0

Hello Pete,

thanks for replying to my earlier post. I’m attaching the code as a text file as requested.

I do not want a scanner or a watchlist that filters out stocks etc. All I want is for the same % that this code provides in the Chart Labels, to be added as a watchlist filter. This way, I can see this % on my watchlists, instead of having to go directly into the charts to see it.

For example: If you use this code right now for NVDA, the chart will show you some labels, one of which is the % of current volume. As of know,  the result is 46%. I want this exact chart label % shown in my personal watchlist.

I hope it makes sense.

thanks,

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on September 27, 2024 10:43 am
8 views
0
Private answer

Terminology is important, so that we don't mistakenly convey something that is not accurate. So please allow me to explain the correct terminology which describes the solution I have provided below.

This solution is NOT a "watchlist filter". The term "watchlist filter" implies that it would be able to select specific ticker symbols to add to the watchlist, adding and removing ticker symbols as the filter criteria is processed. This solution is for a custom watchlist column, otherwise know as a "custom quote field" by the developers of Thinkorswim. It merely displays a value for each ticker symbol and changes color base on a comparison of two values.

After reading the source code you provided found it is computing the 30 period moving average of Daily volume. The code does this in a very clumsy way, but that is essentially what it is doing. The only reason I mention that is because the solution I provide below is radically different, yet it performs the same exact thing. I want to avoid any confusion for folks comparing your source code to my solution below.

When you apply this script to a custom column in your watchlist, the most important detail you need to account for is the time frame selected for your custom column. In this example, that time frame MUST be set to Daily. Otherwise, it will not give the same results as your source code.

Ok, here it is:

input percentThreshold = 200.0;
input averageLength = 30;
def volumeAverage = Average(volume[1], averageLength);
plot percentOfAverage = Round((volume / volumeAverage) * 100, 0);
percentOfAverage.AssignValueColor(if percentOfAverage > 100 then Color.BLACK else Color.CURRENT);
AssignBackgroundColor(if percentOfAverage > percentThreshold then Color.GREEN else if percentOfAverage >= 100 then Color.ORANGE else Color.CURRENT);

You will see I included two parameters which you can adjust. The first allows you to select the threshold level at which columns will change from orange to green. The second allows you to adjust the value used to compute the average daily volume.

Marked as spam
Posted by (Questions: 37, Answers: 4114)
Answered on September 27, 2024 11:00 am
0
thanks Pete, and sorry for the mistakes in the terminology!! This is just what I needed. Have great weekend!! :)
( at September 27, 2024 11:07 am)