Latest update: version 2.05, uploaded August 4, 2010
Latest changes to this post in red typeface
Disclaimer: The attached indicator is supplied 'as is', free of charge. No warranty or obligation of support is implied. Download and use it at your own risk. I hope that you find it useful. It's the initial v2.0 release, please feel welcome to post questions, and report any bugs or shortcomings in this thread.
Note (May 25, 2010): Please take the opportunity to download this indicator while it's still available for free. I will soon be applying to become a commercial member.
_____________________
This news indicator plots the same numbered circles, above or below the MT4 chart candles, just as the old (and no longer supported) Plot_News.MQ4 did. In other words, both prior news events (so that you can see the effect that they had on price) and upcoming news events (to warn you of their imminence) are highlighted.
The major difference is that the old FFcal.EXE program does not need to be run. Instead, Recent News.EX4 gathers data directly from the internet, whenever you manually refresh the indicator (change time frames, edit the parameters, or re-attach the indicator).
Exactly as with Plot_News, hovering the mouse cursor near the top of a numbered circle shows the detail for the news event:
The first description line shows MT4 time; a description of the event; then a vertical bar followed by a 4-digit serial number (which can be ignored). If the event description is too big to fit inside MT4's character limit, a tilde (~) is used as a placeholder for missing characters.
The second description line shows local time; then (in square brackets, if the news event hasn't occurred yet) the number of hours and minutes before it will occur; the currency; the impact level (L, M or H); then the actual (A), forecast (F) and previous (P) values, separated by vertical bar symbols, if they are applicable.
The third description line simply shows the price under the mouse cursor, and can be ignored.
INSTALLATION & USE
Download the attached EX4 file into your ……/experts/indicators folder, and (if you want to input your settings via a parameter file) the TXT file into your ……/experts/files folder. Then re-start MT4.
[NOTE: if you find the idea of entering parameters via a parameter file too confusing, and wish to simply enter them using MT4's familiar dialog box (when the indicator is attached), then DON'T download the Presets---RecentNews.TXT file.]
Open MT4's Navigator (press Ctrl-N), and attach the indicator by dragging it onto the chart. You must check the 'Allow DLL imports' parameter (on the 'Common' tab) ON, every time you attach the indicator.
PARAMETERS
- Parameter File – allows you to save preset settings in the file Presets---Recent News.TXT. These values, if existing, override those entered on the MT4 dialog screen when the indicator is attached. This allows you to have 'sticky' parameters from one run to the next. See 'PARAMETER FILE' section below. This parameter now defaults to 'NONE', so that the settings entered in MT4's dialog window will be used. Delete the word 'NONE' if you wish to use those in the parameter file.
- MT4TimezoneGMTplus – Enter your MT4 broker's time zone, relative to GMT. For example, if your broker's time is GMT+2, enter 2. If your broker's time is GMT–5, enter –5. Broker time is shown at the top of MT4's Market Watch window (press Ctrl-M), provided that the market is open.
- LocalTimezoneGMTplus – Enter your local time zone (the time shown by your PC clock), relative to GMT. For example, if your local time is GMT+2, enter 2. If your local time is GMT–5, enter –5.
- ThisWeekOnly – TRUE means that the FromDate and ThruDate settings will be ignored, and only the current week's (Sunday to Saturday) news events will be plotted. [NOTE: as of v 2.05, use of this parameter has been suspended, as it is possible to download the current week's data only].
- FromDate, ThruDate – if ThisWeekOnly is set to FALSE, then only news events between the entered dates/times will be plotted. CAUTION: Setting too wide a date range could slow computer performance. [NOTE: as of v 2.05, use of these parameters have been suspended, as it is possible to download the current week's data only].
- VerticalSpacingPips – a positive value will cause the symbols to plot X pips below the candles; a negative value means that the symbols will plot above the candles. The larger the number, the further away from the candle. A zero value means that the symbols will not be plotted (i.e. but the ShowUpcomingXEvents and alert facilities continue to operate).
- ClearanceFactor – a larger number gives greater clearance, preventing symbols plotted on adjacent candles from obscuring each other.
- SymbolSize – controls the size of the plotted symbols; should be a value between 0 (smallest) and 5 (largest) inclusive. A negative value means that the symbols will not be plotted (i.e. but the ShowUpcomingXEvents, alert and export facilities continue to operate).
- TimeFrames – the plotted news events will only be shown on the timeframes that you specify. Entries may be upper or lowercase, and must be separated by commas.
- PlotTheseImpacts – an H (upper or lowercase) anywhere in your entry means that High Impact events will be retrieved and plotted; likewise with an M and/or L for medium and low impact events, respectively. Commas and/or spaces may be added for readability, if desired.
- HighImpactColor – the color used to plot high impact news events. Same logic applies for medium and low impact events. The default colors are Red for high impact, Orange for medium impact, Yellow for low impact.
- RelevantCcyChartsOnly – if TRUE, then (for example) only GBP and JPY related news events will be plotted on a GBPJPY chart. If FALSE, all news events will be plotted.
- WingdingforXXX – the Wingding symbol code used to plot news events for currency XXX. The default symbols are (1) for USD, (2) for CAD, (3) for EUR, (4) for GBP, (5) for CHF, (6) for JPY, (7) for AUD, (8) for NZD, (0) for anything else. If you set a value to zero, then symbols for that currency will not be plotted.
- ShowUpcomingXEvents – if set to a value less than 1, this facility is effectively disabled. Otherwise the next X upcoming events will be printed on the screen in a 'rolling window'. The EventFont, EventFontSize and EventScreenCorner (0=top left; 1=top right; 2= bottom left; 3 = bottom right) control the printing style and position.
- RefreshEveryXMins – this deletes, recalculates and re-plots all of the screen objects every X minutes. A value of –1 means that this will occur only when the indicator is first attached, or a manual refresh takes place. A value of 0 means an update occurs with every new tick. A value of 1, 5, 15, 30, 60 or 240 means that an update occurs immediately a new M1, M5, M15, M30, H1 or H4 candle starts to form, regardless of the chart timeframe to which the indicator is attached. This parameter has no bearing on when the news data is re-gathered from the web page, which only occurs when a manual refresh takes place (when you change time frames, edit the parameters, or re-attach the indicator).
- AlertXMinsBeforeNews – a negative value disables alerts. A zero or positive value will cause an audible/visual alert to occur X minutes before each news event (0 means at the time of the event). Each event should only alert once; however, if you perform a manual refresh, the indicator's memory is completely reset.
- OutputFile – a non-blank value means that an export (CSV) file of this name will be created in the ……/experts/files folder. The data output can then be imported into other applications (Excel, for example) for further analysis. One line is output for each news event, and all of the parameters that follow determine which fields will be output, and the formats that will be used to output them.
- Delimiter – type the character you wish to be used to delimit the fields in the export. Usually this will be a comma (,), semicolon (; ) or a space (if you want to produce a columnar table). You can also type a caret (^) to represent a TAB. All carets in each export line will get converted to tabs just before the line is output. See the EXPORT SAMPLES section below.
- EncloseInQuotes – TRUE means that each field in the output will be enclosed in double quotes ("). FALSE means they won't.
- Date_GMT_MT4_Local – determines which date/time will be output. Enter G for GMT, M for broker MT4 time, or L for local time. Upper or lowercase doesn't matter.
- DateTimeMask – leave the field empty if you don't want the date/time to be exported. Otherwise your entry determines how the date/time will be formatted. All except 'reserved' characters will be output 'as is'. You can include your delimiter in the mask, if you want the date and time to be separate fields. Reserved characters include D for the day of the month; M for the month of the year; Y for a 4-digit year; W or w for the day of the week (Sunday, Monday; or Sun, Mon, etc); N or n for the name of the month (January, February; or Jan, Feb, etc); H for the hour; I for the minute; S for the second; A for am/pm. Usually a lowercase token results in an abbreviated form of its uppercase equivalent (e.g. Y causes a 4-digit year to be output; y causes a 2-digit year to be output).
- CurrencyMask – leave the field empty if you don't want the Currency to be exported. Otherwise your entry determines how the Currency field will be formatted. All except 'reserved' characters will be output 'as is'. Reserved characters are L<integer>, C<integer>, R<integer> and T<integer>, which will result in the currency value being left-aligned, centered, right-aligned, or output as is into a sub-field that is <integer> characters wide, either truncated to the first <integer> characters, or padded with spaces, if of insufficient length. Use L<integer> to create a columnar report.
- DescrMask – leave the field empty if you don't want the event description to be exported. Otherwise your entry determines how the description field will be formatted. All except 'reserved' characters will be output 'as is'. Reserved characters are L<integer>, C<integer>, R<integer> and T<integer>, which will result in the currency value being left-aligned, centered, right-aligned, or output as is into a sub-field that is <integer> characters wide, either truncated to the first <integer> characters, or padded with spaces, if of insufficient length. Use L<integer> to create a columnar report.
- ImpactMask – leave the field empty if you don't want the Impact to be exported. Otherwise your entry determines how the Impact field will be formatted. All except 'reserved' characters will be output 'as is'. Reserved characters are L<integer>, C<integer>, R<integer> and T<integer>, which will result in the currency value being left-aligned, centered, right-aligned, or output as is into a sub-field that is <integer> characters wide, either truncated to the first <integer> characters, or padded with spaces, if of insufficient length. For example, T1 would result in merely a H, M or L being output.
- ActualMask – leave the field empty if you don't want the Actual value to be exported. Otherwise your entry determines how the Actual field will be formatted. If you simply use a text mask (L<integer>, C<integer>, R<integer> or T<integer> - as explained above) the content of the field will be displayed as straight text. However if you precede the mask with a N, then all non-numeric characters (everything except 0 thru 9, a minus symbol and a decimal point) will be stripped out, and the resulting number will be formatted according to a numeric mask. For example, NTR-9.1 means output the number into a field that allows 9 digits max to the left of the decimal point, and 1 digit max to the right. The – means display a leading minus symbol, if the value is negative. The R means to round the number to the specified (1, in this case) number of decimals. The T means trim any leading or trailing spaces from the field, thereby compacting it. You can also include ( to have negative values enclosed in parentheses, $,£,¥,etc for floating currency symbols, a comma (,) to have commas separate every 3 integer digits, L to left align the field, % for a trailing percent symbol, a semi-colon to reverse the use of the comma and decimal point, a Z to zero fill any unused integer positions, a B to blank the whole field if its value is zero, and an asterisk (*) to display an asterisk if there is numeric overflow (the integer part of the number is too large to fit in the field). Alphabetic tokens in the mask may be upper or lowercase.
- ForecastMask – this works exactly the same as the ActualMask parameter, determining whether the Forecast value will be output, and if so, how it will be formatted.
- PreviousMask – this works exactly the same as the ActualMask parameter, determining whether the Previous value will be output, and if so, how it will be formatted.
EXPORT SAMPLES
Here are 4 sample outputs, and the parameters used to generate them:
Example 1: Comma separated output ================================= Delimiter = ","; EncloseInQuotes = false; SerialNoMask = "Z4"; Date_GMT_MT4_Local = "M"; DateTimeMask = "M/D/Y,H:I"; CurrencyMask = "T3"; DescrMask = "T65"; ImpactMask = "T1"; ActualMask = "T20"; ForecastMask = "T20"; PreviousMask = "T20"; 0001,12/06/2009,13:01,NZD,QV House Prices (YoY) (NOV),L,1.0%,,0.2% 0002,12/07/2009,00:30,AUD,AiG Perf of Construction Index (NOV),L,47.6,,50.9 0003,12/07/2009,01:50,JPY,Official Reserve Assets (NOV),L,$1073.7B,,$1056.8B 0004,12/07/2009,02:30,AUD,ANZ Job Advertisements (MoM) (NOV),L,5.2%,,-1.7% 0005,12/07/2009,11:30,EUR,Sentix Investor Confidence (DEC),L,-5.5,,-7.0 0006,12/07/2009,13:00,EUR,German Factory Orders s.a. (MoM) (OCT),L,-2.1%,0.8%,1.3% 0007,12/07/2009,13:00,EUR,German Factory Orders n.s.a. (YoY) (OCT),L,-8.5%,-6.2%,-12.8% 0008,12/07/2009,15:30,CAD,Building Permits (MoM) (OCT),L,18.0%,1.0%,3.2% 0009,12/07/2009,19:00,USD,Bernanke Speaks to Economic Club of Washington Lunch,L,,, 0010,12/07/2009,21:01,NZD,New Zealand Manpower Survey (1Q),L,14.0%,,1.0% 0011,12/07/2009,21:01,AUD,Australia Manpower Survey (1Q),L,19.0%,,9.0% 0012,12/07/2009,22:00,USD,Consumer Credit (OCT),M,-$3.5B,-$9.4B,-$8.8B (R+) 0013,12/07/2009,23:45,NZD,Manufacturing Activity (3Q),M,-5.1%,,-4.8% 0014,12/08/2009,00:45,USD,New York Fed President Dudley Speaks at Columbia University,L,,, 0015,12/08/2009,01:50,JPY,Current Account Total (OCT),L,1397.6B,1483.2B,1567.9B 0016,12/08/2009,01:50,JPY,Adjusted Current Account Total (OCT),L,1376.2B,1564.9B,1338.0B 0017,12/08/2009,01:50,JPY,Trade Balance - BOP Basis (OCT),L,949.0B,864.6B,599.2B Example 2: Numeric values enclosed in quotes (suitable for import into Excel) ============================================================================= Delimiter = ","; EncloseInQuotes = true; SerialNoMask = ""; Date_GMT_MT4_Local = "M"; DateTimeMask = "Y-M-D`,`H:I"; CurrencyMask = "T3"; DescrMask = "T65"; ImpactMask = "T6"; ActualMask = "NTRB,-6.1"; ForecastMask = "NTRB,-6.1"; PreviousMask = "NTRB,-6.1"; "2009-12-06","13:01","NZD","QV House Prices (YoY) (NOV)","Low","1.0","","0.2" "2009-12-07","00:30","AUD","AiG Perf of Construction Index (NOV)","Low","47.6","","50.9" "2009-12-07","01:50","JPY","Official Reserve Assets (NOV)","Low","1,073.7","","1,056.8" "2009-12-07","02:30","AUD","ANZ Job Advertisements (MoM) (NOV)","Low","5.2","","-1.7" "2009-12-07","11:30","EUR","Sentix Investor Confidence (DEC)","Low","-5.5","","-7.0" "2009-12-07","13:00","EUR","German Factory Orders s.a. (MoM) (OCT)","Low","-2.1","0.8","1.3" "2009-12-07","13:00","EUR","German Factory Orders n.s.a. (YoY) (OCT)","Low","-8.5","-6.2","-12.8" "2009-12-07","15:30","CAD","Building Permits (MoM) (OCT)","Low","18.0","1.0","3.2" "2009-12-07","19:00","USD","Bernanke Speaks to Economic Club of Washington Lunch","Low","","","" "2009-12-07","21:01","NZD","New Zealand Manpower Survey (1Q)","Low","14.0","","1.0" "2009-12-07","21:01","AUD","Australia Manpower Survey (1Q)","Low","19.0","","9.0" "2009-12-07","22:00","USD","Consumer Credit (OCT)","Medium","-3.5","-9.4","-8.8" "2009-12-07","23:45","NZD","Manufacturing Activity (3Q)","Medium","-5.1","","-4.8" "2009-12-08","00:45","USD","New York Fed President Dudley Speaks at Columbia University","Low","","","" "2009-12-08","01:50","JPY","Current Account Total (OCT)","Low","1,397.6","1,483.2","1,567.9" "2009-12-08","01:50","JPY","Adjusted Current Account Total (OCT)","Low","1,376.2","1,564.9","1,338.0" "2009-12-08","01:50","JPY","Trade Balance - BOP Basis (OCT)","Low","949.0","864.6","599.2" Example 3: Columnar table output ================================ Delimiter = " "; EncloseInQuotes = false; SerialNoMask = "4"; Date_GMT_MT4_Local = "M"; DateTimeMask = "w D n Y H:Ia"; CurrencyMask = "L3"; DescrMask = "L65"; ImpactMask = "L8"; ActualMask = "L14"; ForecastMask = "L14"; PreviousMask = "L14"; 1 Sun 06 Dec 2009 01:01pm NZD QV House Prices (YoY) (NOV) Low 1.0% 0.2% 2 Mon 07 Dec 2009 12:30am AUD AiG Perf of Construction Index (NOV) Low 47.6 50.9 3 Mon 07 Dec 2009 01:50am JPY Official Reserve Assets (NOV) Low $1073.7B $1056.8B 4 Mon 07 Dec 2009 02:30am AUD ANZ Job Advertisements (MoM) (NOV) Low 5.2% -1.7% 5 Mon 07 Dec 2009 11:30am EUR Sentix Investor Confidence (DEC) Low -5.5 -7.0 6 Mon 07 Dec 2009 01:00pm EUR German Factory Orders s.a. (MoM) (OCT) Low -2.1% 0.8% 1.3% 7 Mon 07 Dec 2009 01:00pm EUR German Factory Orders n.s.a. (YoY) (OCT) Low -8.5% -6.2% -12.8% 8 Mon 07 Dec 2009 03:30pm CAD Building Permits (MoM) (OCT) Low 18.0% 1.0% 3.2% 9 Mon 07 Dec 2009 07:00pm USD Bernanke Speaks to Economic Club of Washington Lunch Low 10 Mon 07 Dec 2009 09:01pm NZD New Zealand Manpower Survey (1Q) Low 14.0% 1.0% 11 Mon 07 Dec 2009 09:01pm AUD Australia Manpower Survey (1Q) Low 19.0% 9.0% 12 Mon 07 Dec 2009 10:00pm USD Consumer Credit (OCT) Medium -$3.5B -$9.4B -$8.8B (R+) 13 Mon 07 Dec 2009 11:45pm NZD Manufacturing Activity (3Q) Medium -5.1% -4.8% 14 Tue 08 Dec 2009 12:45am USD New York Fed President Dudley Speaks at Columbia University Low 15 Tue 08 Dec 2009 01:50am JPY Current Account Total (OCT) Low 1397.6B 1483.2B 1567.9B 16 Tue 08 Dec 2009 01:50am JPY Adjusted Current Account Total (OCT) Low 1376.2B 1564.9B 1338.0B 17 Tue 08 Dec 2009 01:50am JPY Trade Balance - BOP Basis (OCT) Low 949.0B 864.6B 599.2B Example 4: Academic Interest only ================================= Delimiter = ","; EncloseInQuotes = false; SerialNoMask = ""; Date_GMT_MT4_Local = "M"; DateTimeMask = ""; CurrencyMask = "T3"; DescrMask = "T65"; ImpactMask = ""; ActualMask = "A=T14"; ForecastMask = "F=T14"; PreviousMask = "P=T14"; NZD,QV House Prices (YoY) (NOV),A=1.0%,F=,P=0.2% AUD,AiG Perf of Construction Index (NOV),A=47.6,F=,P=50.9 JPY,Official Reserve Assets (NOV),A=$1073.7B,F=,P=$1056.8B AUD,ANZ Job Advertisements (MoM) (NOV),A=5.2%,F=,P=-1.7% EUR,Sentix Investor Confidence (DEC),A=-5.5,F=,P=-7.0 EUR,German Factory Orders s.a. (MoM) (OCT),A=-2.1%,F=0.8%,P=1.3% EUR,German Factory Orders n.s.a. (YoY) (OCT),A=-8.5%,F=-6.2%,P=-12.8% CAD,Building Permits (MoM) (OCT),A=18.0%,F=1.0%,P=3.2% USD,Bernanke Speaks to Economic Club of Washington Lunch,A=,F=,P= NZD,New Zealand Manpower Survey (1Q),A=14.0%,F=,P=1.0% AUD,Australia Manpower Survey (1Q),A=19.0%,F=,P=9.0% USD,Consumer Credit (OCT),A=-$3.5B,F=-$9.4B,P=-$8.8B (R+) NZD,Manufacturing Activity (3Q),A=-5.1%,F=,P=-4.8% USD,New York Fed President Dudley Speaks at Columbia University,A=,F=,P= JPY,Current Account Total (OCT),A=1397.6B,F=1483.2B,P=1567.9B JPY,Adjusted Current Account Total (OCT),A=1376.2B,F=1564.9B,P=1338.0B JPY,Trade Balance - BOP Basis (OCT),A=949.0B,F=864.6B,P=599.2B
To remove the nuisance of having to retype the same parameter settings every time you attach the indicator to a chart, you have two options:
1. Use MT4 templates (but these overwrite any other indicators, objects, etc that you also have on the chart). In this case, the indicator settings are defined when you attach or edit the indicator, using MT4's built-in dialog.
2. Use parameter file(s), as follows:
- If you enter nothing or TXT into the ParameterFile setting, then the indicator looks for a parameter file called Presets---Recent News.TXT in the ...../experts/files folder.
- If you enter any other text (e.g. XXX, 001, etc) into the ParameterFile setting, then the indicator looks for a parameter file called Presets---Recent News.XXX, Presets---Recent News.001, etc in the ...../experts/files folder. (This allows you to set up a different definition in each file, then simply enter the file suffix when you attach the indicator).
If the file can't be found, then the settings in MT4's dialog will be used. If the file is found, then the settings in the file will be used instead. Hence if you want to force the use of the MT4 dialog settings, simply enter the name of a non-existent file.
Use a text editor like Notepad to view and/or edit the parameter presets files.
To disable an entry in the file, start the line with two slashes (//). (This means that the setting specified in the MT4 dialog will be used.) To re-enable it, remove the slashes. If you have multiple 'unslashed' entries in the file, the last will be used.
You may use any number of embedded spaces or underscores, and/or any combo of upper or lower case, to aid readability, however you wish. The only exceptions are FromDate and ThruDate, which must be entered exactly in the form YYYY.MM.DD<space>HH:MM
Every line in the file (including blank lines, and lines beginning with two slashes) MUST end with a semi-colon (; ). Failure to do this will cause unpredictable results.
To save typing and improve accuracy, copy/paste the sample lines in the file. To disable the entire file, rename it, or delete its content.
To have any changes take immediate effect, either (1) re-attach the indicator to your chart; (2) edit the indicator (press Ctrl-I); or (3) toggle between timeframes. Otherwise the chart will not be refreshed/re-plotted until the RefreshEveryXMins setting takes effect.
CHANGE HISTORY
v 2.00: Initial release.
v 2.01: Made the following fixes:
1. The CSV file was occasionally incorrect when retrieved by passing GMT+X to the internet. The indicator now passes GMT only, and makes the time shift (adjusting to broker time) at the MT4 'end' of the process.
2. Colors for H/M/L impact are now entered directly from the MT4 palette. A new parameter PlotTheseImpacts now determines which events are retrieved.
3. You can now also suppress the plotting of the numbered circles by setting SymbolSize to 0 (i.e. works the same as setting VerticalSpacingPips to 0).
4. If ThisWeekOnly = FALSE, FromDate and ThruDate not only define which weeks' CSV files will be retrieved and processed, but also act as an accurate filter as to which days' events will actually be plotted.
5. Now has an in-built safety check that ThruDate can't be more than 7 days beyond today's date. Previously it was possible to attempt retrieval of many non-existent CSV files, and thereby put MT4 into a seemingly endless loop, by entering a ThruDate too far into the future.
v 2.02: Export facilities have been enhanced. See relevant section above.
v 2.03: Changed the way SymbolSize now operates. A zero value will plot tiny news objects; use a negative value to suppress the plotting of the objects altogether.
v 2.04: Improved the vertical spacing calculation with respect to the ClearanceFactor parameter.
v 2.05: Interim fix that downloads the same news data via a different link. Is restricted to downloading news for the current week only; the date range parameters are no longer available.
________________________________
Indicators by Hanover:
Recent Strength
Recent Prices
Recent Candles
Recent SR
Recent News
________________________________