2025-11-26 07:19:36 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Confirmacion.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
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "Defines.mqh"
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | interface IConfirmacion
|
| | | {
|
| | | bool ConfirmacionCompra();
|
| | | bool ConfirmacionVenta();
|
2026-01-06 06:46:34 -05:00 | | | void OnNewBarM1();
|
2025-11-26 07:19:36 -05:00 | | | void Execute();
|
| | | };
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
2026-11-02 11:19:09 -05:00 | | | //| Condicion para fvg |
|
2025-11-26 07:19:36 -05:00 | | | //+------------------------------------------------------------------+
|
| | | class CConfirmationFvg : public IConfirmacion
|
| | | {
|
| | | public:
|
| | | bool ConfirmacionCompra() override { return g_fvg.SizeAlcistasMitigados() > 0; }
|
2026-11-02 11:19:09 -05:00 | | | bool ConfirmacionVenta() override { return g_fvg.SizeBajistasMitigados() > 0; }
|
2026-01-06 06:46:34 -05:00 | | | void OnNewBarM1() override {}
|
2025-11-26 07:19:36 -05:00 | | | void Execute() override { }
|
| | | };
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Condicion para ob |
|
| | | //+------------------------------------------------------------------+
|
| | | class CConfirmationOb : public IConfirmacion
|
| | | {
|
| | | public:
|
| | | bool ConfirmacionCompra() override { return g_ob.SizeAlcistasMitigados() > 0; }
|
| | | bool ConfirmacionVenta() override { return g_ob.SizeBajistasMitigados() > 0; }
|
2026-01-06 06:46:34 -05:00 | | | void OnNewBarM1() override {}
|
2025-11-26 07:19:36 -05:00 | | | void Execute() override { }
|
| | | };
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Confirmacion para high-low |
|
| | | //+------------------------------------------------------------------+
|
| | | class CConfimationSessionMan : public IConfirmacion
|
| | | {
|
| | | public:
|
| | | bool ConfirmacionCompra() override { return g_sessiones.MinSessionIsMitigated(); }
|
| | | bool ConfirmacionVenta() override { return g_sessiones.MaxSessionIsMitigated(); }
|
2026-01-06 06:46:34 -05:00 | | | void OnNewBarM1() override { g_sessiones.OnNewBarM1(); }
|
2025-11-26 07:19:36 -05:00 | | | void Execute() override;
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | void CConfimationSessionMan::Execute(void)
|
| | | {
|
| | | g_sessiones.OnNewBar();
|
| | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | namespace ConfirmationFactory
|
| | | {
|
| | | IConfirmacion* GetConfirmationParaEntrada(ENUM_ESTRATEGIA_SENSEI_ENTRADA_TYPE type)
|
| | | {
|
| | | switch(type)
|
| | | {
|
| | | case SENSEI_EST_ENTRADA_OB:
|
| | | return new CConfirmationOb();
|
| | | case SENSEI_EST_ENTRADA_FVG:
|
| | | return new CConfirmationFvg();
|
| | | default:
|
| | | FastLog(FUNCION_ACTUAL, ERROR_TEXT, StringFormat("Tipo invalido = %s", EnumToString(type)));
|
| | | Remover();
|
| | | break;
|
| | | }
|
| | | return NULL;
|
| | | }
|
| | | IConfirmacion* GetConfirmationParaDireccion(ENUM_ESTRATEGIA_SENSEI_DIRECCION_IND type)
|
| | | {
|
| | | switch(type)
|
| | | {
|
| | | case SENSEI_DIR_MANIPULACION_SESIONES:
|
| | | return new CConfimationSessionMan();
|
| | | case SENSEI_DIR_MANIPULACION_OB:
|
| | | return new CConfirmationOb();
|
| | | case SENSEI_DIR_MANIPULACION_FVG:
|
| | | return new CConfirmationFvg();
|
| | | default:
|
| | | FastLog(FUNCION_ACTUAL, ERROR_TEXT, StringFormat("Tipo invalido = %s", EnumToString(type)));
|
| | | Remover();
|
| | | break;
|
| | | }
|
| | | return NULL;
|
| | | }
|
| | | }
|
| | | //+------------------------------------------------------------------+
|