Hi,
I have put in a code for the proscreener that gives live data, or results for end of day scan.
Am I able to specify the scan to stop at a certain date and see scan results for previous days?
Yes of course, you can base your conditions with any of the date&time instructions: https://www.prorealcode.com/documentation/category/dateandtime/
Thank you for there reply. Sorry I am very new to coding and keep getting syntax error adding the date.
I want to add Date[N] to this scan
ONCE Periods = 20 //last 20 bars
ONCE PerCent = Periods * 0.9 //90% of times on the rise
ONCE RsiNum = 14
MyRsi = rsi[RsiNum](close)
SCREENER[summation[Periods](MyRsi > MyRsi[1]) >= PerCent]
How would I do this?
So you want to know if this condition:
summation[Periods](MyRsi > MyRsi[1]) >= PerCent
was true at a specific date only?
Yes I would like to search by date, all stocks that had RSI rising for 20 periods 90% of the time.
Basically scan for January 6th for example which stocks met this condition at the end of day
Are you able to add a “search by date” code within the scan?
I think that it would work correctly with the below code:
ONCE Periods = 20 //last 20 bars
ONCE PerCent = Periods * 0.9 //90% of times on the rise
ONCE RsiNum = 14
MyRsi = rsi[RsiNum](close)
idate = 20190106
if summation[Periods](MyRsi > MyRsi[1]) >= PerCent and date=idate then
test=1
endif
SCREENER[test]
Change “idate” with the date of your choice in YYYYMMDD format.
I think that it would work correctly with the below code:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
ONCE Periods = 20 //last 20 bars
ONCE PerCent = Periods * 0.9 //90% of times on the rise
ONCE RsiNum = 14
MyRsi = rsi[RsiNum](close)
idate = 20190106
if summation[Periods](MyRsi > MyRsi[1]) >= PerCent and date=idate then
test=1
endif
SCREENER[test]
|
Change “idate” with the date of your choice in YYYYMMDD format.
Yes that’s perfect! Thank you so much!
I think that it would work correctly with the below code:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
ONCE Periods = 20 //last 20 bars
ONCE PerCent = Periods * 0.9 //90% of times on the rise
ONCE RsiNum = 14
MyRsi = rsi[RsiNum](close)
idate = 20190106
if summation[Periods](MyRsi > MyRsi[1]) >= PerCent and date=idate then
test=1
endif
SCREENER[test]
|
Change “idate” with the date of your choice in YYYYMMDD format.
Nicolas one last thing, are you able to add a volume parameter in this code?
Such that I can input a minimum volume number to filter out the low volume stocks?
Sure, here it is: (adjust the minVolume setting, default is set to 1M)
ONCE Periods = 20 //last 20 bars
ONCE PerCent = Periods * 0.9 //90% of times on the rise
ONCE RsiNum = 14
MyRsi = rsi[RsiNum](close)
idate = 20190106
minVolume = 1000000
if summation[Periods](MyRsi > MyRsi[1]) >= PerCent and date=idate and volume>minVolume then
test=1
endif
SCREENER[test]
Sure, here it is: (adjust the minVolume setting, default is set to 1M)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
ONCE Periods = 20 //last 20 bars
ONCE PerCent = Periods * 0.9 //90% of times on the rise
ONCE RsiNum = 14
MyRsi = rsi[RsiNum](close)
idate = 20190106
minVolume = 1000000
if summation[Periods](MyRsi > MyRsi[1]) >= PerCent and date=idate and volume>minVolume then
test=1
endif
SCREENER[test]
|
Great, thanks so much Nicolas
prevailution – please don’t hit the ‘Quote’ button for every reply – especially if there is code in the post that you are quoting! Quoting is only necessary if you want to highlight one particular part of someone’s reply that you are responding to or if there are several people in a conversation and you want to show exactly who you are answering. Do this by highlighting the section of interest and then click on ‘Quote’. It is rarely necessary to quote someone’s whole post including their own code back to them – especially in a conversation between only two people! 🙂