65 lines
3.1 KiB
MQL5
65 lines
3.1 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Defines.mqh |
|
|
//| 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 strict
|
|
|
|
#ifndef SCALERBYLEO_SRC_SCALER_DEFINES_MQH
|
|
#define SCALERBYLEO_SRC_SCALER_DEFINES_MQH
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
#include <TSN\\Std\\Errors\\Try.mqh>
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
namespace TSN
|
|
{
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
// si m_i_count es menor a 0 se lo linega y se lo resta.. en caso haya underflow se vuele enorme... lueog se normaliz..
|
|
// por lo contraio si es positivo entonces exacamtneem esos lementos se toman en caso haya mas lemntos de los diposibels se normaliza
|
|
|
|
//---
|
|
#define SCALERBYLEO_SIZE_CALC_S(vs) (m_i_count<0?(vs-ulong(-m_i_count)):(m_i_count))
|
|
#define SCALERBYLEO_SIZE(vs) (fmin(SCALERBYLEO_SIZE_CALC_S(vs), vs))
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
enum ENUM_SCALERBYLEO_TYPE
|
|
{
|
|
SCALERBYLEO_SCALER_TYPE_MINMAX,
|
|
SCALERBYLEO_SCALER_TYPE_MINMAX_CL,
|
|
SCALERBYLEO_SCALER_TYPE_STANDART,
|
|
SCALERBYLEO_SCALER_TYPE_STANDART_CL,
|
|
SCALERBYLEO_SCALER_TYPE_ROBUST,
|
|
SCALERBYLEO_SCALER_TYPE_ROBUST_CL
|
|
};
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
enum ENUM_SCALERBYLEO_ERROR
|
|
{
|
|
SCALERBYLEO_ERR_NONE = 0, // Sin error
|
|
SCALERBYLEO_ERR_NOT_TRAINED, // Transform/InverseTransform sin FitTransform ni Load previo
|
|
SCALERBYLEO_ERR_EMPTY_INPUT, // vector/matrix vacío
|
|
SCALERBYLEO_ERR_INVALID_RANGE, // m_i_start/m_i_count fuera de rango
|
|
SCALERBYLEO_ERR_SIZE_MISMATCH, // columnas/tamaño no coincide con lo entrenado
|
|
SCALERBYLEO_ERR_DEGENERATE_SCALE, // std/iqr/rango demasiado pequeño (< SCALER_BASE_MIN_VALUE)
|
|
SCALERBYLEO_ERR_FILE_OPEN, // FileOpen devolvió INVALID_HANDLE
|
|
SCALERBYLEO_ERR_INVALID_DATA, // array/string malformado en LoadByArr/LoadByStr
|
|
SCALERBYLEO_ERR_IN_OPENCL,
|
|
SCALERBYLEO_ERR_IN_CTX_MANAGER_CL,
|
|
};
|
|
}
|
|
#endif
|
|
//+------------------------------------------------------------------+
|