Marking High & Low – Help Needed.

Forums ProRealTime English forum ProBuilder support Marking High & Low – Help Needed.

Viewing 8 posts - 1 through 8 (of 8 total)
  • #90657

    I’m trying to place an arrow over today’s highest and lowest bar of the day on a 1 hour chart (this will be applied to UK shares which have 9 bars a day between 8:00 & 16:30). If multiple bars match the High/Low of the day I would only like to highlight the first bar that matches.

    I have limited experience with ProBuilder, so I decided to start by building an indicator that just highlights the bar that contains the high of the day. When I had that working I was going to add the low bar of the day and then limit it to highlighting only the first matching High/Low using the once command.

    Unfortunately I’m having difficulty matching only the high of the day. No matter what I try, bars that don’t match the high of the day are being highlighted.
    The first thing I tried was this.

    I thought that this would work, but it was highlighting bars that didn’t match the day’s high, as shown in the attachment.

    What seems to be happening is that when you use DHigh on a 1 hour chart it doesn’t give the high of the whole day, but instead gives the highest price reached so far in the day for each bar.

    I.e. for the third bar of the day, DHigh only returns the highest price reached during the first three bars of the day, even though there is data available for the whole day. (WholeDayHigh would be a really useful constant to have)

    After searching the forum for ideas, these are some of the things that I have tried.

    All of them have the same problem of highlighting bars that don’t match the high of the day.

    This is also problematic because it looks back 9 bars and sometimes the IG data is missing bars. If there are one or more bars missing, looking back 9 bars would include some of the previous days data.

    I also tried this.

    and this.

    Which all gave the same result.

    Any help solving this would be much appreciated.

    #90658

    Sorry, the attachment didn’t work. I’ ll try again.

    #90659

    Attachment didn’t work so I’ll try a linked image

    Chart-1

    #90660

    You can’t know what the days highest high or lowest low is until the day is over. Your indicator can only highlight what it already knows at any moment in time!

    You need to know that a new day has started and then start recording the highest high and the lowest low and the barindex at each new HH and new LL  and draw an arrow at the end of the day at those locations.

    Something like this:

     

     

     

    #90803

    Hi Vonasi, I’m grateful for your help.

    The code that you wrote works and highlights the high and low bars of the day, as shown below.

    Unfortunately it doesn’t seem to work on the last day of the chart, which is what I need. Do you have any other ideas on how to do this?

     

    Chart2

    #90833

    It is not possible to know the days high before the day is over! If you are wanting the latest days most recent new high to be highlighted with an arrow and then all previous arrows to be deleted then this is not possible as once drawn an object cannot be deleted. You could try saving the last location and then drawing a different colour arrow over the top but this might look a bit messy. Maybe you would be better to just draw horizontal lines on the last bar only at the days highest high and lowest low that would then highlight what those levels are across the chart?

    Something like this:

     

    #90934

    Hi Vonasi, thanks for taking the time to help me.

    During testing I have noticed that PRT 10.1 and PRT 10.3 implement DHigh differently.

    If DHigh worked in the same way in 10.3 as it did in 10.1 I think that the first version that I tried (shown below) would have worked. I have other indicators that use DHigh that work in 10.1 but not 10.3.

    I have made a new post that shows the difference in the behaviour of DHigh between 10.1 and 10.3

     

    #91297

    This is the code that I ended up using. I’ve added comments to the code in case it can help anybody that
    has a similar problem.

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

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