Scan Close > Highest High of min 3 to max 13


Category:
0
0

Hi Pete,

How can I change the following code to scan for close is greater than highest high of minimum 3 to maximum 13 previous bars?

plot scan = close > Highest(high[1], 13);

Thanks,
Shaishav

Marked as spam
Posted by (Questions: 49, Answers: 62)
Asked on December 25, 2020 1:08 pm
49 views
I am sorry for not being able to explain properly, I am actually looking for to modify the above condition in a way that my scan results consists of stocks wherein the price has crossed above highest high of previous 4 bars or 8 or 12 or 16 or 20 or 24 and so on..
( at December 25, 2020 4:42 pm)
0
Private answer

The solution is much simpler than you realize. Try not to overthink this. You don't need to include each of those conditions in the same block of code. Just add several Study Filters to the Condition Group named "Any of the following". Then for each study filter use the Condition Wizard to build each section you want the scan to include it the results.

How to use the Scan tool on Thinkorswim:

https://www.hahn-tech.com/thinkorswim-scans-beginner-to-advanced/

How to use the Condition Wizard on Thinkorswim:

https://www.hahn-tech.com/thinkorswim-condition-wizard/

I find that many viewers are getting stuck in the weeds thinking that there has to be a custom code solution to everything in Thinkorswim. However once you learn how to use the available tools you find you can do the vast majority of things even if you don't know the first thing about writing code.

Get out of the box and liberate your imagination by learning to use the tools. Screenshot below shows two of the conditions you listed in your comment below your question. You can build the rest using this example, but first you must take the time to view the videos I linked above and practice.

Attachments:
Marked as spam
Posted by (Questions: 38, Answers: 3602)
Answered on December 26, 2020 10:13 am
Thank you Pete. The problem which I am facing is I max out on the addition of filters the way you provided the solution. I want to cover the minimum 3 to maximum 63 in one condition in one scan.
( at December 26, 2020 2:39 pm)
Thank you Pete. The problem which I am facing is I max out on the addition of filters the way you provided the solution. I want to cover the minimum 3 to maximum 63 in one condition in one scan.
( at December 26, 2020 2:39 pm)
You may want to reconsider what you are trying to achieve here. If the current price is higher than the highest high within the last 63 bars, this means that it is also higher than the highest high within the last 3. The shorter durations are already included within the longer durations. If this doesn't make any sense than you are not describing what you are actually trying to accomplish.
( at December 26, 2020 3:20 pm)
Never mind, It was so silly to ask. I got your point. Thank you.
( at December 26, 2020 5:59 pm)