Announcement

Collapse
No announcement yet.

getting the correct Daily price for Hong Kong market

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

  • getting the correct Daily price for Hong Kong market

    Hi,

    How can obtain the correct daily OHLC price for the Hong Kong market while I'm at NYC (or ET) time?

    Currently, eSignal gives me the wrong OHLC. For example, at ET 1:00am 9/27 (or 1pm HK time 9/27), close(-1) actually gives me the close price at ET 00:00 9/27 (or 12pm HK time 9/27) which is only just the middle of the HK trading session. The correct close(-1) should give the price at closing of the previous HK trading session which is 9/25 4pm HK time.

    I wonder if there's an easy way around this problem.

    William

  • #2
    William
    I ran a test at 1:00am ET of 9/28 on a daily chart of HSI V7-HKF and from what I am seeing close(-1) is returning the Close of the prior day (ie 9/27). You can see the result of the test in the enclosed screenshot which also shows the script that was used
    Alex

    Comment


    • #3
      Hi Alex,

      Sorry for not making it more clear. I was using the intraday chart, 5-min., and used the statements like the following:

      (
      PHP Code:
      if (getBarState() == BARSTATE_NEWBAR && getCurrentBarIndex()>=0) {
       
          
      debugPrintln(getCurrentBarCount()+" "+getHour(0)+":"+getMinute(0));
          
      debugPrintln(low(0sym(getSymbol()+",D"))+" "+low(-1sym(getSymbol()+",D"))+" "+close(0sym(getSymbol()+",D"))+" "+close(-1sym(getSymbol()+",D")));
          

      The chart symbol that I used was 0001-HKG, 5 min interval.

      Regards,

      William

      Comment


      • #4
        Hi Alex,

        I haven't heard from you, so I thought I give you a ping.

        I have been using the intraday charts and the daily prices are incorrect (please see below). Is that a problem on the efs side, or was it something I didn't do correctly?

        Regards,
        William

        Comment


        • #5
          William
          I ran a test yesterday and was planning on repeating the same test this morning however the Hong Kong market was closed today.
          Anyhow here are the results of yesterday's test. As far as I can see the values returned by the script appear to be correct so I don't believe the issue you are seeing is related to EFS. You may want to check that the actual charts for the intervals called by the efs are plotting the correct data. Keep in mind that when you use the sym() and/or inv() functions all you are effectively doing is creating in the background a chart for that symbol and/or interval and then referencing it in your calculations.
          If you are seeing a problem with the underlying data (not the efs) then I would suggest that you contact directly eSignal's support via LiveRep who are best equipped to verify these kinds of issues and to provide the appropriate guidance
          Alex

          Comment


          • #6
            Hi Alex,

            The close(0) that shows 29569 is correct as it gives the closing price of the latest bar. However, your close(-1) that gives 28771 seems to be incorrect.

            The time shown was 10/18 01:23AM ET which is 10/18 01:23PM Hong Kong time, in which case close(-1) or close(0, sym(getSymbol()+",D") should give the closing price on the date 10/17. From your graph it should be around 29300.

            So there seems to be a discrepancy.

            William

            Comment


            • #7
              William
              I cannot explain that discrepancy at this time other than that there must have been an issue with the daily bars which I did not notice. Unfortunately I did not include a daily chart in that snapshot.
              Anyhow enclosed below are the results of last night's test. The script was modified to also plot the current and previous daily closes and the snapshots now include an inset daily chart for confirmation. The first snapshot was taken at 10 minutes past midnight ET and the second at 1:00am ET (on a Reload of the efs to retrieve the system time as the market was inactive at the time). The last screenshot was captured shortly after 2:30am ET once the afternoon session started.
              From what I am seeing close(0,sym(...)) is returning the current day's Close (ie of 10/31) and close(-1,sym(...)) is returning the Close of 10/30 which was 31570. These values appear to be correct.
              Alex










              Originally posted by whammer
              Hi Alex,

              The close(0) that shows 29569 is correct as it gives the closing price of the latest bar. However, your close(-1) that gives 28771 seems to be incorrect.

              The time shown was 10/18 01:23AM ET which is 10/18 01:23PM Hong Kong time, in which case close(-1) or close(0, sym(getSymbol()+",D") should give the closing price on the date 10/17. From your graph it should be around 29300.

              So there seems to be a discrepancy.

              William

              Comment

              Working...
              X