forked from nique_372/MQLArticles
43 lines
2 KiB
MQL5
43 lines
2 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\\Main.mqh"
| |
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
namespace TSN
| |
{
| |
//+------------------------------------------------------------------+
| |
//| Base class to implement partial close condition |
| |
//| with indicators (ema, rsi, supertrend, etc.). |
| |
//+------------------------------------------------------------------+
| |
template <typename TBufferSize>
| |
class CConditionalPartialsInd : public IConditionPartial
| |
{
| |
protected:
| |
CiIndicatorSimple<TBufferSize>* 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<TBufferSize>* GetIndicatorPtr() { return m_ind; }
| |
};
| |
}
| |
#endif
| |
//+------------------------------------------------------------------+
|