TbpWrraper/Workflows/Test/GetAllClients.mq5

69 lines
2.6 KiB
MQL5

2026-07-27 09:08:56 -05:00
//+------------------------------------------------------------------+
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()
{
//---
TSN::CTbpBase tbp;
2026-03-09 16:35:12 -05:00
tbp.ApyKey(InpApiKey);
2026-03-11 18:43:32 -05:00
//---
bool is = false;
2026-03-09 16:35:12 -05:00
if(tbp.GetAllClients())
{
2026-03-11 18:43:32 -05:00
is = true; // exito inicial
TSN::CJsonParser* json = tbp.GetLastJson();
TSN::CJsonNode root = json.GetRoot();
2026-10-13 07:37:43 -05:00
json.PrintCintaTypes(0, WHOLE_ARRAY);
2026-03-11 18:43:32 -05:00
// Nota
// En caso la api key que usen (de su usario) no tenga users
// Pueden comentars esto
is = (root.Size() > 0); // Minimo
2026-03-09 16:35:12 -05:00
}
//---
2026-03-11 18:43:32 -05:00
// Se pasa el test cuando da extio al mamar a get all clientes y el tamaño del array de clientes > 0
EventChartCustom(InpCharId, CIBYLEO_ONEVENT_RES, (is ? CYBYLEO_CODE_SUCCES : CYBYLEO_CODE_ERROR), 1.00, "Test " + __FILE__);
2026-03-09 16:35:12 -05:00
//---
2026-03-10 06:38:32 -05:00
return(CIBYLEO_ONINIT_FINISH); // Solo ejecutamos OnInit
2026-03-09 16:35:12 -05:00
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+