Hello, I was really missing newsfilter for backtesting EA.
So I figured out how to make a newsfilter for backtesting, the newsfilter is reading a csv file and plots the news in the backtester chart.
Link for the project: https://fxdreema.com/shared/iz0WMIVJd
Source code of the project: 0_1620495687291_Backtest newsfilter.mq4
A screenshot of how it looks like in backtester:
If you use the project share link and not import the source code, here's the Constants and variables to add in pictures below:
Now you will need to download the news from FXStreet
First you choose the period for news, it looks like max period at time is 3 months. So if you want more than 3 months historical data then you will need to download all periods and merge it to a csv file.
After you choose period for news you will need to download the list, like in picture below:
After the newslist is downloaded, you will need to edit the list. I am using EmEditor for that.
Open your csv file in EmEditor (Ctrl-O)
File open in editor:
First thing to do is to delete the first column, right click on the top of the first column and select delete column
Column deleted:
Now we need to split the date and time column, rightclick on the Date time column and select "Split column"
In the Split column window, make one space(spacrebar) in Seperator entry and click Ok button
The Date and Time(hours) is now splitted into 2 columns
Next step is to convert the Date format so MT4 can use it, open replace window (Ctrl-H)
In the "Find" you write exactly this string: ([0-9]{1,2})/([0-9]{1,2})/([0-9]{2,4})
In the "Replace with" you enter exactly this string: \3.\1.\2
Choose regular Expressions and click on "replace all" button.
The list now looks like this:
Now select all columns in the first row, then rightclick and select "Delete" from the dropdown menu.
Ok! The list is now finnished, you can now save it.
You need to put the list(csv file) in your terminal ./tester/files/ folder
In MT4 backtesting Expert properties remember to write in the file name for the file you just putted in the tester/files folder.
That's it, I hope you enjoy my newsfilter for backtesting