Scan for price touching previous day high low or close


Category:
0
0

Hi Pete,

Can you make a scan that alert me when a stock price in my watchlist hit previous day close, high or low?

Marked as spam
Posted by (Questions: 16, Answers: 12)
Asked on September 17, 2023 10:47 am
91 views
0
Private answer

The simplest solution to this one requires that the Study Filter be set to excluded extended hours. This will not work if extended hours are included. So this scan can only function during regular session hours. The solution to include extended session hours is beyond the scope of free solutions I can provide in this forum.

I have split this scan into three separate signals, one for each of the three levels. You can select only one scan signal at a time. If you try to activate more than one scan plot you will generate an error and will not be able to save the scan.

def newDay = GetDay() <> GetDay()[1];
rec priorSessionClose = if newDay then close[1] else priorSessionClose[1];
rec trackSessionHigh = if newDay then high else if high > trackSessionHigh[1] then high else trackSessionHigh[1];
rec priorSessionHigh = if newDay then trackSessionHigh[1] else priorSessionHigh[1];
rec trackSessionLow = if newDay then low else if low > 0 and low < trackSessionLow[1] then low else trackSessionLow[1];
rec priorSessionLow = if newDay then trackSessionLow[1] else priorSessionLow[1];
# use this to scan for price touching the prior session close
plot scan = high >= priorSessionClose and low <= priorSessionClose;
# use this to scan for price touching the prior session high
#plot scan = high >= priorSessionHigh and low <= priorSessionHigh;
# use this to scan for price touching the prior session low
#plot scan = high >= priorSessionLow and low <= priorSessionLow;

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on September 17, 2023 11:09 am
0
Thanks
( at September 17, 2023 11:29 am)