Coding for high and low between set hours

Forums ProRealTime English forum ProBuilder support Coding for high and low between set hours

Viewing 15 posts - 1 through 15 (of 39 total)
  • #7231

    Hi,

    I am currently coding a pivot indicator to use with Indexes. PRT already has a pivot indicator, but this runs from 12.00am to 11.59.59pm. This means that the pivots aren’t using cash data (10am – 4pm) and aren’t as effective.

    What I am wanting to do is create a pivot indicator that uses the highest and lowest price between 10.00am and 4.00pm and uses the closing price at 4.00pm.

    I am having little bit of trouble creating the logic for this. I can understand what I want it to say, but I can’t work out the correct programming language to use.

    Basically..

    Cashhigh = highest price of the prior weekday, between the hours of 10.00.00 and 16.00.00

    Cashlow = lowest price of the prior weekday, between the hours of 10.00.00 and 16.00.00

    Cash close = price at 16.00.00 of the prior weekday.

    And what I mean by saying the prior weekday, is that if today is Monday looking at data from Friday between 10am-4pm, if today is Tuesday looking at data from Monday between 10am- 4pm, etc.

    Does anyone have any pointers?

    Thank you!

    #7246

    Hi Dave, need to know in which timeframe are you working in order to code it. In this example I’m using 15min chart, so variables Highest and Lowest are set to 24 (6 hours back) at 16:00h

    1 user thanked author for this post.
    #7249

    Sorry Dave, I did it for ProOrder before…

    This one is for ProBuilder

     

    1 user thanked author for this post.
    #7255

    Max-Low-Last-Day

    Simplified

    Max-min-last-day

    #7332

    ADOLFO YOU ARE AMAZING!!!!

    I worked out how to do the cash close from what you have written!

    I have a question though, is it possible to get it to look at the highest and lowest prices between 10am-4pm without having to adjust the number of bars within the highest/lowest brackets.

    It just makes it challenging to flick between time frames, which I do often. 🙂

     

    Thank you so much for you help!

     

    #7336

    You’re wellcome Dave!

    I think we can’t use “TIMEFRAME” function in ProBuilder, as far as I know is only for ProScreener at the moment, but I got an idea about “TIME“, maybe it will test bar by bar and know which timeframe are we using, and then we can set Highest and Lowest brackets with the right numbers.

    On it, will be back with news.

    #7340

    Awesome thanks!

     

    I actually had a break through. But the problem is that it is taking the value from 9am and I am unsure how to stop it. Or what I am doing right or wrong, or even what in the code is redundant! For example not sure whether the line below is doing anything.

    Getting closer!

     

    Thanks!

     

     

    #7343

    Looks nice! Still working on how to know wich timeframe is using, as far as i’m testing on 15 min chart, this works ok but when i change timeframe, it won’t, YET! 😉

    ……………………………………………………….

    I’ll have a break and continue later, gl!

    #7347

    And… Here it is 🙂 ( Hope so  )

     

    1 user thanked author for this post.
    #7432

    Thanks Adolfo!

    That is great and it works on any time frame!

    There is a little problem though, I just put it on the chart and it is a 1 day out, what I mean is that the high and low from Monday, instead of being shown on the Tuesday, is shown on the day after on the Wednesday.

    Is there an easy fix I tried fiddling with the code but couldn’t work it out? 🙂

    So on the picture the high, lows and close need to be a day earlier. Where the red lines are drawn.

    Thanks Adolfo, I am super appreciative of the effort you have put in!

    -Dave

    #7437

    Yep Dave, you’re right… Gotta check it,  I’ll be back soon 🙂

    #7442

    Dave, after check it on my chart, didn’t find any error, here is the code and screenshot. Can you confirm we got the same?

     

    #7449

    Hi Adolfo,

    I just uploaded your .itf file, and it is 24 hrs out 🙂 As soon as the session finishes the max and min should move to the high and low of the session that has just finished, but instead it goes to max and min of the session before.

    So Mondays max and min is on Wednesday’s session but it should be on Tuesdays 🙂

     

    Thanks 🙂

    #7450

    Just to confirm, my charts are at GMT+2.

    So now, we got the new max and min changing at 16:00h, to lastday before. You mean they should change each new session (00:00 or intradaybarindex=0).

    Each new day, max, min and close should be: max-min between 10-16 and yesterday close, is it ok?

    #7451

    Finally.. Got it!! :):):)… As far as it only works from 1m to 1h…

     

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 39 total)

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