TbpWrraper/Workflows/EA.mq5

119 lines
5 KiB
MQL5

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
//+------------------------------------------------------------------+
//| Include |
//+------------------------------------------------------------------+
2026-04-13 18:51:11 -05:00
#include <TSN\\MqlCI\\Main.mqh>
2026-03-09 11:50:48 -05:00
//+------------------------------------------------------------------+
//| Inputs |
//+------------------------------------------------------------------+
input string InpApiKey = "";
//+------------------------------------------------------------------+
//| Global variables |
//+------------------------------------------------------------------+
2026-07-27 09:08:56 -05:00
TSN::CMqlCIClassCi g_ci_ea;
2026-03-09 11:50:48 -05:00
#define FOLDER_CI "TbpCi\\"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
// Configraucion inciial
2026-07-27 09:08:56 -05:00
TSN::MqlCiConfigCompiler config;
2026-03-09 11:50:48 -05:00
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";
2026-03-10 15:27:56 -05:00
config.filename_compiled_log = TERMINAL_MT5_ROOT + "Files\\" + FOLDER_CI + "last_compile_log.log";
2026-03-11 18:43:32 -05:00
config.max_timeout_esecution_per_test = (60 * 1); // Maximo 1 minuto por test
2026-03-09 11:50:48 -05:00
2026-03-11 19:21:16 -05:00
//---
2026-07-27 09:08:56 -05:00
TSN::TestExpertCi experts[2];
2026-03-11 19:21:16 -05:00
// Test 1
2026-03-09 11:50:48 -05:00
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";
2026-03-11 19:21:16 -05:00
experts[0].symbol = _Symbol;
experts[0].timeframe = _Period;
experts[0].ResizeParams(3);
2026-03-11 18:43:32 -05:00
experts[0].params[2].type = TYPE_STRING;
experts[0].params[2].string_value = InpApiKey;
2026-03-11 19:21:16 -05:00
// Test 2
experts[1].expert_ex5_name = "Experts\\Shared Projects\\TbpWrraper\\Workflows\\Test\\Cutomers\\TestCustomers.ex5";
experts[1].expert_mq5_path = "Shared Projects\\TbpWrraper\\Workflows\\Test\\Cutomers\\TestCustomers.mq5";
experts[1].symbol = _Symbol;
experts[1].timeframe = _Period;
experts[1].ResizeParams(6);
// Nota:
// Pongan datos que den "true" osea que ustedes sepen que los test que haremos den positivo....
experts[1].params[2].type = TYPE_STRING;
experts[1].params[2].string_value = InpApiKey;
experts[1].params[3].type = TYPE_STRING;
experts[1].params[3].string_value = "ODA4X3EF"; // Aqui poner un sotfware que tenga ventas usare el mio para pruebas
experts[1].params[4].type = TYPE_STRING;
experts[1].params[4].string_value = "Ir1vSmDzvzT8esYE8uMtJDCYGkQ2"; // ID de un usuario de Tbp en mic aso usare una cuenta de pruebas
experts[1].params[5].type = TYPE_STRING;
2026-03-11 19:24:43 -05:00
experts[1].params[5].string_value = "@trade_system_nique"; // Aqui pongan el usuario de telegram.. en mic caso pondre uno personal
2026-03-11 19:21:16 -05:00
2026-03-09 11:50:48 -05:00
// Expertos a testerar;
2026-03-09 15:47:08 -05:00
g_ci_ea.AddLogFlags(LOG_ALL);
2026-03-11 18:43:32 -05:00
if(!g_ci_ea.Init(config, experts))
2026-03-09 11:50:48 -05:00
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);
}
//+------------------------------------------------------------------+
2026-03-11 18:43:32 -05:00
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
//---
g_ci_ea.TimerEvent();
}
//+------------------------------------------------------------------+