wrong calculation for weekly data

Forums ProRealTime English forum ProBuilder support wrong calculation for weekly data

  • This topic has 2 replies, 2 voices, and was last updated 7 years ago by avatarAVT.
Viewing 3 posts - 1 through 3 (of 3 total)
  • #39552
    AVT

    Indicator is a PopGun marker. Every timeframe (based minute, hour, day, month, quarter) is calculated and therefore drawn correctly in the chart – except all weekly based data (like weekly, 2 weeks, 3 weeks…).

    Code is simple

    Incorrect weekly markers attached (I marked the correct lines with red, hope you can see it).

    Any ideas what happens here? Thanks a lot.

     

     

    #39570

    It would be much easier if you add a vertical grid on the chart.

    Your x axis is in Months and squinting my eyes and trying to line up there appears to be 4 or 5 bars in each month? Isn’t that correct? some months contain 4 Fridays and some months contain 5 Fridays?

    Or am I misunderstanding your problem?

    1 user thanked author for this post.
    avatar AVT
    #39587
    AVT

    Thanks GraHal for your answer. I have changed the code for drawing a bit, so it might be easier to see where the problem is. The code should mark the Popgun (which is the outside of an inside) with an arrow and draw range lines for the 3-candle range (1st candle, inside, outside).  This is working fine in all timeframes – except weekly. This is PRT 10.3, , IG live and it happens in index, forex, commodities but then again shares are correctly painted.

    In the picture the first two columns are all correct, from second up to month (just one quarter but that’s also ok). The third column shows the weekly result and weekbased, like 2 weeks, 3 weeks … As you can see the PG is marked one candle too early and consequently the range too. In the code I added a line to tell the value of the PGs top which is correct in week.

    I attach the script, so you can check. I have really no idea what is causing this.

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

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