TbpWrraper/Workflows/Test/GetAllClients.mq5

70 行
2.4 KiB
MQL5

2026-03-09 16:35:12 -05:00
//+------------------------------------------------------------------+
//| GetAllClients.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
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "Def.mqh"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
input long InpCharId = 0;
input string InpApiKey = "";
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
long result = CYBYLEO_CODE_ERROR; // Por defecto error
//---
CTbpBase tbp;
tbp.AddLogFlags(LOG_ALL);
tbp.ApyKey(InpApiKey);
if(tbp.GetAllClients())
{
result = CYBYLEO_CODE_SUCCES;
CJson* json = tbp.GetLastJson();
Print(json.Serialize(true)); // Imprimimos todo
}
//else igual se imprime todos los erroes
// {
//
// }
//---
EventChartCustom(InpCharId, CIBYLEO_ONEVENT_RES, result, 0.00, __FILE__);
//---
ExpertRemove();
//---
return(INIT_SUCCEEDED); // Solo ejecutamos OnInit
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+