alltrue.... |
Post Reply |
Author | |
etrader
Regular Joined: 18 Dec 2004 Posts: 63 |
Post Options
Quote Reply
Topic: alltrue.... Posted: 10 Aug 2005 at 2:40pm |
( alltrue(Close > hist(Close, 1),10))this script is finding me any stocks that close higher 10 days in a row. If I use "anytrue" it would find me stocks that closed higher any of the 10 previous days. [this is only an easy way to explain the example, not a scan i use practically] My question is: Can I script to find stocks that are "alltrue" as above, with the exception of 'any' 1 of the 10 days. In this case, 90% of the #days I am scanning must meet the criteria [ie. 9 out of 10 days are true]. Sometimes my scans feel too tight, and miss the odd good move. To capture these without increasing the output results too much, I think a solution as above might work for me... cheers etrader Edited by etrader |
|
Tim Allen
BullCharts Staff Joined: 10 Sep 2004 Location: Australia Posts: 53 |
Post Options Quote Reply Posted: 10 Aug 2005 at 5:23pm |
I have to say, I'm glad you're not using that scan practically - you'd never buy anything! I had to tone it down to just 5 previous days in order to test my solution. :)
Anyway, something that might not be incredibly obvious: although a criterion such as "Close > hist(close, 1)" is a 'boolean' value, that is it can be either True or False, you can actually treat booleans as numbers: a True boolean value is equivalent to '1' and a False boolean value is equivalent to 0. Thus, the script you're looking for is:
The way it works is this:
|
|
etrader
Regular Joined: 18 Dec 2004 Posts: 63 |
Post Options Quote Reply Posted: 10 Aug 2005 at 9:52pm |
that is perfect, exactly how I was imagining, many thanks Tim. etrader |
|
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |