Narrow range counter

Forums ProRealTime English forum ProBuilder support Narrow range counter

  • This topic has 4 replies, 2 voices, and was last updated 2 years ago by avatarAlfy.
Viewing 5 posts - 1 through 5 (of 5 total)
  • #182705

    Good morning guys, i hope you are all keeping well. I wondered if anyone could help me. Im looking to build a counter that counts for how many days todays range is the narrowest. I describe range as either open versus close or high-low i don’t mind which. So for example, if todays range was 50 cents and it was the narrowest range of the last 3 days then the answer would be 3. Thanks in advance for any help you can offer.

    #182710

    There you go:

    You can select the type of range in lines 2 and 3, just comment out the one you don’t want to use (now it’s OPEN-CLOSE).

    N is the lookback period to scan, 500 hundred bars is quite high, with more than 1K units it could be slow.

    Using the indicator’s settings you may make it an histogram.

     

     

    1 user thanked author for this post.
    #182719

    Hi Roberto, first of all thank you. The indicator works well for high -low but with open-close i forgot that some days the open close would be negative numbers. Is there a way of normalising the open close numbers so that all days are positive and then the indicator picks up the lowest number irrespective of whether the open close difference was up or down on the day please?

    #182725

    It already turns negative numbers into positive ones with ABS() in line 3.

     

    1 user thanked author for this post.
    #182727

    Oh thanks so much for explaining that!

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