Approaching or Crossing a half and whole number


Category:
0
0

Hi Pete,

Is there a way to scan stocks approaching within $0.25 to a half (ie $19.25) or a full ($19.75) whole number? I would also like a second scan of crossing a half (ie $19.50) or full ($20.00)?

Thank you again!

Marked as spam
Posted by (Questions: 20, Answers: 27)
Asked on March 30, 2020 5:26 pm
27 views
0
Private answer

As best I can imagine the code would need to read the current close, then apply a formula to round that to a specific increment, than compare the current close to the result of that formula. Once you include stocks above $100 or below $10 the code completely fails. So then you have to add more complexity and we are well beyond the scope of anything I can provide at no charge in the Q&A forum.

Best you can do for free is to hard code this to a specific dollar amount and apply a top level filter that restricts the scan result to the very narrow range of $19.00 through $19.99. You would need to create a separate scan for each price range you want to cover.

The scan would look like this:

plot scan = close > 19.25 and close < 20.0;

Or

plot scan = close > 19.50 and close < 20.0;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 30, 2020 6:33 pm
0
Fair enough. Thanks again for taking the time Pete!
( at March 30, 2020 10:10 pm)