Screener can be run while a bar is being built, so when I refer to CLOSE[0] it is the current price (the one that would be considered CLOSE at execution time) or is ALWAYS a reference to the previous BAR closed BEFORE the current one?
Example:
1
2
3
4
5
x=0
IFclose[0]>close[1]THEN
x=1
ENDIF
RETURNx
is either:
a) the previous closed BAR compared to the second previous closed BAR;
or
b) the current (not yet closed) BAR compared to the previous closed BAR?
It’s b), but at any instant of a bar the price is Close(0) so if the instantaneous / current price > Close(1) (previous bar Close) then the Screener will pull as meeting criteria.
Good question, glad you asked!
Btw you need below (in place of return x) to make a Screener.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue