208 lines
11 KiB
MQL5
208 lines
11 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Defines.mqh |
|
|
//| Copyright 2025, Leo. |
|
|
//| https://www.mql5.com/es/users/nique_372/news |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2025, Leo."
|
|
#property link "https://www.mql5.com/es/users/nique_372/news"
|
|
#property strict
|
|
|
|
#ifndef ICTLIBRARYEASY_SRC_BASE_DEFINES_MQH
|
|
#define ICTLIBRARYEASY_SRC_BASE_DEFINES_MQH
|
|
|
|
//--- Incluimos Utils and graphics objetos del repositorio publico MQLArticles
|
|
#include "..\\..\\..\\MQLArticles\\Utils\\GraphicObjects.mqh"
|
|
|
|
/*
|
|
Recomiendo encarecidamente no modificar esto, dado que tiene que coincidir exactamente con la libreria .ex5, de lo contario aparecera un errro
|
|
cannont import ....
|
|
*/
|
|
//+------------------------------------------------------------------+
|
|
//| Bloques |
|
|
//+------------------------------------------------------------------+
|
|
enum ENUM_STYLE_DIBUJO_IMBALANCES
|
|
{
|
|
fvg_1_vela, // Draw on 3 candles
|
|
fvg_se_actuliza, // Draw to current time
|
|
};
|
|
|
|
enum ENUM_MODO_OBTENCION_IMBALANCE
|
|
{
|
|
defined_pattern, //Only Pattern
|
|
defined_pattern_with_market_book,//Pattern with Market Book
|
|
defined_pattern_with_tick_volume//Pattern with TickVolume
|
|
};
|
|
|
|
enum ENUM_ORDERBLOCKS_TYPE
|
|
{
|
|
BULL_OB = 0,
|
|
BEAR_OB = 1
|
|
};
|
|
|
|
//---
|
|
struct Bloques
|
|
{
|
|
string name; // Nombre del bloque
|
|
string name_mitad_line; // Nombre de la linea de la mitad
|
|
double price1; // Precio 1 del bloque
|
|
double price2; // Precio 2 del bloque
|
|
double mitad_price; // Precio de la mitad
|
|
datetime time1; // Tiempo 1 del bloque
|
|
datetime time2; // Tiempo 2 del bloque
|
|
datetime time1_verificacion; // Tiempo 1 de verificacion del bloque
|
|
|
|
|
|
//---
|
|
Bloques()
|
|
: name(NULL), name_mitad_line(NULL), price1(0.0), price2(0.0),
|
|
mitad_price(0.0), time1(0), time2(0), time1_verificacion(0) {}
|
|
|
|
Bloques(const Bloques& other)
|
|
{
|
|
this = other;
|
|
}
|
|
|
|
//---
|
|
inline double GetAltura() const { return ::MathAbs(price1 - price2); }
|
|
inline int GetAncho() const { return int(time2 - time1);}
|
|
|
|
//---
|
|
void Print() const
|
|
{
|
|
::Print("-----------------------------------");
|
|
::Print("Name: ", name);
|
|
::Print("time 1: ", time1);
|
|
::Print("time 2: ", time2);
|
|
::Print("price 1: ", price1);
|
|
::Print("price 2: ", price2);
|
|
::Print("time1 de verificacion: ", time1_verificacion);
|
|
}
|
|
|
|
//---
|
|
__forceinline void Reset()
|
|
{
|
|
::ZeroMemory(this);
|
|
}
|
|
};
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Sesiones |
|
|
//+------------------------------------------------------------------+
|
|
enum ENUM_TYPE_DRAW_RANGE_SESSION
|
|
{
|
|
draw_session_range_only_rect, //Dibujar solo el rectangulo
|
|
draw_session_range_lines_and_rect //Dibujar el rectangulo y lineas extras
|
|
};
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Swing |
|
|
//+------------------------------------------------------------------+
|
|
#define ADD_ALL -1 //Añadir todo al array
|
|
|
|
struct BasicSwing
|
|
{
|
|
string name;
|
|
double price;
|
|
datetime time;
|
|
|
|
|
|
//--- Constructores
|
|
BasicSwing(const BasicSwing& other)
|
|
{
|
|
this = other;
|
|
}
|
|
|
|
BasicSwing()
|
|
: name(NULL), price(0.00), time(0)
|
|
{
|
|
|
|
}
|
|
|
|
//--- Funciones
|
|
inline bool IsContainsInPriceRange(const double pmax, const double pmin) const
|
|
{
|
|
return pmax > price && price > pmin;
|
|
}
|
|
|
|
inline bool IsContainsInTimeRange(const datetime start_time, const datetime end_time) const
|
|
{
|
|
return start_time < time && time < end_time;
|
|
}
|
|
};
|
|
|
|
enum ENUM_TYPE_SWING
|
|
{
|
|
SWING_ALCISTA,
|
|
SWING_BAJISTA
|
|
};
|
|
|
|
enum ENUM_GET_SWING
|
|
{
|
|
PURE_SWINGS, //Swings
|
|
ZIGZAG //ZigZag
|
|
};
|
|
|
|
enum MODE_BUSQUEDA_SWING
|
|
{
|
|
MODE_SWING_STRICT, //Strict search mode
|
|
MODE_SWING_NO_STRICT //Non-strict search mode
|
|
};
|
|
|
|
enum ENUM_TYPE_SWING_DECENDET
|
|
{
|
|
T_SWING_HH = 0,
|
|
T_SWING_HL,
|
|
T_SWING_LL,
|
|
T_SWING_LH
|
|
};
|
|
|
|
enum ENUM_TYPE_CERCANOS_SWING
|
|
{
|
|
SWING_MAYOR_A_TARGET_PRICE = 0,
|
|
SWING_MENOR_A_TARGET_PRICE = 1
|
|
};
|
|
|
|
//--- ZigZag
|
|
enum ENUM_ZIGZAG_DIRECTION
|
|
{
|
|
ZZ_DIRECTION_BULL,
|
|
ZZ_DIRECTION_BEAR
|
|
};
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| BosChoch |
|
|
//+------------------------------------------------------------------+
|
|
enum ENUM_TYPE_CHOCH_BOS_TREND
|
|
{
|
|
TREND_TYPE_BULL,
|
|
TREND_TYPE_BEAR,
|
|
TREND_CHANGE_TO_BULL_TREND,
|
|
TREND_CHANGE_TO_BEAR_TREND
|
|
};
|
|
|
|
struct MarketStruct //Bos-Choch-Equals
|
|
{
|
|
string name;
|
|
string name_text;
|
|
double price;
|
|
datetime time1;
|
|
datetime time2;
|
|
ENUM_TYPE_SWING_DECENDET type;
|
|
|
|
void Reset()
|
|
{
|
|
ZeroMemory(this);
|
|
}
|
|
};
|
|
|
|
enum ENUM_TYPE_ROPTURA
|
|
{
|
|
ROPTURA_HACIA_ARRIBA,
|
|
ROPTURA_HACIA_ABAJO
|
|
};
|
|
|
|
|
|
|
|
#endif // ICTLIBRARYEASY_SRC_BASE_DEFINES_MQH
|
|
//+------------------------------------------------------------------+
|