Range Compression Indicator

Forums ProRealTime English forum ProBuilder support Range Compression Indicator

Tagged: , , ,

Viewing 15 posts - 1 through 15 (of 18 total)
  • #105199

    Hi All,

    I am trying to build an indicators that draws a box around a range that represents an area of consolidation. I define this as a range less that 30% of the daily ATR. I have written the below but cannot seem to get it to draw anything. The use of for loops in PRT is not something I’ve tried before so I’d really appreciate some input if anyone can help.

    Thanks

     

    #105243

    I figured it out in the end and it was much more simple than I thought. In essence I wanted to identify periods of consolidation and mark these out as ranges so that I could play breakout of these ranges. I use a Donchian channel and calculate when the range of the channel is less than a certain percentage of the daily ATR – e.g. in the example below I use 10 period Donchain and calculate when it is less than 10% of the daily ATR. I define this as a consolidation range and draw lines to mark it out.

    Here is the code to draw lines on the chart.

    It can also be useful as an indicator on a separate panel where a line for the ATR threshold is drawn and then the Donchain range is overlaid when the range is below the ATR threshold we are in consolidation and when above in a breakout

     

    3 users thanked author for this post.
    #105662

    Thanks for the code sharing. Will be of great help for future reference. Do you find it useful to filter the range period? I found that ADR (Average Daily Range) is more useful (powerful?) in this case.

    #135932

    I have used the code on my platform, but I am having difficulty with the code that boxes areas of the chart.  The other code that shows DR and ATRT is a little confusing for me.  One chart I noticed that it shows a break in consolidation when the gap between the two is at a certain point, but that is not the same with other charts.  Anyone be kind to explain the full use if the indicator?

    Thanks in advance.

    #136002

    Hi Nicolas or Thally,

    I can’t seem to get this code that you guys write/used to work and draw those boxes.  Any help, please?

     

    #136016

    Frankkeyo – Please use the ‘Insert PRT Code’ button when posting code – as instructed in the forum rules. I have edited your post for you.

    #136089

    You must have sufficient history loaded to get the daily ATR correctly calculated, try to expand the displayed units of the price chart.

     

    #136095

    I extended the unit number as much as 50000.  The only thing it shows is a straight line at the bottom of the price chart.  Nowhere near the candlesticks.  Any other suggestions?

     

    Cheers.

    #136114

    Do you apply the code on the price chart?

    #136118

    Yes.  On the price chart is shows a line at the bottom of the chart.  I have attached a print screen.

    #136993

    Did anyone found a fix for my problem with creating the lines on the price chart?

    #136994

    Works ok for me. Make sure you have sufficient units displayed on the chart in order to get the sufficient data to compute the X days ATR calculation.

    #136999

    Nope.  I am trying everything I know.  It is not working.  I don’t know why it wouldn’t work for me.  I am using the code and adding it to the price chart.  All it is doing is drawing on the price chart way off the candlesticks.

    #137000

    Is the code you are using edited from the code found here?

    #137007

    Open the properties of the price chart and tick the option to scale data, on the lower side of the properties.

     

Viewing 15 posts - 1 through 15 (of 18 total)

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