2026-11-03 17:10:00 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Generador Archivos CSV Calendario.mq5 |
|
| | | //| Niquel |
|
| | | //| https://www.mql5.com |
|
| | | //+------------------------------------------------------------------+
|
| | | #property copyright "Niquel-Leo, 2024"
|
| | | #property link "https://www.mql5.com/en/users/nique_372"
|
| | | #property version "1.00"
|
| | | #property script_show_inputs
|
| | | #property strict
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-11-04 12:54:16 -05:00 | | | //#define RELEASE_VERSION
|
2026-11-03 17:10:00 -05:00 | | | #include "..\\..\\Secrets.mqh"
|
| | | #include <TSN\\FastNL\\Main.mqh>
|
2026-11-05 12:09:22 -05:00 | | | #include <TSN\\Std\\Basics\\Try.mqh>
|
2026-11-03 17:10:00 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | sinput group "=== Settings Generator ==="
|
| | | input datetime fecha_desde_incio_noticias = D'2005.01.01';//Start date for calendar data collection
|
| | | input datetime hasta = 0; //Final para generar noticias (0 => Hasta el tiempo actual)
|
| | | input string importances_events = "High|Medium|Low|None"; //Importancias de los eventos separados por "|"
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Script program start function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnStart()
|
| | | {
|
| | |
|
| | | #ifdef TSN_FASTNL_FUNC_CTS
|
| | | TSN_FASTNL_FUNC_CTS(THE_BOT_PLACE_USER_ID);
|
| | | #else
|
| | | CiNewsLeo_CalendarInit(THE_BOT_PLACE_USER_ID);
|
| | | #endif // TSN_MCPSERVER_FUNC_CTS
|
| | |
|
| | | TSN::ICalendarByLeo* calendar = CiNewsLeo_CreateEconomicCalendar();
|
| | |
|
| | | datetime desde = fecha_desde_incio_noticias;
|
| | | datetime h = hasta == 0 ? TimeTradeServer() : hasta;
|
| | | //CiNewsLeo_AddLogFlags(LOG_ALL);
|
| | | Print(TimeToString(h));
|
| | |
|
2026-11-05 12:09:22 -05:00 | | | //---
|
| | | string _what = NULL;
|
| | | TSNSTD_TRY_INI
|
| | | {
|
| | | TSNSTD_TRY_EF(calendar.AddAllCountries(importances_events), true, CiNewsLeo_FormatTraceFirst(_what))
|
| | | TSNSTD_TRY_EF(calendar.SetCalendar(desde, h), true, CiNewsLeo_FormatTraceFirst(_what))
|
| | | TSNSTD_TRY_EF(calendar.GenerateFiles(), true, CiNewsLeo_FormatTraceFirst(_what))
|
| | | }
|
| | | TSNSTD_TRY_END
|
2026-11-03 17:10:00 -05:00 | | |
|
2026-11-05 12:09:22 -05:00 | | | //---
|
| | | if(_what != NULL)
|
| | | {
|
| | | FastLog(FUNCION_ACTUAL, FATAL_ERROR_TEXT, _what);
|
| | | }
|
2026-11-04 12:54:16 -05:00 | | |
|
| | | //---
|
| | | delete calendar;
|
2026-11-03 17:10:00 -05:00 | | | }
|
| | | //+------------------------------------------------------------------+
|