Can I Do This In A Single Expression?

Forums ProRealTime English forum ProScreener support Can I Do This In A Single Expression?

Viewing 7 posts - 1 through 7 (of 7 total)
  • #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.

     

    #32599

    Maximum Value of the High of the bar(s) over 15 bars, starting 4 bars ago

    That could be coded like this:

    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:

    Hope it helps you sort all the rest of your code!

    #32601

    Awesome! Thank you Nicolas 🙂

    #32633

    Hi Nicolas,

    Can you tell me what is wrong with this syntax?

    expr2 =  higest[4](price)[3]

    See attached image for error details.

    Thanks! 🙂

     

    #32637

    Highest high or lowest low , but highest price??  Is Price even an allowed term?

    High, Low, Open, Close and Mid Price and you’d have to calculate Mid from (Low + (High-Low/2)) ??

    #32638

    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?

    #32639

    Wow, I’ve got it working now. I overtyped the word “highest” and it turned GREEN. Syntax squiggle disappeared?? Very strange! 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login