OpenDayOfWeek monday sunday data buggy ?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #112477 quote
    ctu_traderctu_trader
    Participant
    Junior

    Hello,

    With IG DAX 30 cash 1€, first hour monday data are interpreted as sunday data by PRT as indicated by the OpenDayOfWeek function (= 0)

    This means that lots of computation are faulty. For example a simple 2-day moving average will return a bad value on monday since it uses monday and sunday instead of monday and friday

    When i checked with IG web platform, it’s ok, there’s no sunday data and the simple 2-day moving average is working fine.

    I tried changing timezones without success. Is it an already opened bug ?

     

    platform used : IG Sponsored PRT v10.3

    example : DAX 30 H1 + friday november 1th, sunday november 3th, monday november 4th. Just check OpenDayOfWeek value to see the problem.

    #120466 quote
    PaulPaul
    Participant
    Master

    I had the same problem.

    A trade must be opened after the 4th hour on stop.

    But simply using hour > 4 doesn’t work on the first hour on monday.

    To prevent this I tried dayofweek>0 or >=1, time<>000000, intradaybarindex>=1 etc. to no avail.

    so I settled for this

    if dayofweek=5[1] and hour[1]=22 then
    skipmondayhourone=0
    else
    skipmondayhourone=1
    endif
    #120472 quote
    VonasiVonasi
    Moderator
    Master

    OPENDAYOFWEEK returns the day at the open of a candle and as the candle opens at 0000 that is technically midnight Sunday. Use DAYOFWEEK instead which returns the day at the close of the candle which will be Monday.

    #120483 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    00:00:00 is the new day worldwide and the label on the chart clearly shows it, but PRT consider it both ways, say 1h TF:

    • the tag on the charts reads Monday (new day)
    • IntraDayBarIndex is 0 (Monday, new day)
    • OpenDayOfWeek returns 0 (sunday, previous day)

    OpenDayOfWeek is obviously incorrect!

    #120485 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This can be due to IG closing the day at 01:00:00 Utc+, still it is not correct to assign that same bar different interpretations according to what you look to read it.

    #120486 quote
    VonasiVonasi
    Moderator
    Master

    OpenDayOfWeek is obviously incorrect!

    I don’t think that it is incorrect. If we think that our open time is actually the same as our close time of the previous candle or segment of time where a candle could be created then our previous candle closed at midnight Sunday and so we have to say that the next one opened at midnight Sunday.

    #120487 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    It cannot be correct to assign it OpenDayOfWeek=0 and IntraDayBarIndex=0.

    Which one shall I trust?

    #120488 quote
    VonasiVonasi
    Moderator
    Master

    Why not? The IntradayBarIndex is just a daily candle count starting at zero it is not associated with the open or the close – it is just saying here is the first candle of the day! The open has to be given a time and day and it is given the same time and day as the close of the previous candle. Seems logical to me.

    #120494 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    How can it be the first candle of the day (monday) if you call it sunday’s candle?

    Anyway, after struggling with this many times I have worked it around, so I hope they don’t change it!

    #120499 quote
    VonasiVonasi
    Moderator
    Master

    You don’t call it Sunday’s candle you call the open of the candle Sunday because it was midnight Sunday that it opened.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

OpenDayOfWeek monday sunday data buggy ?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
ctu_trader @ctu_trader Participant
Summary

This topic contains 9 replies,
has 4 voices, and was last updated by VonasiVonasi
6 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/09/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...