TbpWrraper/Workflows/EA.mq5

94 lines
3.7 KiB
MQL5
Raw Permalink Normal View History

2026-03-09 11:50:48 -05:00
//+------------------------------------------------------------------+
//| EA.mq5 |
//| Copyright 2025, Niquel Mendoza. |
//| https://www.mql5.com/es/users/nique_372 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Niquel Mendoza."
#property link "https://www.mql5.com/es/users/nique_372"
#property version "1.00"
#property strict
2026-03-09 15:48:40 -05:00
2026-03-09 11:50:48 -05:00
//+------------------------------------------------------------------+
//| Include |
//+------------------------------------------------------------------+
#include "..\\..\\MqlCIByLeo\\Src\\Tester\\Base.mqh"
//+------------------------------------------------------------------+
//| Inputs |
//+------------------------------------------------------------------+
input string InpApiKey = "";
//+------------------------------------------------------------------+
//| Global variables |
//+------------------------------------------------------------------+
CMqlCIClassCi g_ci_ea;
#define FOLDER_CI "TbpCi\\"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
// Configraucion inciial
MqlCiConfigCompiler config;
config.max_timeout_ms_compile = (60 * 1000); // 1 minuto
config.file_name_out_json = FOLDER_CI + "result_logs.json";
config.file_name_read_py = FOLDER_CI + "read_py.bin";
config.file_name_res = FOLDER_CI + "result.bin";
config.filename_compiled_log = CMqlCIClassCi::m_terminal_data_path + "Files\\" + FOLDER_CI + "last_compile_log.log";
// Parametros de los EAs
// Los dos primero los sobreescribe el runner
MqlParam params[3];
params[2].type = TYPE_STRING;
params[2].string_value = InpApiKey;
// Expertos
TestExpertCi experts[1];
experts[0].expert_ex5_name = "Experts\\Shared Projects\\TbpWrraper\\Workflows\\Test\\GetAllClients.ex5";
experts[0].expert_mq5_path = "Shared Projects\\TbpWrraper\\Workflows\\Test\\GetAllClients.mq5";
experts[0].symbol = "EURUSD";
experts[0].timeframe = PERIOD_M1;
// Expertos a testerar;
2026-03-09 15:47:08 -05:00
g_ci_ea.AddLogFlags(LOG_ALL);
2026-03-09 11:50:48 -05:00
if(!g_ci_ea.Init(config, experts, params))
return INIT_FAILED;
//---
2026-03-09 16:06:43 -05:00
if(!g_ci_ea.First()) // Primera ejeuccion | Compilacion
2026-03-09 16:06:03 -05:00
return INIT_FAILED;
2026-03-09 11:50:48 -05:00
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int32_t id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//---
g_ci_ea.ChartEvent(id, lparam, dparam, sparam);
}
//+------------------------------------------------------------------+