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 코드
비슷한 주문
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
I’m looking to partner with an experienced developer who has a proven, working EA that delivers stable and consistent monthly performance . A bit about me: I run an active trading community and a TikTok channel that consistently drives targeted traffic and potential clients into my ecosystem. I’m now looking to collaborate with the right developer to scale EA distribution and monetisation together . What I’m Looking
Need trading robot 50 - 70 USD
I need a robot for trading gold and currencies . I need to use it with metatrader 4 and 5 . My budget is not high . Max . 70 USD. I need to be able to start and stop it at any time without restrictions
am looking for an experienced MQL5 developer to build a high-frequency trading Expert Advisor (EA) for XAUUSD (Gold) on M1 and M5 timeframes . The EA must include advanced execution logic, dynamic pending orders, risk management, and news/session filters. Clean, efficient, and well-documented code is required. Strategy type: Scalping (fast trades, quick profit). Very fast execution logic (optimized for speed). Goal
Title: MT5 EA Needed – Prop‑Firm Compliance Tool (SL/TP at Entry, 60‑Second Hold, Daily Profit Cap, 0.5% XAUUSD Risk) Description: I need an MT5 Expert Advisor that enforces prop‑firm compliance rules for Instant Funding accounts. The EA must NOT trade automatically — it should only monitor and control my manual XAUUSD trading. I trade all sessions, so there should be no time restrictions. MY TRADING STYLE (Important
​1. Project Overview ​ Asset: XAUUSD (Gold) ​ Timeframe: M1 (1-Minute) for execution; M5/M15 for trend filtering. ​ Objective: Execute high-frequency scalps during peak liquidity (London/NY overlap) to capture 10–30 pip movements with high precision. ​ Core Logic: The "Poverty Bot" strategy relies on Mean Reversion combined with Momentum Burst (Price Action + RSI/EMA filters). ​2. Strategy Logic (The "Poverty"
I need any highly profitable robot which can trade small account like 50-100USD and any currency pair(s) The robot should avoid trading around news time and have good risk management. It should use any strategy which is profitable and not those unacceptable by brokers. Demo versions will be required before selection
Hi, I hope you doing Greate, Let me share details , so the original EA already working but you can check and verify everything fine.First you verify that all original EA features are working correctly then add a user dashboard showing the number of detected zones, buy sell both none status, and an on off button. also ensure mitigated zones disappear properly and that trades follow the zone rules, and integrate the
I need a high-speed Expert Advisor (EA) for MT5 designed specifically for XAUUSD (Gold) scalping. The bot should focus on fast entries and quick profits with high efficiency. Main requirements: 1. Symbol: XAUUSD (Gold only). 2. Platform: MetaTrader 5. 3. Strategy type: Scalping (fast trades, quick profit). 4. The bot should open trades frequently based on fast market movements. 5. Small Take Profit (quick profit
Gold_m1_ob_bot. 30+ USD
import MetaTrader5 as mt5 import pandas as pd import time from datetime import datetime # ================== CONFIG ================== SYMBOL = "XAUUSD" TIMEFRAME = mt5.TIMEFRAME_M1 LOT = 0.01 MAX_OBS = 12 # keeps signals frequent ATR_PERIOD = 14 IMPULSE_FACTOR = 1.5 # strong candle = impulse SESSION_START = 8 # GMT (London open) SESSION_END = 20 # GMT (NY close) MAX_SPREAD = 30 #

프로젝트 정보

예산
50+ USD
기한
에서 1  5 일