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.
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
Swap is computed 5pm ET. No swap if no open orders at that
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
Non-NY+7, means the chart daily bar overlaps the
start, and converting broker time to NY time requires broker to GMT to NY
Your choices are
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.
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 ?
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.
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.