Can I Do This In A Single Expression?
Forums › ProRealTime English forum › ProScreener support › Can I Do This In A Single Expression?
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by Geester.
-
-
04/19/2017 at 11:38 AM #32573
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.
04/19/2017 at 1:41 PM #32599Maximum Value of the High of the bar(s) over 15 bars, starting 4 bars ago
That could be coded like this:
1value = 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:
1lowestlow = lowest[21](low)[3]Hope it helps you sort all the rest of your code!
04/19/2017 at 1:44 PM #3260104/19/2017 at 3:54 PM #3263304/19/2017 at 4:18 PM #3263704/19/2017 at 4:27 PM #32638My 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?
04/19/2017 at 4:37 PM #32639 -
AuthorPosts
Find exclusive trading pro-tools on