♥ 0 |
Hi Pete, I have a script that paints a shaded region for 30-50% up from the Previous Close. I would like to limit this line to pre-market hours only. Is this something that can easily be done? Thank you! input percentThresholdTop = 50.0;
-Davide
Marked as spam
|
Private answer
This topic has already been covered previously in the forum. I have updated the title of your question to make this post easier to locate using the search function. Here is a link to that previous post: https://www.hahn-tech.com/ans/how-do-i-change-the-background-color-based-on-time-of-day/ Here is the core section of code which makes this work. I have adjusted the time inputs to fit the specific times you requested, when the chart is set to Eastern timezone.
And here is how we fold that section of code into your existing solution:
Note that I have updated the variable name for the previous daily close. You had assigned it to a variable named "close" which is bad form because "close" is a key word. When writing code we must be very careful to avoid using key words and function names as variable names. This solution impacts the shaded area, but it does not change the horizontal lines that plot on the top and bottom of your custom range. You can work out that part, given the example I have applied to the AddCloud() statement. Marked as spam
|
Please log in to post questions.