Real start & end of a forex day?

 

If you want to code an EA, or trade well, for using daily charts, you need the real GMT times for start & end of a forex day.

Just asked oanda, and got the following answer:

"It is either 5pm new york time that the candle starts plotting or 12 midnight new york time that the candle starts plotting.

This is depending on the server you are using for MT4."

This answer means actually "anytime."

I wonder if someone knows a reliable answer.

 
  1. FX opens 5pm ET Sunday and ends 5pm ET Friday. Some brokers start after (6pm is common/end before (up to 15 minutes) due to low volatility.

    Swap is computed 5pm ET. No swap if no open orders at that time.

    5pm ET is the correct answer.


  2. Brokers use a variety of timezones. Their local time (with or without DST,) GMT/UTC, GMT+2, NY+7.

    Only with NY+7 does the broker's 00:00 equals 5pm ET and the start of a daily bar is the start of a new FX day.

    GMT brokers, means there is a 1 or 2 hour D1/H4 bar on Sunday (depending on NY DST,) and a short Friday bar.

    GMT+2 is close but doesn't adjust for NY DST.

    Non-NY+7, means the chart daily bar overlaps the start, and converting broker time to NY time requires broker to GMT to NY timezone conversions.


  3. If you search the web you will find differing answers. Those are all wrong (half the year) because they do not take NY DST into account (or that it changed in 2007 [important when testing history.])
     

    I guess you dont need absolute times of multiple days, rather the first and last candle of current or previous day. If so, its totally easy. Simply loop backwards with iTime(), use PERIOD_M1 and check the day, as soon as it changed, you found already the closing time of the prev day, your open time is to be found with iTime() one step forward again. This way you dont have to bother with any GMT, summertime or whatever. You get the correct results no matter where the brokers server is located - at least you match the exact times of their daily candles. 

     
    Doerk: I guess you dont need absolute times of multiple days, rather the first and last candle of current or previous day. If so, its totally easy. Simply loop backwards with iTime(), use PERIOD_M1 and check the day, as soon as it changed, you found already the closing time of the prev day, your open time is to be found with iTime() one step forward again. This way you dont have to bother with any GMT, summertime or whatever. You get the correct results no matter where the brokers server is located - at least you match the exact times of their daily candles. 
    1. No loop is required to find the first candle of the day.
         #define SECONDS int
         #define HR2400 86400 // PERIOD_D1 * 60 = 24 * 3600
      SECONDS    time(datetime when=0){
         return SECONDS((when == 0) ? TimeCurrent() : when) % HR2400;                }
      datetime   date(datetime when=0){
         return ((when == 0) ? TimeCurrent() : when) - time(when);                   }
      ////
         int iBod = iBarShift(NULL,0, date());
    2. Your answer deals with the chart, so of course you get the correct start of the day in broker time. That is irrelevant to the OPs question.
     
    WHRoeder:
    1. FX opens 5pm ET Sunday and ends 5pm ET Friday. Some brokers start after (6pm is common/end before (up to 15 minutes) due to low volatility.

      Swap is computed 5pm ET. No swap if no open orders at that time.

      5pm ET is the correct answer.


    2. Brokers use a variety of timezones. Their local time (with or without DST,) GMT/UTC, GMT+2, NY+7.

      Only with NY+7 does the broker's 00:00 equals 5pm ET and the start of a daily bar is the start of a new FX day.

      GMT brokers, means there is a 1 or 2 hour D1/H4 bar on Sunday (depending on NY DST,) and a short Friday bar.

      GMT+2 is close but doesn't adjust for NY DST.

      Non-NY+7, means the chart daily bar overlaps the start, and converting broker time to NY time requires broker to GMT to NY timezone conversions.


    3. If you search the web you will find differing answers. Those are all wrong (half the year) because they do not take NY DST into account (or that it changed in 2007 [important when testing history.])
       
      Thanks! I was doing forex on the NYSE, then did other things for  a couple of years. Wanted to be sure.
       
      Something went wrong with formatting the post. I cannot read your answer on my iPad, sorry. 
      Reason: