News Calendar Storage and Filtering for Backtesting and Live

MQL5 专家

指定

Objective

Develop an MQL5 Expert Advisor (EA) that:

1. Saves historical economic news data** from MetaTrader’s economic calendar into a `.csv` file for backtesting purposes.

2. Implements news event filtering** for both backtesting and live trading, based on user-defined parameters such as event impact level, currency, and pre/post event trade restrictions.

Scope of Work

The EA must perform the following tasks:

1. Historical News Data Retrieval and Storage:

   - Retrieve news events from MetaTrader’s built-in calendar, with user-defined filtering options for the news data to be saved (date range, importance level, and currency).

   - Save this data to a `.csv` file in the `MQL5/Files` directory.

   2. Live Trading News Event Filter:

   - Apply news event filters in live trading based on the MetaTrader calendar to prevent trading before and after high-impact news events.

   - Users should be able to customize the impact level, currencies, and the pre/post news window for the filter.

3. Backtesting with News Event Filter:

   - During backtesting, read the saved news data from the `.csv` file and apply the same news event filters to simulate how the strategy would perform under real-time news conditions

Functional Requirements

1. User Input Parameters

The EA should allow users to customize the following parameters:

1. News Data Retrieval Inputs:

   - StartYear** (`int`): The starting year for retrieving historical news data.

   - EndYear** (`int`): The ending year for retrieving historical news data.

   - Currencies*(`string`): A comma-separated list of currencies (e.g., `USD,EUR,GBP`) to filter which currencies' news data is saved.

   - ImportanceLevel (`enum`): A selection of impact levels (`High`, `Medium`, `Low`) for filtering news events during data retrieval.

   2. News Event Filter Inputs:

   - PreNewsFilterMinutes (`int`): The number of minutes before a news event during which trading should be restricted.

   - PostNewsFilterMinutes(`int`): The number of minutes after a news event during which trading should be restricted.

   - FilterCurrencies (`string`): Currencies to be filtered during live trading and backtesting (comma-separated, e.g., `USD,EUR`).

   - FilterImportance (`enum`): The impact level for news filtering (`High`, `Medium`, `Low`).

   3. File Name for Saving/Loading News Data:

   - CsvFileName (`string`): Name of the `.csv` file where news data is saved and from which it is read during backtesting.

2. News Data Retrieval and CSV File Writing

The EA should retrieve historical economic calendar data from MetaTrader, filtered by the user inputs. Once the data is retrieved, it should be saved into a `.csv` file in the `MQL5/Files` directory.

Filtering Logic for News Data Retrieval:

- Retrieve the news data using the `CalendarValueHistory` function for historical events.

- Filter the data based on the user-selected currencies, importance level, and the date range defined by `StartYear` and `EndYear`.

  3. Reading News Data for Backtesting

During backtesting, the EA should read the news events from the previously saved `.csv` file. The news events should be filtered based on the user-defined parameters (`FilterCurrencies`, `FilterImportance`) and applied to the strategy to simulate how it would perform around news events.

 

Key Features for Backtesting:

- The same filtering logic used during live trading should be applied during backtesting.

- The strategy should prevent trading before and after news events based on the `PreNewsFilterMinutes` and `PostNewsFilterMinutes` inputs.

 

4. Live Trading News Event Filter

During live trading, the EA should use MetaTrader’s built-in calendar to filter out trades around news events. The filter should prevent trades from being opened within the specified time window before and after a news event.

 

Steps for Live News Event Filtering:

1. Retrieve Upcoming News Events:

   - Use MetaTrader’s `EconomicCalendarValue` function to get the upcoming news events.

   2. **Apply Filter to Trading Logic:

   - Prevent trades from being opened within the specified pre/post news time window.

   - Filter based on the currencies and importance levels selected by the user.

 

User-Defined Inputs for Live Trading Filter:

-Currencies to Filter: Users should specify which currencies are relevant for filtering.

- Importance Levels: The EA should only consider news events of the specified importance level (e.g., High).

 

5. Additional Considerations

1. Error Handling:

   - Ensure that the EA handles file read/write errors gracefully (e.g., if the `.csv` file is missing or cannot be opened).

   - Implement proper logging for debugging purposes.

2. Optimization:

   - Efficiently manage large news data files, particularly if retrieving several years' worth of news events.

3. Performance Monitoring:

   - Include detailed logging for when trades are skipped due to news events.

 

 


反馈

