Download MetaTrader 5

Sunday night price bars

To add comments, please log in or register
Order a robot or an indicator for MetaTrader. The Freelance service will help you!
rgctoronto
37
rgctoronto 2017.01.04 03:34 

I trade daily bars, but the Sunday night bars are useless to me, and they skew the price patterns I'm looking for.  Is there any way to either:

a) delete these bars from the chart, or

b) blend the Sunday prices into the Monday bars (ie. make the 2 bars become one), or

c) identify a Sunday bar in my code, so that I can just tell the code to ignore those bars ?

 Thanks in advance. 

Keith Watford
Moderator
9614
Keith Watford 2017.01.04 04:21  
rgctoronto:

I trade daily bars, but the Sunday night bars are useless to me, and they skew the price patterns I'm looking for.  Is there any way to either:

a) delete these bars from the chart, or

b) blend the Sunday prices into the Monday bars (ie. make the 2 bars become one), or

c) identify a Sunday bar in my code, so that I can just tell the code to ignore those bars ?

 Thanks in advance. 

c) DayOfWeek() (mql4)

Open a demo account with a broker that does not have Sunday bars and use that for analysis.

Alain Verleyen
Moderator
30722
Alain Verleyen 2017.01.04 09:04  
rgctoronto:

I trade daily bars, but the Sunday night bars are useless to me, and they skew the price patterns I'm looking for.  Is there any way to either:

a) delete these bars from the chart, or

No. Choose a broker with no Sunday bars.

b) blend the Sunday prices into the Monday bars (ie. make the 2 bars become one), or

No. Choose a broker with no Sunday bars.

c) identify a Sunday bar in my code, so that I can just tell the code to ignore those bars ?

 Thanks in advance. 

Answered by Keith.
whroeder1
14480
whroeder1 2017.01.04 14:17  
  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.


  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. 

    EET is closer except when their DST doesn't match NY's. Last Sunday of March and 1:00 on the last Sunday of October vs second Sunday in March and return at 2:00 a.m. EDT to 1:00 a.m. EST on the first Sunday in November.

  3. 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.


  4. 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.])

Your choices are

  1. Change brokers
  2. live with it and adust
  3. Make an offline generator that changes timezone or removes the sunday bar. (You still have a short Friday, doesn't that bother you?)
Alain Verleyen
Moderator
30722
Alain Verleyen 2017.01.04 17:18  
whroeder1:

Your choices are

  1. Change brokers
  2. live with it and adust
  3. Make an offline generator that changes timezone or removes the sunday bar. (You still have a short Friday, doesn't that bother you?)
rgctoronto
37
rgctoronto 2017.01.05 22:49  

Thanks, Keith, re: DayofWeek - that's what I needed.  I'm used to it in Tradestation, but MT4 is so different that I never thought to try that.  I've coded TS for 20 years, but MT4 for only 2 days :)

whroeder1, no, short Fridays don't bother me, but if it did, I could use the DayofWeek command and just add Sunday's price action to Friday's to come up with a synthetic OHLC for Friday within my code.

 Thanks, all. 

rgctoronto
37
rgctoronto 2017.01.11 04:30  

I tried DayOfWeek() but it only seems to identify the day of the week of the current "real time" bar, whereas, I'd like to load a chart and have every Sunday identified in the past.  Is there a way to do that ?

Thanks again. 

whroeder1
14480
whroeder1 2017.01.11 15:49  
rgctoronto: I tried DayOfWeek() but it only seems to identify the day of the week of the current "real time" bar, whereas, I'd like to load a chart and have every Sunday identified in the past.  Is there a way to do that ?
  1. You posted in a MT5 section. I don't know of a DayOfWeek() function in MT5.
  2. If you meant to post in the MT4 section, Perhaps you should read the manual. TimeDayOfWeek - Date and Time - MQL4 Reference


rgctoronto
37
rgctoronto 2017.01.11 17:02  

Sorry - I went to the MT4 Section link you provided - I started a new topic there, but it quickly disappeared and this topic continues to show, on my screen, in the MT4 section - so I don't know what to do in that regard, and I apologise.

I did indeed read the MQL4 reference manual before even posting my question, and the manual implies the same thing that I'm saying - that all time and date functions return the "real time" information on the current bar, and there is no indication of how to determine the DayOfWeek on past bars.  That's why I'm asking here if anybody knows how to do it.

Thanks. 

Alain Verleyen
Moderator
30722
Alain Verleyen 2017.01.11 17:13  
rgctoronto:

Sorry - I went to the MT4 Section link you provided - I started a new topic there, but it quickly disappeared and this topic continues to show, on my screen, in the MT4 section - so I don't know what to do in that regard, and I apologise.

I did indeed read the MQL4 reference manual before even posting my question, and the manual implies the same thing that I'm saying - that all time and date functions return the "real time" information on the current bar, and there is no indication of how to determine the DayOfWeek on past bars.  That's why I'm asking here if anybody knows how to do it.

Thanks. 

I moved your topic here, and removed the new one.

WHRoeder answered in previous post.

rgctoronto
37
rgctoronto 2017.01.11 17:52  
Alain Verleyen:

I moved your topic here, and removed the new one.

WHRoeder answered in previous post.

WHRoeder only says to read the manual.  As I said I've already read the manual before I even posted my question in Post #6.  All those time & date functions return with real time values, not past values.  My question is how do I find past values ?   but I guess this isn't the forum for asking such help - sorry.

12
To add comments, please log in or register