70 lines
No EOL
3.1 KiB
MQL5
70 lines
No EOL
3.1 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Data.mqh |
|
|
//| Copyright 2025, Niquel Mendoza. |
|
|
//| https://www.mql5.com/es/users/nique_372/news |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2025, Niquel Mendoza."
|
|
#property link "https://www.mql5.com/es/users/nique_372/news"
|
|
#property strict
|
|
|
|
#ifndef ICTLIBRARYEASY_SRC_BASE_DATA_MQH
|
|
#define ICTLIBRARYEASY_SRC_BASE_DATA_MQH
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
#include "Imports.mqh"
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
class CIctSymbol
|
|
{
|
|
private:
|
|
int m_handle;
|
|
public:
|
|
CIctSymbol(void) : m_handle(INVALID_HANDLE) {}
|
|
~CIctSymbol(void) { }
|
|
//--- Creacion
|
|
bool Create(const string& symbol);
|
|
|
|
//--- Generales
|
|
inline string Symbol() { return ICTSymbol_Symbol(m_handle); }
|
|
inline int GetCounter() { return ICTSymbol_GetCounter(m_handle); }
|
|
inline double GetPointValue() { return ICTSymbol_GetPointValue(m_handle); }
|
|
inline int8_t GetDigits() { return ICTSymbol_GetDigits(m_handle); }
|
|
inline uint8_t GetFlagsUpdate() { return ICTSymbol_GetFlagsUpdate(m_handle); }
|
|
inline datetime TickTime() { return ICTSymbol_TickTime(m_handle); }
|
|
inline double TickBid() { return ICTSymbol_TickBid(m_handle); }
|
|
inline double TickAsk() { return ICTSymbol_TickAsk(m_handle); }
|
|
inline double TickLast() { return ICTSymbol_TickLast(m_handle); }
|
|
inline ulong TickVolume() { return ICTSymbol_TickVolume(m_handle); }
|
|
inline long TickTimeMsc() { return ICTSymbol_TickTimeMsc(m_handle); }
|
|
inline uint TickFlags() { return ICTSymbol_TickFlags(m_handle); }
|
|
|
|
//--- Getters adicionales
|
|
inline int Handle() const { return m_handle; }
|
|
inline bool IsValid() const { return m_handle != INVALID_HANDLE; }
|
|
|
|
//--- Funciones estaticas
|
|
static inline int GetTotal() { return ICTSymbolData_GetTotal(); }
|
|
};
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
bool CIctSymbol::Create(const string &symbol)
|
|
{
|
|
//---
|
|
m_handle = ICTSymbolData_GetHandle(symbol);
|
|
if(m_handle == INVALID_HANDLE)
|
|
{
|
|
FastLog(FUNCION_ACTUAL, ERROR_TEXT, StringFormat("Error interno al crear un ictsymbol para %s", symbol));
|
|
return false;
|
|
}
|
|
|
|
//---
|
|
return true;
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
#endif // ICTLIBRARYEASY_SRC_BASE_DATA_MQH |