DayOfWeek() function return wrong value

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #161746 quote
    dbl007dbl007
    Participant
    Junior

    The DayOfWeek() function return wrong value when the local time of the chart data is not UTC +00.

    I attached 2 example charts with local time that is UTC +08.  The instruments are Hangseng index and Xinhua index.  In the bottom of the chart I added an indicator to display DayOfWeek().

    From the datetime time line you can see the dayOfweek() retun value is out of sync with the date by 8 hours.

    For chart with local time UTC +00,  the DayOfWeek() is in sync with the date. See XBTUSD .

    Is this a bug?

    HanSeng.jpg HanSeng.jpg xinhua.jpg xinhua.jpg xbtusd.jpg xbtusd.jpg
    #161795 quote
    NicolasNicolas
    Keymaster
    Legend

    It uses the market time of the contract not your own custom hours.

    #183592 quote
    MonobrowMonobrow
    Participant
    Senior

    Ok,

    Is there a way we can code around this? or just have to use market time? thanks!

Viewing 3 posts - 1 through 3 (of 3 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

DayOfWeek() function return wrong value


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
dbl007 @dbl007 Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by MonobrowMonobrow
4 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/17/2021
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...