mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-08-08 10:07:45 +00:00
new files added
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| Laguerre_Filter_Calculator.mqh |
|
||||
//| Adapter for the Laguerre Filter indicator. |
|
||||
//| Copyright 2025, xxxxxxxx |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2025, xxxxxxxx"
|
||||
|
||||
#include "Laguerre_Engine.mqh"
|
||||
|
||||
//+==================================================================+
|
||||
//| |
|
||||
//| CLASS 1: CLaguerreFilterCalculator (Base Class) |
|
||||
//| |
|
||||
//+==================================================================+
|
||||
class CLaguerreFilterCalculator
|
||||
{
|
||||
protected:
|
||||
CLaguerreEngine *m_engine;
|
||||
|
||||
public:
|
||||
CLaguerreFilterCalculator(void) { m_engine = new CLaguerreEngine(); };
|
||||
virtual ~CLaguerreFilterCalculator(void) { if(CheckPointer(m_engine) != POINTER_INVALID) delete m_engine; };
|
||||
|
||||
bool Init(double gamma);
|
||||
void Calculate(int rates_total, ENUM_APPLIED_PRICE price_type, const double &open[], const double &high[], const double &low[], const double &close[], double &filter_buffer[]);
|
||||
};
|
||||
|
||||
bool CLaguerreFilterCalculator::Init(double gamma) { return m_engine.Init(gamma); }
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
void CLaguerreFilterCalculator::Calculate(int rates_total, ENUM_APPLIED_PRICE price_type, const double &open[], const double &high[], const double &low[], const double &close[], double &filter_buffer[])
|
||||
{
|
||||
double L0[], L1[], L2[], L3[];
|
||||
m_engine.CalculateFilter(rates_total, price_type, open, high, low, close, L0, L1, L2, L3);
|
||||
ArrayCopy(filter_buffer, L0, 0, 0, rates_total);
|
||||
}
|
||||
|
||||
//+==================================================================+
|
||||
//| |
|
||||
//| CLASS 2: CLaguerreFilterCalculator_HA (Heikin Ashi) |
|
||||
//| |
|
||||
//+==================================================================+
|
||||
class CLaguerreFilterCalculator_HA : public CLaguerreFilterCalculator
|
||||
{
|
||||
public:
|
||||
CLaguerreFilterCalculator_HA(void)
|
||||
{
|
||||
if(CheckPointer(m_engine) != POINTER_INVALID)
|
||||
delete m_engine;
|
||||
m_engine = new CLaguerreEngine_HA();
|
||||
};
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//+------------------------------------------------------------------+
|
||||
Reference in New Issue
Block a user