Weekly High Low Open

Forums ProRealTime English forum ProOrder support Weekly High Low Open

Viewing 13 posts - 1 through 13 (of 13 total)
  • #97115
    Seb

    Hello, I’m trying to get the last week’s high,low & open.

    I tried it with this code, that works as an indicator, but if I use the graph functionality in ProRealCode, the levels are incorrect.

    how to get last week’s high,low and open in ProRealCode?

    #97116
    #97117

    I just coded this (not tested):

     

    #97125
    Seb

    For some reason ProRealCode looks at other data or something. If I use your code the same happens as with mine; the levels are different. For example the high of 2 weeks ago in crude oil is 6350.2 instead of 6335.9 if I use the graph functionality in ProRealCode.

    #97129

    Do you have end-0f-day data?

    In this case your data is one week old.

    #97130
    Seb

    No, it’s intraday data from IG’s CFD’s

    #97133

    I’m guessing that it is different because week candles start on from a Sunday open and not on a Monday. This is why I used this in my indicators:

    With this Sunday open is used but if there is no Sunday or no Monday candle then Tuesday is used. It is very unlikely that one week ends on a Friday and the next trading candle is the next Friday so this should work fine.

    #97134

    Roberto and I noticed recently that in a strategy opendayofweek and dayofweek for a Sunday is the value 7 whereas in an indicator it is 0. Nicolas has reported it to PRT and we wait to see if they make some changes or whether we have to code around this.

    #97135
    Seb

    That is not the problem, I use this part of your code:

    If you have a CFD account, you can look at the ‘last week’s high’, 2 weeks ago in US crude to see that it’s off

    #97136

    Try

    but as soon as at PRT they fix the issue it will change.

    #97137
    Seb

    Many thanks Roberto!, that works

    #97138

    I just ran that code as an indicator and compared it to the weekly candles on the EURUSD (the chart I happened to have open) and the values were identical to last weeks weekly candle.

    #97139

    I just realised that the code you wrote was part of a strategy and not an indicator which is why Roberto’s solution fixes it. It is a 7 zero issue!

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

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