OHLC Y M W D H4 H1 Last Bar indicator minor fix

Forums ProRealTime English forum ProBuilder support OHLC Y M W D H4 H1 Last Bar indicator minor fix

Viewing 7 posts - 1 through 7 (of 7 total)
  • #127440

    Thanks to crolakstrading for spotting an issue with my ‘OHLC Y Q M W D H4 H1 Last Bar’ indicator when displaying the H4 OHLC lines.

    I have fixed the code and attached the updated version here. I will post a comment on the library post directing people to here.

    #130566

    Hi @vonasi,

    Sorry to come back to this all over again. it has the same issue on the weekly. if on the weekly chart that doesn’t plot the lines only on the weekly.. i really try to fix it but impossible for me to do!! I think everything else is perfect!

     

    #130570

    Yes – weeks in PRT can be a challenge because there is no instruction for weeks such as OPENWEEK or WEEK so we can only know that a new week has started if we compare OPENDAYOFWEEK to OPENDAYOFWEEK[1] and it is lower. On a weekly chart every bar starts with an OPENDAYOFWEEK value of zero so it never identifies that a new week has started.

    I have not come up with a solution for this other than perhaps trying to add some time frame recognition code…. I’ll have to have a think about it.

    #130574

    ahh ok, thanks for the clarification! weekly lines are shown on Daily, 4h, and 1hr perfectly. it’s just only on the weekly!

    #130580

    I notice that it can also get confused and sometimes draw weekly lines on monthly charts due to the fact that have no way apart from checking the day of the week to know if a week has started or not. I really have not got a solution for it at the moment.

    #130595

    I think you can tell if a new week has started when OpenDay > OpenDay[1] (you might want to use DAY, instead) OR when it’s lower but Month <> Month[1] (not tested, just guessing).

     

    #130610

    DAY or OPENDAY just returns a number from 1 to 31 for the day of the month so that being higher tells us only that it is a new day unless it is the last day of the month. If it is lower it tells us it is a start of a month but we want to know if it is a start of a week!

    OPENDAYOFWEEK < OPENDAYOFWEEK[1] is what I use in the code but on a weekly chart every bar has the same value. Also on a monthly chart random bars will meet this condition too.

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

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