2026-04-12 12:32:11 -05:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| BackComparer.mq5 |
|
|
|
|
|
//| Copyright 2026,Niquel Mendoza. |
|
|
|
|
|
//| https://www.mql5.com/en/users/nique_372 |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
#property copyright "Copyright 2026,Niquel Mendoza."
|
|
|
|
|
#property link "https://www.mql5.com/en/users/nique_372"
|
|
|
|
|
#property version "1.00"
|
|
|
|
|
#property strict
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Include |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
#include "Main.mqh"
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Inputs |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
input long InpCharId = 0;
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
CBackEaComparer g_ea;
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Expert initialization function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
int OnInit()
|
|
|
|
|
{
|
|
|
|
|
//---
|
|
|
|
|
BackComparerConfig config;
|
|
|
|
|
config.chart_id_orquestador = InpCharId;
|
|
|
|
|
config.common_folder = false;
|
|
|
|
|
config.comparador = new CBackComparador();
|
|
|
|
|
config.expert_path = "Shared Projects\\EasySbAi\\Ea.ex5";
|
|
|
|
|
config.file_ea_comunication = "EasySbAiCI\\ComunicationTester\\back_test.bin";
|
|
|
|
|
config.folder_path_comunication_tester = "EasySbAiCI\\ComunicationTester\\";
|
|
|
|
|
config.test_name = "EasySb Results Test";
|
|
|
|
|
config.timeout_ms_compile = (1000 * 60); // 1 minuto
|
|
|
|
|
|
|
|
|
|
// Backtest (solo uno en xauusd m5)
|
|
|
|
|
ArrayResize(config.backtests, 1);
|
|
|
|
|
config.backtests[0].timeframe = PERIOD_M5;
|
|
|
|
|
config.backtests[0].symbol = "XAUUSD";
|
|
|
|
|
config.backtests[0].start_date = D'2024.01.01 00:00';
|
|
|
|
|
config.backtests[0].end_date = D'2026.02.01 00:00';
|
|
|
|
|
config.backtests[0].set_file = TERMINAL_MT5_ROOT + "Shared Projects\\EasySbAi\\Validation\\general.set";
|
|
|
|
|
config.backtests[0].modelado = MTTESTER_MODELADO_OCHLM1;
|
|
|
|
|
config.backtests[0].visual_mode = false;
|
|
|
|
|
config.backtests[0].leverage = 30; // ftmo en mi caso
|
|
|
|
|
|
|
|
|
|
// Iniciamos
|
|
|
|
|
g_ea.Init(config);
|
|
|
|
|
|
|
|
|
|
//---
|
|
|
|
|
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_ea.ChartEvent(id, lparam, dparam, sparam);
|
|
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|