1
开发者 1
等级
(390)
项目
416
30%
仲裁
74
19% / 72%
逾期
52
13%
工作中
2
开发者 2
等级
(21)
项目
25
52%
仲裁
3
0% / 100%
逾期
2
8%
空闲
3
开发者 3
等级
(9)
项目
19
16%
仲裁
3
67% / 0%
逾期
0
空闲
4
开发者 4
等级
(93)
项目
119
50%
仲裁
4
50% / 50%
逾期
3
3%
空闲
5
开发者 5
等级
(16)
项目
23
26%
仲裁
1
0% / 0%
逾期
2
9%
空闲
6
开发者 6
等级
(7)
项目
13
15%
仲裁
13
23% / 46%
逾期
3
23%
空闲
发布者: 24 文章
7
开发者 7
等级
(77)
项目
243
74%
仲裁
7
100% / 0%
逾期
1
0%
空闲
发布者: 1 文章
8
开发者 8
等级
(2)
项目
4
0%
仲裁
3
33% / 67%
逾期
2
50%
工作中
9
开发者 9
等级
(11)
项目
16
25%
仲裁
1
0% / 100%
逾期
1
6%
空闲
10
开发者 10
等级
(14)
项目
20
25%
仲裁
0
逾期
2
10%
空闲
发布者: 3 代码
11
开发者 11
等级
(17)
项目
22
36%
仲裁
5
0% / 100%
逾期
4
18%
空闲
12
开发者 12
等级
(296)
项目
475
40%
仲裁
105
40% / 24%
逾期
80
17%
繁忙
发布者: 2 代码
相似订单
* After every loss, It does not increase the lot sizes gradually. For example, after a loss of 0.01, it goes straight to 0.05 lots. It does not follow progressive order. 0.01;0.02;0.03;0.04;0.05... etc. From 0.01, it goes straight to 0.05 * Also If there is a win, it does not return to 0.01 it continues on the last lot size 0.06. After every win the EA should start again at 0.01 * I would also like to adjust the
Società di investimento con attività tra Sanremo e Monaco ricerca un giovane collaboratore con esperienza nell’utilizzo avanzato di MetaTrader 5. Si richiede la conoscenza della lingua italiana e inglese. Attività Il collaboratore si occuperà di: • eseguire backtest di strategie di trading su MT5 • effettuare ottimizzazioni parametri tramite Strategy Tester • analizzare risultati e robustezza delle strategie •
I want to create a loss recovery account.I have a zone recovery EA.It sometimes gives more buy sell entries than the target. This causes a lot of loss. I want to create an EA to reduce that loss by 40% to 50%. Example: My EA has lost $2200 with a buy sell entry. Now the new EA will give an entry that can reduce the loss from $2200 to $700
I am looking for an experienced MT5 developer to build a custom, aggressive XAUUSD scalping EA with structured basket management and momentum continuation logic. This is not a generic EA — it requires careful architecture and proper risk control. Key Requirements: Instrument & Timeframes: XAUUSD only M1 execution chart M5/M15 for directional bias and structure context Execution & Basket Logic: Aggressive basket-style
I need any highly profitable MT5 robot which trades any sythetic indices on deriv very profitably. It should have good risk management and any good strategy The EA should have good risk management and can trade small accounts like 50 - 100USD Developers who have already made robots have higher chance
CHOSEN'S BOT 30 - 50 USD
I need a scalping AI that is based on proper risk management. I want my AI to be 90%-100% profitable, it must be able to analyze the behavior of the market and take trades on it's own as the market goes.My AI must be able to work on the 1min, 5mins,15mins, 30mins and 1hour time frame only. Developer must produce your own strategy ideas for it to be highly profitable. The AI must have SL and TP. This AI must work only
I am seeking an experienced MQL5 developer to build a fully automated Expert Advisor (EA) based on Opening Range Breakout (ORB) and Fair Value Gap (FVG) concepts. The developer must have a strong understanding of these strategies and agree to the following requirements: ✅ Project Requirements & Terms 1. Functional EA Demonstration (Mandatory) The developer must demonstrate a fully functional EA that operates exactly
Mk 30+ USD
I need a fully automated trading robot designed to generate consistent profits while strictly controlling risk and minimizing losses. The robot should use a combination of strategies, including trend-following, scalping, and price action, and must be able to adapt to different market conditions such as trending and ranging markets. It should analyze the market using indicators like Moving Averages, RSI, MACD, and
Seeking developer service to code an EA. Interested developer must have good experience and understanding on how ORB and FVG works, and agreed to the terms below : 1. Shall demonstrate a fully functional EA that operates as specified in the requirement and function automatically as requested in real-time environment (forward test - demo/live), regardless of good results obtained in strategy-tester. Backtesting
Hey guys, looking for a crazy good EA / Indicator that can either help me for futures trading (eg. Topstep, Lucid Trading etc) https://t.me/nqsniperz - telegram Or looking for a CFD EA that i can run on personal accounts Budget is very high and negotiable. https://t.me/nqsniperz

项目信息

预算
50+ USD
截止日期
 1  5 天