2026-03-17 16:38:37 -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
|
| | |
|
2026-07-15 13:45:36 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #define PUBLIC_VERSION
|
| | |
|
2026-03-17 16:38:37 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Include |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "Reciber.mqh"
|
2026-07-15 13:45:36 -05:00 | | | #include "Secrets.mqh"
|
2026-03-17 16:38:37 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Inputs |
|
| | | //+------------------------------------------------------------------+
|
2026-07-15 13:45:36 -05:00 | | | input string InpTbpUserId = THE_BOT_PLACE_USER_ID; //
|
2026-03-17 16:38:37 -05:00 | | | input long InpChartIdPadre = -1;
|
| | | input double InpKey = 0.00;
|
2026-07-17 17:20:08 -05:00 | | | input string InpFolderSqlLite = "";
|
| | | input bool InpFolderSqlLiteInCommon = true;
|
2026-03-17 16:38:37 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #resource "sys_prompt.txt" as const string g_system_prompt
|
2026-07-15 22:39:21 -05:00 | | | #resource "resume_prompt.txt" as const string g_resume_promt
|
2026-03-17 16:38:37 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Global variables |
|
| | | //+------------------------------------------------------------------+
|
2026-07-15 13:45:36 -05:00 | | | TSN::CChatTelegramBaseFully bot;
|
2026-03-17 16:38:37 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert initialization function |
|
| | | //+------------------------------------------------------------------+
|
| | | int OnInit()
|
| | | {
|
2026-07-15 13:45:36 -05:00 | | | //--- 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;
|
| | | }
|
| | |
|
2026-03-17 16:38:37 -05:00 | | | //--- create timer
|
2026-07-17 17:20:08 -05:00 | | | if(!bot.Init(InpChartIdPadre, InpKey, g_system_prompt,
|
| | | g_resume_promt, InpFolderSqlLite, InpFolderSqlLiteInCommon))
|
2026-03-17 16:38:37 -05:00 | | | {
|
| | | 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);
|
| | | }
|
| | | //+------------------------------------------------------------------+
|