Announcement

Collapse
No announcement yet.

Price Overlap

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Price Overlap

    Can someone help me develop code to show price overlap (or point me to an alternative indicator with equivalent function)? In other words, I'd like to see how much of one price range overlaps with another price range, perhaps as a percentage. If a price range (e.g., the high and low for a one hour period) was completely within the prior price range the price overlap would be 100%.

    Thanks.

  • #2
    Try This...

    I hope this is what you want..

    Brad
    Attached Files
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      It looks to me like your study shows the relative size of two different price ranges. So if one range is smaller than the previous range LastRange is valued at 1.00. Is that correct?

      I am not really trying to compare the size of the ranges but rather how much the two ranges overlap. For example,

      If bar1 has a high of 10 and a low of 9,
      and bar2 has a high of 11 and a low of 10,
      then the two bars don't really overlap so I want an indicator value of 0.

      If bar1 has a high of 10 and a low of 9,
      and bar2 has a high of 10.5 and a low of 9.5,
      then the two bars overlap and I want an indicator value of 50.

      So basically I'm looking for an indicator that returns a percentage of how much of bar2 is overlapping bar1.

      Does that clarify things? Of course, really I'm going to want to do this with time based ranges rather than individual bars but the idea should be the same.

      Thanks.

      Comment


      • #4
        Try this...

        Here is a revised code that should be giving you what you want .

        If there is a gap between the bars, then it will return ZERO.

        Brad
        Attached Files
        Brad Matheny
        eSignal Solution Provider since 2000

        Comment

        Working...
        X