♥ 0 |
Hi Pete, How do I show the PVR Rank 1 as bright green, 2 as a lighter green, 3 a lighter red and 4 as bright red on the chart? Thanks!
Marked as spam
|
Private answer
First thing I want to show everyone is how they can use the Condition Wizard to build this solution on their own. The following line of code was created using the Condition Wizard:
I have included a screenshot showing what that looks like on the Condition Wizard view. And you can repeat that to create the other 3 values of 2-4. So what do we do with that? Well the following video shows how to use the Condition Wizard to build lines of code which can then be used to color the background of a watchlist column. (which is very similar to the methods used to build a chart study that displays a label in the upper left corner of the chart): https://www.hahn-tech.com/thinkorswim-condition-wizard-watchlist/ Ok, those details are provided for those who are trying to learn how to do this stuff on their own. Now let's get to the final solution.
Notice I used the same section of code created by the Condition Wizard. I then applied that to 4 different variables and adjusted each one to mark a specific value. Then I added two more lines to get the actual value of the PRV and also add the label to the chart. (notice that in this example "pvrFour" is not even used in the color statement). So the "def pvrFour" line can be removed entirely as it is not used. I just wanted you to see how you can create individual variables for each of the four values. Second screenshot below shows this script has been added to a chart study (displaying the label in the upper left corner). And it has also been added to a custom watchlist column. (same exact code, no changes were required).
Marked as spam
|
Please log in to post questions.