Trying to do a screener for a specific date but unsure how to define the variable date in the probuilder section.
I have put
myDate = 202002202
RETURN Date
Not sure this is displaying it correctly, can anyone help?
I have now changed it to this – does this look correct?
myDate = YYYYMMDD
YYYYMMDD = Date
RETURN Date
No, your code is wrong.
YYYYMMDD is the correct date format.
You can build any date by multiplying single data this way:
YYYY0000 2020 * 10000 = 20200000 +
MM00 2 * 100 = 200 +
DD 2 * 1 = 2 =
YYYYMMDD = 20200202
DATEs are just numbers.
YYYYMMDD = Date
RETURN Date
This is what I have in probuilder to return date – then in screener i will input specific date but it is not working?
I have taken this example from another thread. code is by Nicholas. take some time to understand it, feel free to ask questions
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]
setting the idate to your selected date and using date=idate is the key for you I think.
Thanks alot, think I have it now! is the main chart meant to reflect the date i set? as the main chart isn’t switching to the date I have set? instead i am having to manually go to that date.
instead i am having to manually go to that date.
Yeah, unfortunately they are separate entities, but you can have many many charts, so set it up as you wish 👍
cc267 – Follow the forum rules.
- Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.