CountIf Function

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

    Hello,

    I am looking for help creating a CountIf Function for PRT. Essentially something I can pass a Boolean condition and integer value and then check how many times the Boolean condition was true in the last integer value bars. For example,

    CountIf ( Close[0] <= Close[1] , 10 ) // this ideally would return the number of times the close was below or equal to the previous low in the previous 10 bars. Possible values would be 0 to 10 with 0 being 0 occurrences and 10 being all 10 bars it was true.

    Here is an early attempt

     

    Thanks,

    David

    #70807

    This will do the trick

    it will return the number of occurrences of the condition within parenthesis after scanning the number of bars within brackets.

    #71001

    Awesome. Thank you.

    #79898

    Snippet added as Row 63 here Snippet Link Library

    Good explanation @robertogozzi

     

    1 user thanked author for this post.
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