♥ 0 |
Hey Pete, what i’m trying to basically do is add a clouds to my chart, green cloud for a green bar and red cloud for a red bar. I want this cloud to stretch from that bar to the right of every inside bar. I was able to make the script to determine and inside bar, but I’m not sure how to put the cloud like I want.
def lo = low; def s = if hi[1] > hi and lo[1] < low then 1 else 0;
Attached is how I would like the chart to look but I don’t know how to make a cloud that is the
Marked as spam
|
Private answer
The basic premise of your question has already been posted and solved in the forum, on two occasions: https://www.hahn-tech.com/ans/plot-high-and-low-of-previous-inside-bar/ https://www.hahn-tech.com/ans/plot-horizontal-line-across-previous-days-high-low-for-inside-bars/ If you had searched for this solution before posting this question you would have located both of those posts already. Then you might have copied the link from the second post and included that code and link in your request. Because the code from that post does everything you have requested, with the exception of the cloud. So you start with the code provided in the second link I included above. You only need to add a single line to add a cloud to the high and low plotted from that solution. Details about how to write the line of code that adds the cloud is found here: https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddCloud Here is the full and complete code, taking the code from the previous solution and adding the one line of code that adds the cloud to the chart: Why do people do this?
What is the point? I see this all the time and there is absolutely no good reason to do this. So stop it. And why did you create a variable name of "s"? What does "s" stand for? What is wrong with spelling it out? Why do I see so many people writing such rotten code? Check this out. You can replace 5 lines of code from your original source and replace it with a single line: plot insideBar = high[1] > high and low[1] < low; Done. See how much easier that code is to write? See how much easier it is to read? Marked as spam
|
Please log in to post questions.