Highest and Second highest point in last X bars if current close is lower

Forums ProRealTime English forum ProBuilder support Highest and Second highest point in last X bars if current close is lower

Viewing 4 posts - 1 through 4 (of 4 total)
  • #164651

    Good day, This is my first time trying….

    I want to create an indicator that could identify:

    1. The highert point in the last X bars then
    2. From that point of the highest bar, to the current bar, I would like to calculate the second highest bar.

    But I constantly get an error message: “un parametre de type entier positif est attendu avec highest”

    Here is the code, and I do not understand the reason, as the defenition is a full number??? Could anyone help?

     

     

    #164658

    Hello, moderation messages :

    • you posted in English in french forum, please see rules in yellow box below about choosing the right forum. No need to repost we’ll move this topic now
    • you posted code without formatting it, please see image attached to locate the “insert PRT code” button as this is your first time. Again no need to repost, we’ll reformat your code in above message now
    #164668

    Your first “for to next” loop ending with i=1, x1=i-1 will be =0 when i=1, and the error message “entier positif” (positive integer) for X1 in highest[x1](…) means X1 has to be at least 1, not 0… so either make sure X1 can’t be zero, or use something bigger than X1 with highest

    #164686

    Thanks you for pointing this out!  It was a great help

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

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