Announcement

Collapse
No announcement yet.

getPreviousTradingDay and GMT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • getPreviousTradingDay and GMT

    with your help, I'd like to try and clarify the best use of getPreviousTradingDay ...

    user1
    - located in London GMT 0.
    - has a PC set to local time.
    - 2 x 24 hour charts, JPY & GBP.
    - efs study utilises the getPreviousTradingDay function.

    user2
    - located in Toyko GMT +9.
    - has a PC set to local time.
    - 2 x 24 hour charts, JPY & GBP.
    - efs study utilises the getPreviousTradingDay function.

    getPreviousTradingDay will generate different results for user1 & user2.

    given that both users want their PC set to local time, any suggestion on how this can be accomplished (I will code this if required and add to my fileshare).
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk

  • #2
    Hello Paul,

    Please describe in greater detail what you need to accomplish and I'll try to help you devise a solution. Based on the information you've posted I don't think the getPreviousTradingDay() function is going to work for you as it is based on each users local time.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      thanks Jason

      For a given symbol, I need to be sure that if I refer to a previous days high/low then the result is not influenced by local time.
      Paul Williams
      Strategy & Applications
      www.futurenets.co.uk

      Comment


      • #4
        Hello Paul,

        Because the advanced chart is based on each user's local time, the midnight reset for the daily bar for each user will occur at their local time, which will produce different results if you use high(-1, inv("D")). What you will have to do is write your study logic to be based on UTC time. Each bar date that you process will need to be converted to UTC time as follows.

        var myTime = getValue("time");
        var gmtTime = myTime.getUTCHours() + ":" + myTime.getUTCMinutes() + ":" + myTime.getUTCSeconds();

        Then using the gmtTime variable you will have to look for the start and end of the session for the given symbol that is also based on its UTC start/end times. Then collect the daily high/low values from the chart data with global variables or arrays using min()/max() methods of the Math object.

        In the 8.0 version we are supposed to have some new features that will allow the user to set the Advanced Chart time to local, UTC or exchange time. This should solve this type of problem. I haven't seen a beta for this yet so I'm not certain its in the 8.0 version yet.
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          thanks Jason, that would be a useful update.

          does that mean high(-1, inv("D")) is also influenced by the local time or is this okay?
          Paul Williams
          Strategy & Applications
          www.futurenets.co.uk

          Comment


          • #6
            Hello Paul,

            I don't think that will work because each user's new daily bar gets generated on the first tick after their local midnight.
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment

            Working...
            X