MQLArticles/PosMgmt/ConditionalPartial/Conds/Ind/Base.mqh
2025-12-13 12:04:25 -05:00

35 行
1.6 KiB
MQL5

//+------------------------------------------------------------------+
//| Base.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 MQLARTICLES_POSMGMT_CONDPART_COND_IND_BASE_MQH
#define MQLARTICLES_POSMGMT_CONDPART_COND_IND_BASE_MQH
//+------------------------------------------------------------------+
//| Include |
//+------------------------------------------------------------------+
#include "..\\..\\Base\\Defines.mqh"
#include "..\\..\\..\\..\\IndicatorsCts\\IndicatorsBases.mqh"
//+------------------------------------------------------------------+
//| Base class to implement partial close condition |
//| with indicators (ema, rsi, supertrend, etc.). |
//+------------------------------------------------------------------+
class CConditionalPartialsInd : public IConditionPartial
{
protected:
CiIndicatorSimple* m_ind;
string m_name;
public:
CConditionalPartialsInd() : m_ind(NULL), m_name(NULL) { }
~CConditionalPartialsInd() { if(CheckPointer(m_ind) == POINTER_DYNAMIC) delete m_ind; }
string Name() const override final { return m_name; }
CiIndicatorSimple* GetIndicatorPtr() { return m_ind; }
};
#endif