Download MetaTrader 5
To add comments, please log in or register
Having difficulties in understanding the Trading Signals service? Read the article!
thetraderjester
12
thetraderjester 2016.03.26 13:24 

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.

whroeder1
13627
whroeder1 2016.03.26 15:24  
  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.])
    Doerk Hilger
    1073
    Doerk Hilger 2016.03.27 07:02  

    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. 

    whroeder1
    13627
    whroeder1 2016.03.27 13:00  
    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.
    thetraderjester
    12
    thetraderjester 2016.03.27 16:02  
    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.])
      thetraderjester
      12
      thetraderjester 2016.03.27 16:03  
      Thanks! I was doing forex on the NYSE, then did other things for  a couple of years. Wanted to be sure.
      Doerk Hilger
      1073
      Doerk Hilger 2016.03.27 16:04  
      Something went wrong with formatting the post. I cannot read your answer on my iPad, sorry. 
      /
      To add comments, please log in or register