Hi everyone,
I’m trying to build a ProScreener in ProRealTime that scans for conditions on a custom time period, specifically 2-day (2D) or 3-day (3D) candles. However, I keep getting a syntax error when I try to use TIMEFRAME(2 days) or a similar approach.
Error Screenshot Attached:
The error message says:
“Syntax error: line X, character XX
One of the following characters would be more suitable than ‘2’:
-
‘minute’, ‘hour’, ‘minutes’, or a timeframe hour (h, hour, hours)”
Has anyone successfully created a screener or indicator using custom multi-day timeframes (other than 1 day, 1 week, etc.)?
-
Is this possible in the current version?
-
Are there any workarounds for scanning on 2D/3D periods?
Any help or code examples would be much appreciated!
Thanks in advance for your advice.
JSParticipant
Senior
Hi,
These are the time frames (screenshot) you can use in a screener…
A possible workaround is to aggregate the data manually…
For a 2-day period, combine the last two daily bars as follows:
Open of the 2-day bar = DOpen[1]
High of the 2-day bar = max(DHigh, DHigh[1])
Low of the 2-day bar = min(DLow, DLow[1])
Close of the 2-day bar = DClose
Thank you JS. That worked.