AiDataTaskRuner/Backend/Main.mqh

616 lines
22 KiB
MQL5
Raw Permalink Normal View History

2026-03-13 19:46:53 -05:00
//+------------------------------------------------------------------+
//| Main.mqh |
//| 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 strict
#ifndef AIDATATASKRUNNER_BACKEND_MAIN_MQH
#define AIDATATASKRUNNER_BACKEND_MAIN_MQH
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "Bases\\Saver.mqh"
#include "..\\UI\\Main.mqh"
#include <Generic\Queue.mqh>
2026-03-14 09:06:05 -05:00
#include <TSN\\ExtraCodes\\MTTester.mqh>
2026-03-13 19:46:53 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
class CExecutionTester : public ITaskRunerAi
{
private:
//---
long m_chart_id_ea_2; // Chart id del ea 2
TaskTester m_current_task; // Tarea actual en configuracion
TaskTester m_tasks[]; // Array de tareas
int m_tasks_size; // Cantidad de tareas
CTaskSaver m_saver; // Guardado y carga de tareas
const long m_current_chart_id;
//---
string m_expert_path; // Ruta al experto que se desea ejeuctar (para ejecutarlo)
string m_main_folder; // Folder base
int m_files_common_to_move_size; // Tamaaño de archivos a mover
string m_files_common_to_move[]; // Archivos a mover
string m_progres_task_file; // Archivo de progreso
//---
int m_file_common_flag_out; // Flag comon para los archivos quie el backend mueve
int m_file_common_flag_in;// Flag comon para los archivos que da el ea
string m_base_path;
2026-03-13 21:49:37 -05:00
//---
int m_current_task_procces_idx;
2026-03-13 19:46:53 -05:00
// temporales (se modican en ejecucion)
2026-03-14 11:35:01 -05:00
string m_temp_arr_file_to_move[];
2026-03-13 19:46:53 -05:00
string m_temp_exp_path; // path temproal
string m_temp_progres_csv_file;
string m_temp_main_folder;
//---
bool m_in_execution; // Ahora mismo se estan ejeuctando tareas?
CTaskRunerAiTabDGenMain* m_sec_generation;
CQueue<int> m_cola_indices;
//---
void SentEvent(); // Envia evento
void RecibirEvento(const bool result, const string& msg);
public:
CExecutionTester(void);
2026-03-13 22:14:54 -05:00
~CExecutionTester(void) {}
2026-03-13 19:46:53 -05:00
//---
2026-03-16 21:27:52 -05:00
void Set(CTaskRunerAiTabDGenMain *sec_gen, bool comon_in, bool comon_out);
2026-03-13 19:46:53 -05:00
//---
void InitCurrentTask(const TaskTester& t) override final { m_current_task = t; }
//--- Configuracion de la tarea actual
void OnCurrentTask_ModifyConfigMoveFile(const string str) override final;
2026-03-14 11:35:01 -05:00
__forceinline string MoveFiles() const override final
{ return !m_in_execution ? ArrayStrToString(m_files_common_to_move, "|") : ArrayStrToString(m_temp_arr_file_to_move, "|"); }
2026-03-13 19:46:53 -05:00
void OnCurrentTask_ModifyConfigExpertPath(const string str) override final;
2026-03-14 11:35:01 -05:00
__forceinline string ExperthPath() const override final { return !m_in_execution ? m_expert_path : m_temp_exp_path; }
2026-03-13 19:46:53 -05:00
void OnCurrentTask_ModifyConfigProgresCsvFile(const string str) override final;
2026-03-14 11:35:01 -05:00
__forceinline string ProgreesFile() const override final { return !m_in_execution ? m_progres_task_file : m_temp_progres_csv_file; }
2026-03-13 19:46:53 -05:00
void OnCurrentTask_ModifyConfigMainFolder(const string str) override final;
2026-03-14 11:35:01 -05:00
__forceinline string MainFolder() const override final { return !m_in_execution ? m_main_folder : m_temp_main_folder; }
2026-03-13 19:46:53 -05:00
//--- Modificacion de la tarea actual
void OnCurrentTask_ModifyDateStart(const datetime new_start) override final;
void OnCurrentTask_ModifyDateEnd(const datetime new_end) override final;
void OnCurrentTask_ModifySimbolo(const string new_symbol) override final;
void OnCurrentTask_ModifySimboloFolder(const string new_symbol_f) override final;
void OnCurrentTask_ModifyTimeframe(const ENUM_TIMEFRAMES new_tf) override final;
void OnCurrentTask_ModifyLabel(const string label) override final;
void OnCurrentTask_ModifyLabelId(const int label_id) override final;
void OnCurrentTask_ModifySetFile(const string set_file) override final;
//---
bool OnCurrentTask_Add();
int RunAllTask(int& out[]) override final;
int CleanAllTask(int& out[]) override final;
2026-03-14 09:06:05 -05:00
//--- Guardado \ Carga
2026-03-13 19:46:53 -05:00
bool SaveAllTaskInFile(const string& file_name) override final;
2026-03-14 09:06:05 -05:00
bool SetTastByFile(const string& file_name) override final;
2026-03-14 11:35:01 -05:00
//---
bool LoadConfig(const string& file_name) override final;
bool SaveConfig(const string& file_name) override final;
2026-03-13 19:46:53 -05:00
// El archivo debera de estar en comon
// task: aqui se pondran todas las tareas
// retonar el numero de tareas
TaskTester GetTaskByIndex(const int index) const override final { return m_tasks[index]; }
inline TaskTester CurrentTask() const override final { return m_current_task; }
inline int TaskSize() const override final { return m_tasks_size; }
//---
void ChartEvent(const int32_t id, const long& lparam, const double& dparam, const string& sparam);
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
CExecutionTester::CExecutionTester(void)
: m_progres_task_file(NULL), m_file_common_flag_out(NULL), m_temp_main_folder(NULL), m_current_chart_id(ChartID()),
2026-03-13 21:49:37 -05:00
m_in_execution(false), m_expert_path(NULL), m_main_folder(NULL), m_current_task_procces_idx(-1)
2026-03-13 19:46:53 -05:00
{
2026-03-13 21:49:37 -05:00
m_files_common_to_move_size = ArrayResize(m_files_common_to_move, 0);
2026-03-14 11:35:01 -05:00
ArrayResize(m_temp_arr_file_to_move, 0);
2026-03-14 09:06:05 -05:00
AddLogger(m_saver);
2026-03-13 19:46:53 -05:00
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
2026-03-16 21:27:52 -05:00
void CExecutionTester::Set(CTaskRunerAiTabDGenMain *sec_gen, bool comon_in, bool comon_out)
2026-03-13 19:46:53 -05:00
{
//---
2026-03-13 21:49:37 -05:00
m_sec_generation = sec_gen;
2026-03-13 19:46:53 -05:00
m_file_common_flag_in = comon_in ? FILE_COMMON : 0;
m_file_common_flag_out = comon_out ? FILE_COMMON : 0;
m_base_path = comon_out ? TERMINAL_MT5_COMMON_PATH : TERMINAL_MT5_DATA_PAH;
//--- Abrimos el segundo grafico
// Sin
2026-03-16 21:27:52 -05:00
const long chart_id_ea = DEFMTTesterGetChartId();
2026-03-13 19:46:53 -05:00
if(::ChartSymbol(chart_id_ea) == "")
{
LogError(StringFormat("Chart id = %d, invalido", chart_id_ea), FUNCION_ACTUAL);
Remover();
return;
}
m_chart_id_ea_2 = chart_id_ea;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyConfigMoveFile(const string str)
{
const int t = StringSplit(str, '|', g_str_arr_dyn_arr);
if(t < 1)
{
LogError(StringFormat("No se ha encontrado el separador | dentro de:\n%s", str), FUNCION_ACTUAL);
return;
}
2026-03-14 11:35:01 -05:00
//---
if(m_in_execution)
ArrayCopy(m_temp_arr_file_to_move, g_str_arr_dyn_arr);
else
m_files_common_to_move_size = ArrayCopy(m_files_common_to_move, g_str_arr_dyn_arr);
2026-03-13 19:46:53 -05:00
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyConfigExpertPath(const string str)
{
if(m_in_execution)
{
m_temp_exp_path = str;
}
else
{
m_expert_path = str;
}
}
//+------------------------------------------------------------------+
// NOTA:
// EL ARCHIVO DE PROGRESO VA RELAITIVO AL MAIN_FOLDER
// por jeemplo Progreess\\temp.csv
void CExecutionTester::OnCurrentTask_ModifyConfigProgresCsvFile(const string str)
{
if(m_in_execution)
{
m_temp_progres_csv_file = m_temp_main_folder + str;
}
else
{
m_progres_task_file = m_main_folder + str;
}
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyConfigMainFolder(const string str)
{
if(m_in_execution)
{
m_temp_main_folder = str;
}
else
{
m_main_folder = str;
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyDateStart(const datetime new_start)
{
m_current_task.start_date = new_start;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyDateEnd(const datetime new_end)
{
m_current_task.end_date = new_end;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifySimbolo(const string new_symbol)
{
m_current_task.symbol = new_symbol;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifySimboloFolder(const string new_symbol_f)
{
m_current_task.symbol_folder = new_symbol_f;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyTimeframe(const ENUM_TIMEFRAMES new_tf)
{
m_current_task.timeframe = new_tf;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyLabel(const string label)
{
m_current_task.label = label;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifyLabelId(const int label_id)
{
m_current_task.label_id = label_id;
}
//+------------------------------------------------------------------+
void CExecutionTester::OnCurrentTask_ModifySetFile(const string set_file)
{
m_current_task.set_file = set_file;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool CExecutionTester::OnCurrentTask_Add(void)
{
//---
2026-03-14 09:06:05 -05:00
m_last_error_msg = "";
2026-03-13 19:46:53 -05:00
bool res = true;
bool is_cts;
//---
if(m_main_folder == NULL)
{
m_last_error_msg += "Main folder invalido|";
res = false;
}
2026-03-14 09:06:05 -05:00
if(m_expert_path.Length() < 4 || StringFindAtras(m_expert_path, ".ex5") == -1)
2026-03-13 19:46:53 -05:00
{
m_last_error_msg += "Path invalido o extension no es ex5|";
res = false;
}
//--- Como tal de la tarea
if(!::SymbolExist(m_current_task.symbol, is_cts))
{
m_last_error_msg += "Simbolo no existe|";
res = false;
}
if(m_current_task.timeframe == WRONG_VALUE)
{
m_last_error_msg += "Timeframe no configurado|";
res = false;
}
if(m_current_task.start_date >= m_current_task.end_date)
{
m_last_error_msg += "Fecha inicio debe ser menor a fecha fin|";
res = false;
}
2026-03-14 07:39:48 -05:00
/*if(StringFindAtras(m_current_task.set_file, ".set") == -1)
2026-03-13 19:46:53 -05:00
{
m_last_error_msg += "El archivo setfile debe de tener la extension .set|";
res = false;
2026-03-14 07:39:48 -05:00
} Creo que el setfile no es necesario como tal ...*/
2026-03-13 19:46:53 -05:00
//---
if(!res)
LogError(m_last_error_msg, FUNCION_ACTUAL);
2026-03-13 21:49:37 -05:00
else
{
::ArrayResize(m_tasks, m_tasks_size + 1);
m_tasks[m_tasks_size] = m_current_task;
m_tasks_size++;
}
2026-03-13 19:46:53 -05:00
//---
return res;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
// Aquilimpiamos todas las tareas que se puedan limpiar
// Osea que esa tarea NO se este procesando o este en cola a ser ejecutada
int CExecutionTester::CleanAllTask(int &out[])
{
2026-03-14 09:06:05 -05:00
//---
m_last_error_msg = "";
//--- Sin tareas
if(m_tasks_size <= 0)
{
m_last_error_msg = "No hay tareas para limpiar";
return 0;
}
//---
2026-03-13 19:46:53 -05:00
for(int i = 0; i < m_tasks_size; i++)
{
if(m_tasks[i].state == AIEXECUTOR_TASK_STATE_IN_PROCESS || m_tasks[i].state == AIEXECUTOR_TASK_STATE_IN_QUEQE)
continue; // No
out.Push(i);
}
m_tasks_size = RemoveMultipleIndexes(m_tasks, out, 0);
return ArraySize(out);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int CExecutionTester::RunAllTask(int &out[])
{
2026-03-14 09:06:05 -05:00
//---
m_last_error_msg = "";
2026-03-13 19:46:53 -05:00
//--- Sin tareas
if(m_tasks_size <= 0)
{
m_last_error_msg = "No hay tareas para ejecutar";
return 0;
}
//---
int t = 0;
//---
for(int i = 0; i < m_tasks_size; i++)
{
if(m_tasks[i].state == AIEXECUTOR_TASK_STATE_PENDIENTE)
{
// Actuliazamos el estado
m_tasks[i].state = AIEXECUTOR_TASK_STATE_IN_QUEQE;
// Añadimos a la cola interna
m_cola_indices.Enqueue(i); // Agregamos este elemento a la cola
// Añadimos al array out
out[::ArrayResize(out, ++t) - 1] = i;
}
}
//--- Sin tareas pendientes
2026-03-14 11:55:50 -05:00
if(t < 1)
2026-03-13 19:46:53 -05:00
{
m_last_error_msg = "No hay tareas pendientes para ejecutar";
}
else
{
2026-03-14 11:55:50 -05:00
//---
LogInfo(StringFormat("Numero de tareas en cola a ejeuctar = %d", m_cola_indices.Count()), FUNCION_ACTUAL);
2026-03-14 13:38:16 -05:00
m_in_execution = true;
2026-03-14 11:55:50 -05:00
2026-03-13 19:46:53 -05:00
//--- Valor incial de los temp
m_temp_main_folder = m_main_folder;
m_temp_exp_path = m_expert_path;
m_temp_progres_csv_file = m_progres_task_file;
2026-03-14 11:55:50 -05:00
ArrayCopy(m_temp_arr_file_to_move, m_files_common_to_move);
2026-03-13 19:46:53 -05:00
// Mandamos el primer evento
SentEvent();
}
//---
return t;
}
2026-03-14 11:35:01 -05:00
2026-03-13 19:46:53 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CExecutionTester::SentEvent()
{
if(m_cola_indices.Count() < 1)
{
LogCaution("Todas las tareas han acabado", FUNCION_ACTUAL);
m_in_execution = false; // Termino
//--- asing de los temp
m_main_folder = m_temp_main_folder;
m_expert_path = m_temp_exp_path;
m_progres_task_file = m_temp_progres_csv_file;
2026-03-14 11:35:01 -05:00
m_files_common_to_move_size = ArrayCopy(m_files_common_to_move, m_temp_arr_file_to_move);
2026-03-13 19:46:53 -05:00
return;
}
2026-03-13 21:49:37 -05:00
//---
2026-03-13 19:46:53 -05:00
const int idx = m_cola_indices.Dequeue();
2026-03-14 13:38:16 -05:00
::EventChartCustom(m_chart_id_ea_2, DEFMTTESTER_E_ON_TASK, m_current_chart_id, 0.00, m_tasks[idx].ToStringToMTTester(m_current_chart_id, m_expert_path));
2026-03-13 19:46:53 -05:00
m_tasks[idx].state = AIEXECUTOR_TASK_STATE_IN_PROCESS;
m_sec_generation.UpdateStateInTable(idx, m_tasks[idx].state);
2026-03-13 21:49:37 -05:00
m_current_task_procces_idx = idx;
2026-03-13 19:46:53 -05:00
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CExecutionTester::RecibirEvento(const bool result, const string & msg)
{
2026-03-14 13:38:16 -05:00
//---
if(m_current_task_procces_idx < 0 || m_current_task_procces_idx >= m_tasks_size)
{
LogError("Índice de tarea inválido en RecibirEvento, posible llamada desconocida", FUNCION_ACTUAL);
return;
}
2026-03-13 19:46:53 -05:00
//---
if(result)
{
//---
2026-03-13 21:49:37 -05:00
m_tasks[m_current_task_procces_idx].state = AIEXECUTOR_TASK_STATE_FINISHED;
//---
string tf = ::EnumToString(m_tasks[m_current_task_procces_idx].timeframe);
::StringReplace(tf, "PERIOD_", "");
2026-03-14 07:39:48 -05:00
// main folder debe de tener \
const string final_ubicaction_folder = ::StringFormat("%s%s\\%s\\%s_%d\\", m_main_folder, m_tasks[m_current_task_procces_idx].symbol_folder, tf,
2026-03-13 21:49:37 -05:00
m_tasks[m_current_task_procces_idx].label, m_tasks[m_current_task_procces_idx].label_id);
2026-03-13 19:46:53 -05:00
//---
if(m_files_common_to_move_size > 0)
{
// Aqui movemos...
for(int i = 0; i < m_files_common_to_move_size; i++)
{
//--- Movemos
::ResetLastError();
if(!::FileMove(m_files_common_to_move[i], m_file_common_flag_in, final_ubicaction_folder, FILE_REWRITE | m_file_common_flag_out))
{
LogError(::StringFormat("No se pudo mover el archivo =%s, a = %s, ultimo error = %d"
, m_files_common_to_move[i], final_ubicaction_folder, ::GetLastError()), FUNCION_ACTUAL);
}
}
}
2026-03-13 21:49:37 -05:00
//--- Copiamos el setfile
2026-03-14 16:39:04 -05:00
if(::StringLen(m_tasks[m_current_task_procces_idx].set_file) > 4) // .set
2026-03-13 21:49:37 -05:00
{
2026-03-14 16:39:04 -05:00
const string out = m_base_path + "\\" + final_ubicaction_folder; // donde se pondra
const string in = TERMINAL_MT5_ROOT + "Profiles\\Tester\\" + m_tasks[m_current_task_procces_idx].set_file;
if(!MTTESTER::FileMove(in, out, true))
{
LogError(::StringFormat("Fallo al mover:\n%s\nA\n%s\nUltimo error en kernel32 = %d", in, out, kernel32::GetLastError()), FUNCION_ACTUAL);
}
2026-03-13 21:49:37 -05:00
}
2026-03-13 19:46:53 -05:00
//--- Guardamos progreso
// El progreso se guarda junto con los archivos out (data que pertenece al backend)
// solo se guardan las tareas (proceseando|pendientes|encola)
if(m_progres_task_file != NULL)
{
2026-03-14 09:06:05 -05:00
m_last_error_msg = "";
if(!m_saver.Save(m_progres_task_file, m_tasks, m_tasks_size, m_file_common_flag_out, true, m_last_error_msg)) // filtrasmos solo guramos lo necesario
2026-03-13 19:46:53 -05:00
{
2026-03-14 09:06:05 -05:00
LogError(StringFormat("Fallo al guardar progreso en el archivo csv, %s", m_last_error_msg), FUNCION_ACTUAL);
2026-03-13 19:46:53 -05:00
}
}
}
else
{
2026-03-13 21:49:37 -05:00
m_tasks[m_current_task_procces_idx].state = AIEXECUTOR_TASK_STATE_FAILED;
2026-03-14 13:38:16 -05:00
LogError(StringFormat("Fallo al procesar la tarea #%d, msg:\n%s", m_current_task_procces_idx, msg), FUNCION_ACTUAL);
2026-03-13 19:46:53 -05:00
}
//---
2026-03-13 21:49:37 -05:00
m_sec_generation.UpdateStateInTable(m_current_task_procces_idx, m_tasks[m_current_task_procces_idx].state); // Actulizar el estado
2026-03-13 19:46:53 -05:00
//---
SentEvent(); // Lanzamos el siguiente evento (intemante se verifica si es que hay tareas ono)
}
2026-03-14 13:38:16 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CExecutionTester::ChartEvent(const int id, const long & lparam, const double & dparam, const string & sparam)
{
//--- de vuelta
//lparam = combinacion de banderas en caso de error 0 exito total
2026-03-14 16:39:04 -05:00
//sparam = se empaqueta como (chartid|log)
//dparam = nada
2026-03-14 13:38:16 -05:00
2026-03-14 16:39:04 -05:00
//---
2026-03-14 13:38:16 -05:00
// Si se finaliza
2026-03-14 16:39:04 -05:00
if(id == CHARTEVENT_CUSTOM + DEFMTTESTER_E_FINISH_TASK)
2026-03-14 13:38:16 -05:00
{
2026-03-14 16:39:04 -05:00
//---
static string arr[2];
if(StringSplit(sparam, DEFMTTESTER_OUT_SPARAM_SEP_U, arr) != DEFMTTESTER_OUT_SPARAM_TOTAL) // formato invalido
{
return;
}
//---
const long chart_id = long(arr[DEFMTTESTER_OUT_SPARAM_IDX_CHARTID]);
Print("Nuevo evento chart_id =", chart_id);
if(chart_id != m_current_chart_id)
return;
LogInfo(StringFormat("Evento recibido desde = %I64d | Resultado = %I64d", chart_id, lparam), FUNCION_ACTUAL);
RecibirEvento((lparam == DEFMTTESTER_TESTER_R_EXITO), arr[DEFMTTESTER_OUT_SPARAM_IDX_LOG]);
2026-03-14 13:38:16 -05:00
}
}
2026-03-14 11:35:01 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool CExecutionTester::LoadConfig(const string &file_name)
{
bool res;
m_last_error_msg = "";
if(!m_in_execution)
{
res = m_saver.LoadC(file_name, AIDATATASK_RUNNER_COMON_FLAG, m_last_error_msg, m_progres_task_file, m_files_common_to_move, m_main_folder, m_expert_path);
m_files_common_to_move_size = ArraySize(m_files_common_to_move);
}
else
{
res = m_saver.LoadC(file_name, AIDATATASK_RUNNER_COMON_FLAG, m_last_error_msg, m_temp_progres_csv_file, m_temp_arr_file_to_move, m_temp_main_folder, m_temp_exp_path);
}
return res;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool CExecutionTester::SaveConfig(const string &file_name)
{
bool res;
m_last_error_msg = "";
if(!m_in_execution)
{
res = m_saver.SaveC(file_name, AIDATATASK_RUNNER_COMON_FLAG, m_last_error_msg, m_progres_task_file, m_files_common_to_move, m_main_folder, m_expert_path);
}
else
{
res = m_saver.SaveC(file_name, AIDATATASK_RUNNER_COMON_FLAG, m_last_error_msg, m_temp_progres_csv_file, m_temp_arr_file_to_move, m_temp_main_folder, m_temp_exp_path);
}
return res;
}
2026-03-13 19:46:53 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
2026-03-14 13:38:16 -05:00
bool CExecutionTester::SaveAllTaskInFile(const string &file_name)
2026-03-13 19:46:53 -05:00
{
2026-03-14 13:38:16 -05:00
// usamos el valor de (is common flag) del global config que tine epuesto el fronted.. para almcenar los archivos
m_last_error_msg = "";
return m_saver.Save(file_name, m_tasks, m_tasks_size, AIDATATASK_RUNNER_COMON_FLAG, false, m_last_error_msg);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool CExecutionTester::SetTastByFile(const string &file_name)
{
m_last_error_msg = "";
return m_saver.Load(file_name, m_tasks, m_tasks_size, AIDATATASK_RUNNER_COMON_FLAG, m_last_error_msg);
2026-03-13 19:46:53 -05:00
}
2026-03-14 13:38:16 -05:00
2026-03-13 19:46:53 -05:00
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
2026-03-13 21:49:37 -05:00
#endif // AIDATATASKRUNNER_BACKEND_MAIN_MQH