Calculating fibbonaci

Forums ProRealTime English forum ProOrder support Calculating fibbonaci

Viewing 8 posts - 1 through 8 (of 8 total)
  • #120536

    Hi all im wondering how i can do the following:

    Calculate fibb, for example lets say “Close crosses under Fibb 50 level”

     

    What i want to do is something like:

    HH = Highest high variable1 bars ago

    LL = lowest low variable2 bars ago

    Fibb1: (HH-LL) * 0.5

    Fibb2: LL + fibb1

    return fibb2

     

    If we are trending upwards all is well, but if we are trending down, then HH comes before LL, and this causes problems.

    I need to tell the code something like:

    If LL happened 22 bars ago, then HH must be calculated from the past 21 bars ago (so that it comes AFTER LL has happened)

     

    How can i do this?

    #120550

    i tried this:

    But i got the error message:

    “Error in the indicator: MyIndicator(30)

    A positive integer field is expected with HIGHEST”

     

    So im guessing i cant use a variable in the HIGHESt, it has to be a number?

    Any other way to do what i want to do?

    #120565

    You probably need the long awaited Arrays function to do it correctly?

    Have you tried recording / using the barindex when you get the LL / HH?

    For example …

     

     

    #120567

    Ive never seen this barindex, this might be the solution to my problems (?) would need to consult the holy PRT manual to see what barindex is and how to use it.

     

    If it dosnt work im guessing i need arrays?

     

    I have the same problem when trying to calculate “how many % the market has gone up”

     

    Say you want to calculate how far up the market has gone since the Lowest low past 100 bars.

     

    How can i calculate that? Same problem as with the fibb?

    #120568

    Try removing ONCE from line 1, just write q = 1.

    This an indicator I wrote, where I am dealing with your problem with a FOR…NEXT loop:

     

    1 user thanked author for this post.
    #120573
    #120587

    q= 0 at line 11, that’s why it fails to calculate the Highest with a null period at second run of the code (at 2nd bar or so)..

    #120609

    Big thanks guys, Roberto gave me the pieces i needed 🙂

     

    also thank you for links nicolas

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

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