Announcement

Collapse
No announcement yet.

Distinguish Globex and Cash_Close on future

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

  • Distinguish Globex and Cash_Close on future

    Hello,
    I discover this forum.
    I work with the pivots points on future market. I wish to choose between two types of close : the close at the time of cash close and the close of the globex. For example, Dax Index Cash close at 17:30 and Dax future close at 22:00. But if I read the future close in time frame "daily" it is not the same close as the close in an intraday time frame.
    By code, I see that there is a difference between these two types of results :
    first way :
    xClose = close(inv("D"));
    vClose = xClose.getValue(-1);

    and vClose is used in the calculus of pivot point

    second way :
    if(day(0)!=day(-1)) vClose = close(-1)

    and vClose is used in the calculus of pivot point

    the result is not the same with these two ways.
    Could you explain me why there is a difference ? and how to choose the right variable to obtain the close at the time of the close of cash and the close at the end of the globex session ?
    Thanks.

  • #2
    for a 24hr (well, overnight) market, "if(day(0)!=day(-1))" will give you a midnight close, not what you want? You might want to add code to print the hour() and minute() of the candles to help debug it. As for "automagically" knowing when either the cash or the globex close are, I don't know of a way that doesn't involve using a time template that includes the globex (and thus day) hours and manually coding the two times as a comaprsion against each candles' hour and minute value (done at NEWBAR time).

    Comment


    • #3
      thank you for your answer.
      But I am not sure to understand you. I had understood that the two way are differents, and the solution you wrote is the right to me to use the close of the globex session.
      what I search too is to know at what time or on what bar is the close of the time (of cash close).
      What do you think about finding a close different if my time frame is daily and if my time frame is intraday ?
      And when I search on the chart with intraday time frame (and try differents kind of time frame) I never find the bar with a close equal to that close seen in daily time frame ? How understand that ?
      Does exist a specific a code with my market to precise if I want to work with just the cash session time or with the complete session cash time and globex time, (what you call 24h session) ? Thanks.

      Comment

      Working...
      X