Can I Do This In A Single Expression?
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
Similar topics:
Forums › ProRealTime English forum › ProScreener support › Can I Do This In A Single Expression?
Hi,
I’m trying to emulate some screening code originally written for another platform.
Using something like this: MAXH15.4
The other platform interprets this as give the Maximum Value of the High of the bar(s) over 15 bars, starting 4 bars ago.Or …
MINL21.3
Give the Minimum Value of the Low of the bar(s) over 21 bars, starting 3 bars ago.
I appreciate that there are MIN/MAX functions available in PRT but the documents suggest they accept as lists of literal values. To have to iterate in loops to arrive at values like this would be very cumbersome when you want (and I want) to replicate filters like this:
((L1 = MINL4) OR (L2 = MINL4) OR (L3 = MINL4) ) AND
( (MAXC3 < MAXC4.3)) AND
( (H3 = MAXH15.4) OR (H4 = MAXH15.4) OR (H5 = MAXH15.4) OR (H6 = MAXH15.4) OR (H7 = MAXH15.4) ) AND (((MAXH4.3 – MINL4) / (MAXH4.3 – MINL21.3) > .23) AND ((MAXH4.3 – MINL4) / (MAXH4.3 – MINL21.3) < .62) ) AND
((AVGH3.5) > (AVGH3.8 ) AND (AVGH3.8 ) > (AVGH3.13) AND (AVGH3.13) > (AVGH3.18 ))
Any ideas as to the best approach to combine bar sequences with functions as expressions?
Many thanks.
Maximum Value of the High of the bar(s) over 15 bars, starting 4 bars ago
That could be coded like this:
1 |
value = highest[15](high)[4] |
Give the Minimum Value of the Low of the bar(s) over 21 bars, starting 3 bars ago.
and the same way to find a lowest low of X bars ago:
1 |
lowestlow = lowest[21](low)[3] |
Hope it helps you sort all the rest of your code!
My bad. I had tried so many combinations to make this work, I mistyped. However, it still doesn’t work. Consider this:-
expr1 = lowest[4](low) // This works and, the “lowest” word is in GREEN
expr2 = higest[3](close) // This fails with the red squiggle in the editor window. Also, the “highest” word is in WHITE
Ideas?
Find exclusive trading pro-tools on