Stock WatchOverview
Watch list are very common in trading, but most of them simply provide the means of tracking a list of symbols and their current price. Then, you click through the list and perform some additional analysis individually from a chart setup. What this indicator is designed to do is provide a watch list that employs a high/low price range analysis in a table view across multiple time ranges for a much faster analysis of the symbols you are watching.
Discussion
The concept of this Stock Watch indicator is best understood when you think in terms of a 52 Week Range indication on many financial web sites. Taken a given symbol, what is the high and the low over a 52 week range and then determine where current price is within that range from a percentage perspective between 0% and 100%.
With this concept in mind, let's see how this Stock Watch indicator is meant to benefit.
There are four different H/L ranges relative to the chart's setting and a Scope property. Let's use a three month (3M) chart as our example and set the indicator's Scope = 4. A 3M chart provides three months of data in a single candle, now when we set the Scope = 4 we are stating that 1X is going to look over four candles for the high/low range.
The Scope property is used to determine how many candles it is to scan to determine the high/low range for the corresponding 1X, 3X, 5X and 10X periods. This is how different time ranges are put into perspective. Using a 3M chart with Scope = 4 would represent the following time windows:
- 1X = 3M * 4 is a 12 Months or 1 Year High/Low Range
- 3X = 3M * 4 * 3 is a 36 Months or 3 Years High/Low Range
- 5X = 3M * 4 * 5 is a 60 Months or 5 Years High/Low Range
- 10X = 3M * 4 * 10 is a 120 Months or 10 Years High/Low Range.
With these calculations, the indicator then determines where current price is within each of these High/Low ranges from a percentage perspective between 0% and 100%.
Once the 0% to 100% value is calculated, it then will shade the value according to a color gradient from red to green (or any other two colors you set the indictor to). This color shading really helps to interpret current price quickly.
The greater power to this range and color shading comes when you are able to see where price is according to price history across the multiple time windows. In this example, there is quick analysis across 1 Year, 3 Year, 5 Year and 10 Year windows.
Now let's further improve this quick analysis over 15 different stocks for which the indicator allows you to watch up to at any one time.
For value traders this is huge, because we're always looking for the bargains and we wait for price to be in the value range. Using this indicator helps to instantly see if price has entered a value range before we decide to do further analysis with other charting and fundamental tools.
The Code
The heart of all this is really very simple as you can see in the following code snippet. We're simply looking for the highest high and lowest low across the different scopes and calculating the percentage of the range where current price is for each symbol being watched.
scope = baseScope
watch1X = math.round(((watchClose - ta.lowest(watchLow, scope)) / (ta.highest(watchHigh, scope) - ta.lowest(watchLow, scope))) * 100, 0)
table.cell(tblWatch, columnId, 2, str.format("{0, number, #}%", watch1X), text_size = size.small, text_color = colorText, bgcolor = getBackColor(watch1X))
//3X Lookback
scope := baseScope * 3
watch3X = math.round(((watchClose - ta.lowest(watchLow, scope)) / (ta.highest(watchHigh, scope) - ta.lowest(watchLow, scope))) * 100, 0)
table.cell(tblWatch, columnId, 3, str.format("{0, number, #}%", watch3X), text_size = size.small, text_color = colorText, bgcolor = getBackColor(watch3X))
Conclusion
The example I've laid out here are for large time windows, because I'm a long term investor. However, keep in mind that this can work on any chart setting, you just need to remember that your chart's time period and scope work together to determine what 1X, 3X, 5X and 10X represent.
Let me try and give you one last scenario on this. Consider your chart is set for a 60 minute chart, meaning each candle represents 60 minutes of time and you set the Stock Watch indicator to a scope = 4. These settings would now represent the following and you would be watching up to 15 different stocks across these windows at one time.
1X = 60 minutes * 4 is 240 minutes or 4 hours of time.
3X = 60 minutes * 4 * 3 = 720 minutes or 12 hours of time.
5X = 60 minutes * 4 * 5 = 1200 minutes or 20 hours of time.
10X = 60 minutes * 4 * 10 = 2400 minutes or 40 hours of time.
I hope you find value in my contribution to the cause of trading, and if you have any comments or critiques, I would love to here from you in the comments.