forked from nique_372/TbpWrraper
69 lines
2.6 KiB
MQL5
69 lines
2.6 KiB
MQL5
//+------------------------------------------------------------------+
| |
//| 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;
| |
tbp.ApyKey(InpApiKey);
| |
| |
//---
| |
bool is = false;
| |
if(tbp.GetAllClients())
| |
{
| |
is = true; // exito inicial
| |
| |
TSN::CJsonParser* json = tbp.GetLastJson();
| |
TSN::CJsonNode root = json.GetRoot();
| |
json.PrintCintaTypes(0, WHOLE_ARRAY);
| |
| |
| |
// Nota
| |
// En caso la api key que usen (de su usario) no tenga users
| |
// Pueden comentars esto
| |
is = (root.Size() > 0); // Minimo
| |
}
| |
| |
//---
| |
// 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__);
| |
| |
//---
| |
return(CIBYLEO_ONINIT_FINISH); // Solo ejecutamos OnInit
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Expert deinitialization function |
| |
//+------------------------------------------------------------------+
| |
void OnDeinit(const int reason)
| |
{
| |
//---
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Expert tick function |
| |
//+------------------------------------------------------------------+
| |
void OnTick()
| |
{
| |
//---
| |
}
| |
//+------------------------------------------------------------------+
|