//+------------------------------------------------------------------+ //| 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 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #define PUBLIC_VERSION //+------------------------------------------------------------------+ //| Include | //+------------------------------------------------------------------+ #include "Reciber.mqh" #include "Secrets.mqh" //+------------------------------------------------------------------+ //| Inputs | //+------------------------------------------------------------------+ input string InpTbpUserId = THE_BOT_PLACE_USER_ID; // input long InpChartIdPadre = -1; input double InpKey = 0.00; input string InpFolderSqlLite = ""; input bool InpFolderSqlLiteInCommon = true; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #resource "sys_prompt.txt" as const string g_system_prompt #resource "resume_prompt.txt" as const string g_resume_promt //+------------------------------------------------------------------+ //| Global variables | //+------------------------------------------------------------------+ TSN::CChatTelegramBaseFully bot; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- Init #ifdef TSN_LLMAGENTBYLEO_FUNC_CTS if(!TSN_LLMAGENTBYLEO_FUNC_CTS(InpTbpUserId)) #else if(!LlmAgentsByLeo_Init(InpTbpUserId)) #endif // TSN_LLMAGENTBYLEO_FUNC_CTS { FastLog(FUNCION_ACTUAL, FATAL_ERROR_TEXT, "Fallo al verificair licencia de TBP"); return INIT_PARAMETERS_INCORRECT; } //--- create timer if(!bot.Init(InpChartIdPadre, InpKey, g_system_prompt, g_resume_promt, InpFolderSqlLite, InpFolderSqlLiteInCommon)) { FastLog(FUNCION_ACTUAL, FATAL_ERROR_TEXT, "Fallo al setear parametros"); return INIT_PARAMETERS_INCORRECT; } //--- //f(bot.GetMe() != 0) // { // Print("Fallo"); // return INIT_PARAMETERS_INCORRECT; // } //--- EventSetTimer(1); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { bot.OnTimerEvent(); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnChartEvent(const int32_t id, const long& lparam, const double& dparam, const string& sparam) { bot.ChartEvent(id, lparam, dparam, sparam); } //+------------------------------------------------------------------+