2026-02-25 11:10:14 -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"
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| |
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-13 22:11:10 -05:00
|
|
|
#include "..\\Backend\\Main.mqh"
|
2026-02-25 11:10:14 -05:00
|
|
|
|
2026-03-13 16:16:11 -05:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| |
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-13 22:11:10 -05:00
|
|
|
sinput group "-- General config --"
|
|
|
|
|
input string InpGeneralBaseFolder = "AiDataTaskRunner\\"; // Folder for panel files
|
|
|
|
|
input bool InpGeneralCommonFolder = true; // In common folder ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sinput group "-- Generation --"
|
|
|
|
|
input long InpBackendChartIdRunner = 0; // ChartId runner ea
|
|
|
|
|
input bool InpBackendCommonIn = true; // Files EA input in common folder ?
|
|
|
|
|
input bool InpBackendCommonOut = true; // Files EA output in common folder ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
CProgram g_program;
|
|
|
|
|
CExecutionTester g_backend;
|
2026-03-13 16:16:11 -05:00
|
|
|
|
2026-02-25 11:10:14 -05:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Expert initialization function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
int OnInit()
|
|
|
|
|
{
|
2026-03-13 22:11:10 -05:00
|
|
|
//---
|
|
|
|
|
g_aidatatask_runner_config_g.base_folder = InpGeneralBaseFolder;
|
|
|
|
|
g_aidatatask_runner_config_g.comon_flag = InpGeneralCommonFolder;
|
|
|
|
|
|
|
|
|
|
//---
|
|
|
|
|
g_backend.Set(g_program.GetSecTaskRunerAiDGenPtr(), InpBackendCommonIn, InpBackendCommonOut, InpBackendChartIdRunner);
|
|
|
|
|
g_program.GetSecTaskRunerAiDGenPtr().SetRunner(&g_backend);
|
|
|
|
|
|
|
|
|
|
//---
|
|
|
|
|
g_program.CreateGUI(700, 500, LOG_ALL);
|
2026-02-25 11:10:14 -05:00
|
|
|
|
|
|
|
|
//---
|
|
|
|
|
return(INIT_SUCCEEDED);
|
|
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Expert deinitialization function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
void OnDeinit(const int reason)
|
|
|
|
|
{
|
|
|
|
|
//--- destroy timer
|
2026-03-13 22:11:10 -05:00
|
|
|
g_program.OnDeinitEvent(reason);
|
2026-02-25 11:10:14 -05:00
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Expert tick function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
void OnTick()
|
|
|
|
|
{
|
|
|
|
|
//---
|
|
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Timer function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
void OnTimer()
|
|
|
|
|
{
|
|
|
|
|
//---
|
2026-03-13 22:11:10 -05:00
|
|
|
g_program.OnTimerEvent();
|
2026-02-25 11:10:14 -05:00
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| ChartEvent function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
void OnChartEvent(const int32_t id,
|
|
|
|
|
const long &lparam,
|
|
|
|
|
const double &dparam,
|
|
|
|
|
const string &sparam)
|
|
|
|
|
{
|
|
|
|
|
//---
|
2026-03-13 22:11:10 -05:00
|
|
|
g_program.ChartEvent(id, lparam, dparam, sparam);
|
2026-02-25 11:10:14 -05:00
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|