Scanner for intraday high-low


Category:
0
0

Hey Pete,

Hope you are safe and all well. You gave a script for new intraday high in this post –

High/Low of Day Column

Can you please convert it to new intraday low?

And the new low will start counting from market open, as the code counts only last 10 bars. Thank you for your help as always.

Below I am pasting the code that you gave on upper link :

input withinBars = 10;
def newDay = GetDay() <> GetDay()[1];
rec trackHigh = if newDay then high else if high > trackHigh[1] then high else trackHigh[1];
rec countBars = if trackHigh > trackHigh[1] then 0 else if trackHigh == trackHigh[1] and high < trackHigh then countBars[1] + 1 else -1; plot scan = countBars > 0 and countBars < withinBars;

Marked as spam
Posted by (Questions: 3, Answers: 4)
Asked on January 30, 2021 9:17 pm
227 views
0
Addendum: Though you gave as a custom column script it also works perfectly for scanning code at the same time. Thanks.
( at January 30, 2021 9:20 pm)
0
Private answer

Pretty sure this is the mirror image of the previous solution:

input withinBars = 10;
def newDay = GetDay() <> GetDay()[1];
rec trackLow = if newDay then low else if low > 0 and low < trackLow[1] then low else trackLow[1];
rec countBars = if trackLow < trackLow[1] then 0 else if trackLow == trackLow[1] and low > trackLow then countBars[1] + 1 else -1;
plot scan = countBars > 0 and countBars < withinBars;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 31, 2021 10:13 am