Syntax Explanation Please

Forums ProRealTime English forum ProScreener support Syntax Explanation Please

Viewing 5 posts - 1 through 5 (of 5 total)
  • #31546

    Hello There,

    In some code I have been studying, it has the following line:

    body=close-open

    Later in the code, it then refers to:

    body[2]<0

    How has the “body” variable suddenly become an array-like indexable variable? The code in question comes from the following:

    https://www.prorealcode.com/prorealtime-indicators/candlesticks-patterns-indicator/

    I’m new to PRT and its code so excuse the newbie questions! 🙂

    Many thanks.

     

     

    #31547

    It’s not an array, PRT doesn’t have them.

    It means the value of the expression identified by BIDY, 2 bars ago. It’s like writing:

     

    #31638

    Hi Roberto,

    body=close-open

    PRT doesn’t just assign the result of the above to “body”, it actually “remembers” the expression for further access via the bar count indexer?

    Wow. That’s neat 🙂

    Cheers.

    #31644

    Yes, and you can use that feature in as many ways as you may need; if you need, for instance, to have

    now and the previous bar you may write:

     

    1 user thanked author for this post.
    #31646

    Thank you, Roberto! I feel a little more confident now, given your explanation! 🙂

    Cheers.

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

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