2026-01-02 17:52:24 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| IndicatorsBases.mqh |
|
2026-08-31 20:49:37 -05:00 | | | //| Copyright 2026, Leo. |
|
2026-01-02 17:52:24 -05:00 | | | //| https://www.mql5.com/es/users/nique_372/news |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | #property copyright "Copyright 2026, Leo."
|
2026-01-02 17:52:24 -05:00 | | | #property link "https://www.mql5.com/es/users/nique_372/news"
|
| | | #property strict
|
| | |
|
| | | #ifndef MQLARTICLES_INDICATORSCTS_MAIN_MQH
|
| | | #define MQLARTICLES_INDICATORSCTS_MAIN_MQH
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Include |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | #include "..\\Utils\\Basic.mqh"
|
| | | #include "..\\Utils\\StructBytesCre.mqh"
|
2026-01-02 17:52:24 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Indicator Buffer |
|
| | | //+------------------------------------------------------------------+
|
| | | struct IndBuffer
|
| | | {
|
| | | double data[];
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | class CiIndicatorSimple : public CLoggerBase
|
| | | {
|
| | | protected:
|
| | | ENUM_TIMEFRAMES m_timeframe;
|
| | | string m_symbol;
|
| | | int m_handle;
|
| | | string m_name;
|
2026-08-31 20:49:37 -05:00 | | | IndBuffer m_data[sizeof(TNumBuffer)];
|
2026-01-02 17:52:24 -05:00 | | | bool m_realese;
|
| | |
|
| | | public:
|
| | | CiIndicatorSimple();
|
| | | ~CiIndicatorSimple();
|
| | |
|
| | | //--- Create
|
2026-08-31 20:49:37 -05:00 | | | bool Create(int handle, bool series);
|
2026-01-02 17:52:24 -05:00 | | |
|
| | | //--- Clean
|
2026-08-31 20:49:37 -05:00 | | | // inline void CleanData();
|
| | | // void Clean();
|
2026-01-02 17:52:24 -05:00 | | |
|
| | | //--- Getters
|
| | | inline int Handle() const { return m_handle; }
|
| | | inline string Name() const { return m_name; }
|
| | | inline ENUM_TIMEFRAMES Timeframe() const { return m_timeframe; }
|
| | | inline string Symbol() const { return m_symbol; }
|
| | | inline bool Realese() const { return m_realese; }
|
| | | inline bool HandleIsValid() const {return m_handle != INVALID_HANDLE; }
|
| | |
|
| | | //--- Utils
|
| | | inline void Realese(bool realese) { m_realese = realese; }
|
| | | inline void SetAsSeries(bool series);
|
2026-03-23 12:25:12 -05:00 | | | bool CheckData(const int min_bars_calc, const int ms_sleep, int attemps = 100);
|
2026-01-02 17:52:24 -05:00 | | |
|
| | | //--- Data
|
| | | // Get size
|
| | | __forceinline int Size(int buffer_num) const { return ::ArraySize(m_data[buffer_num].data); }
|
| | |
|
| | | // Get data
|
| | | inline void GetData(double &out[], int buffer_num) const { ::ArrayCopy(out, m_data[buffer_num].data); }
|
| | | vector GetData(int buffer_num) const;
|
| | |
|
| | | // Get value
|
| | | inline double GetValue(int index, int buffer_num = 0) const { return m_data[buffer_num].data[index]; }
|
| | |
|
| | | //--- Copy data to internal
|
| | | inline bool CopyData(int start, int count, int buffer_num);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | CiIndicatorSimple::CiIndicatorSimple()
|
| | | : m_timeframe(WRONG_VALUE), m_symbol(NULL), m_handle(INVALID_HANDLE), m_realese(true)
|
| | | {
|
| | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | CiIndicatorSimple::~CiIndicatorSimple()
|
| | | {
|
| | | if(m_realese && m_handle != INVALID_HANDLE)
|
| | | {
|
2026-03-23 15:18:31 -05:00 | | | #ifdef MQLARTICLEs_INDSIMPLE_MAIN_LOG_DESC
|
| | | ::ResetLastError();
|
| | | if(!::IndicatorRelease(m_handle))
|
| | | LogError(StringFormat("Failed to clean indicador %s, last error = %d", m_name, ::GetLastError()), FUNCION_ACTUAL);
|
| | | else
|
| | | FastLog(FUNCION_ACTUAL, INFO_TEXT, StringFormat("Indicator [handle=%d] %s clenaed succefilled", m_handle, m_name));
|
| | | #else
|
2026-01-02 17:52:24 -05:00 | | | ::IndicatorRelease(m_handle);
|
2026-03-23 15:18:31 -05:00 | | | #endif // MQLARTICLEs_INDSIMPLE_MAIN_LOG_DESC
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | inline bool CiIndicatorSimple::CopyData(int start, int count, int buffer_num)
|
| | | {
|
| | | ::ResetLastError();
|
| | | if(::CopyBuffer(m_handle, buffer_num, start, count, m_data[buffer_num].data) != count)
|
| | | {
|
| | | LogError(::StringFormat("Error copying data from %d, total %d", start, count), FUNCION_ACTUAL);
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
| | | bool CiIndicatorSimple::Create(int handle, bool series)
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | m_handle = handle;
|
| | | if(m_handle == INVALID_HANDLE)
|
| | | {
|
| | | LogError(::StringFormat("Error creating indicator %s, invalid handle", m_name), FUNCION_ACTUAL);
|
| | | return false;
|
| | | }
|
| | |
|
2026-05-09 18:25:53 -05:00 | | | //---
|
| | | #ifdef MQLARTICLEs_INDSIMPLE_MAIN_LOG_DESC
|
2026-08-31 20:49:37 -05:00 | | | FastLog(FUNCION_ACTUAL, INFO_TEXT, StringFormat("Indicador[%s] creado, su handle = [%d], numero de buffers = [%d]",
|
| | | m_name, handle, sizeof(TNumBuffer)));
|
2026-05-09 18:25:53 -05:00 | | | #endif
|
| | |
|
2026-01-02 17:52:24 -05:00 | | | //---
|
| | | if(series)
|
| | | SetAsSeries(true);
|
| | | return true;
|
| | | }
|
2026-08-31 20:49:37 -05:00 | | | /*
|
2026-01-02 17:52:24 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | inline void CiIndicatorSimple::CleanData(void)
|
| | | {
|
2026-05-25 09:26:32 -05:00 | | | ::ArrayResize(m_data, 0);
|
| | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-05-25 09:26:32 -05:00 | | | void CiIndicatorSimple::Clean(void)
|
| | | {
|
| | | //---
|
| | | ::ArrayResize(m_data, 0);
|
| | |
|
| | | //---
|
| | | if(m_realese && m_handle != INVALID_HANDLE)
|
| | | {
|
| | | #ifdef MQLARTICLEs_INDSIMPLE_MAIN_LOG_DESC
|
| | | ::ResetLastError();
|
| | | if(!::IndicatorRelease(m_handle))
|
| | | LogError(StringFormat("Failed to clean indicador %s, last error = %d", m_name, ::GetLastError()), FUNCION_ACTUAL);
|
| | | else
|
| | | FastLog(FUNCION_ACTUAL, INFO_TEXT, StringFormat("Indicator [handle=%d] %s clenaed succefilled", m_handle, m_name));
|
| | | #else
|
| | | ::IndicatorRelease(m_handle);
|
| | | #endif // MQLARTICLEs_INDSIMPLE_MAIN_LOG_DESC
|
| | | }
|
2026-08-31 20:49:37 -05:00 | | | }*/
|
2026-01-02 17:52:24 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | inline void CiIndicatorSimple::SetAsSeries(bool series)
|
| | | {
|
| | | for(int i = 0; i < ::ArraySize(m_data); i++)
|
| | | ::ArraySetAsSeries(m_data[i].data, series);
|
| | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-01-02 17:52:24 -05:00 | | | vector CiIndicatorSimple::GetData(int buffer_num) const
|
| | | {
|
| | | //---
|
| | | vector v = {};
|
| | | v.Assign(m_data[buffer_num].data);
|
| | | //---
|
| | | return v;
|
| | | }
|
| | |
|
| | |
|
2026-01-13 14:49:49 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | template <typename TNumBuffer>
|
2026-03-23 12:25:12 -05:00 | | | bool CiIndicatorSimple::CheckData(const int min_bars_calc, const int ms_sleep, int attemps = 100)
|
2026-01-13 14:49:49 -05:00 | | | {
|
| | | //---
|
| | | while(attemps-- > 0)
|
| | | {
|
| | | if(BarsCalculated(m_handle) >= min_bars_calc)
|
| | | {
|
| | | return true;
|
| | | }
|
2026-01-02 17:52:24 -05:00 | | |
|
2026-01-13 14:49:49 -05:00 | | | //---
|
| | | Sleep(ms_sleep);
|
| | | }
|
| | |
|
| | | //---
|
| | | LogError(StringFormat("Fallo al obtener data del indicador %s | # Intenos = %d | Min Bars = %d | SleepMs = %d", m_name, attemps, min_bars_calc, ms_sleep), FUNCION_ACTUAL);
|
| | |
|
| | | //---
|
| | | return false;
|
| | | }
|
2026-01-02 17:52:24 -05:00 | | |
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiRsi : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiRsi() { m_name = "Rsi"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int period, ENUM_APPLIED_PRICE applied, bool series, bool hide);
|
| | | };
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiRsi::Create(ENUM_TIMEFRAMES timeframe, string symbol, int period, ENUM_APPLIED_PRICE applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iRSI(symbol, timeframe, period, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiMa : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiMa(void) { m_name = "Ema"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int period, ENUM_APPLIED_PRICE applied, int ma_shift, ENUM_MA_METHOD ma_method
|
| | | , bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiMa::Create(ENUM_TIMEFRAMES timeframe, string symbol, int period, ENUM_APPLIED_PRICE applied, int ma_shift, ENUM_MA_METHOD ma_method
|
| | | , bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iMA(symbol, timeframe, period, ma_shift, ma_method, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiCci : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiCci(void) { m_name = "CCI"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int period, ENUM_APPLIED_PRICE applied, bool series, bool hide);
|
| | |
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiCci::Create(ENUM_TIMEFRAMES timeframe, string symbol, int period, ENUM_APPLIED_PRICE applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iCCI(symbol, timeframe, period, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiStocastic : public CiIndicatorSimple<MQLA_B(2)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiStocastic(void) { m_name = "Stocastico"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int kperiod, int dperiod, int slowing, ENUM_MA_METHOD ma_method, ENUM_STO_PRICE stop_price
|
| | | , bool series, bool hide);
|
| | |
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiStocastic::Create(ENUM_TIMEFRAMES timeframe, string symbol, int kperiod, int dperiod, int slowing, ENUM_MA_METHOD ma_method, ENUM_STO_PRICE stop_price
|
| | | , bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iStochastic(symbol, timeframe, kperiod, dperiod, slowing, ma_method, stop_price);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(2)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiVIDyA : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiVIDyA(void) { m_name = "VIDyA"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int cmo_period, int ema_period, int ma_shift, ENUM_APPLIED_PRICE applied, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiVIDyA::Create(ENUM_TIMEFRAMES timeframe, string symbol, int cmo_period, int ema_period, int ma_shift, ENUM_APPLIED_PRICE applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iVIDyA(symbol, timeframe, cmo_period, ema_period, ma_shift, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiBands : public CiIndicatorSimple<MQLA_B(3)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiBands(void) { m_name = "Bollinger Bands"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int bands_period, int bands_shift, double deviation,
|
| | | ENUM_APPLIED_PRICE applied_price, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiBands::Create(ENUM_TIMEFRAMES timeframe, string symbol, int bands_period, int bands_shift, double deviation,
|
| | | ENUM_APPLIED_PRICE applied_price, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iBands(symbol, timeframe, bands_period, bands_shift, deviation, applied_price);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(3)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #resource "Super trend cts.ex5"
|
| | |
|
| | |
|
| | | //---
|
2026-08-31 20:49:37 -05:00 | | | class CiSuperTrend : public CiIndicatorSimple<MQLA_B(2)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiSuperTrend(void) { m_name = "SuperTrend" ; }
|
2026-03-01 16:15:40 -05:00 | | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int cci_period, ENUM_APPLIED_PRICE applied, int atr_period);
|
2026-01-02 17:52:24 -05:00 | | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
2026-03-01 16:15:40 -05:00 | | | bool CiSuperTrend::Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int cci_period, ENUM_APPLIED_PRICE applied, int atr_period)
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
2026-03-01 16:15:40 -05:00 | | | m_handle = ::iCustom(symbol, timeframe, "::Super trend cts.ex5", cci_period, applied, atr_period);
|
2026-01-02 17:52:24 -05:00 | | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
| | | // Buffer[0] = price of super trend
|
| | | // Buffer[1] = direction [2 = bullish trend | 1 = berish trend]
|
| | |
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(2)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #resource "VWAP.ex5"
|
| | |
|
| | | //---
|
| | | enum VWAP_Period
|
| | | {
|
| | | VWAP_Diario = 0,
|
| | | VWAP_Semanal,
|
| | | VWAP_Mensual
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiVwapChange : public CiIndicatorSimple<MQLA_B(2)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiVwapChange(void) { m_name = "VwapChange"; }
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, VWAP_Period period, ENUM_APPLIED_PRICE applied, bool series, bool hide);
|
| | | };
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiVwapChange::Create(ENUM_TIMEFRAMES timeframe, string symbol, VWAP_Period period, ENUM_APPLIED_PRICE applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iCustom(symbol, timeframe, "::VWAP.ex5", period, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
| | | // Buffer[0] = buy
|
| | | // Buffer[1] = sell
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(2)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiAD : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiAD(void) { m_name = "Acomulation Distribution"; }
|
| | | ~CiAD(void) {}
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, ENUM_APPLIED_VOLUME applied, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiAD::Create(ENUM_TIMEFRAMES timeframe, string symbol, ENUM_APPLIED_VOLUME applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iAD(symbol, timeframe, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
| | | // Buffer[0] = value
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiObv : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiObv(void) { m_name = "On Balance Volume"; }
|
| | | ~CiObv(void) {}
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, ENUM_APPLIED_VOLUME applied, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiObv::Create(ENUM_TIMEFRAMES timeframe, string symbol, ENUM_APPLIED_VOLUME applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iOBV(symbol, timeframe, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
| | | // Buffer[0] = value
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiStandartDeviation : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiStandartDeviation(void) { m_name = "Standart Deviation"; }
|
| | | ~CiStandartDeviation(void) {}
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int ma_period, int ma_shift, ENUM_MA_METHOD ma_method,
|
| | | ENUM_APPLIED_PRICE applied, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiStandartDeviation::Create(ENUM_TIMEFRAMES timeframe, string symbol, int ma_period, int ma_shift, ENUM_MA_METHOD ma_method,
|
| | | ENUM_APPLIED_PRICE applied, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iStdDev(symbol, timeframe, ma_period, ma_shift, ma_method, applied);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
| | | // Buffer[0] = value
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiSar : public CiIndicatorSimple<MQLA_B(1)>
|
2026-01-02 17:52:24 -05:00 | | | {
|
| | | public:
|
| | | CiSar(void) { m_name = "Sar Ind"; }
|
| | | ~CiSar(void) {}
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, double step, double maxium, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiSar::Create(ENUM_TIMEFRAMES timeframe, string symbol, double step, double maxium, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iSAR(symbol, timeframe, step, maxium);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
| | | // Buffer[0] = value
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(1)>::Create(m_handle, series);
|
2026-01-02 17:52:24 -05:00 | | | }
|
| | |
|
2026-02-27 11:19:54 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiAdx : public CiIndicatorSimple<MQLA_B(3)>
|
2026-02-27 11:19:54 -05:00 | | | {
|
| | | public:
|
| | | CiAdx(void) { m_name = "Adx ind"; }
|
| | | ~CiAdx(void) { }
|
| | |
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int ma_period, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiAdx::Create(ENUM_TIMEFRAMES timeframe, string symbol, int ma_period, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iADX(symbol, timeframe, ma_period);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(3)>::Create(m_handle, series);
|
2026-02-27 11:19:54 -05:00 | | | }
|
| | |
|
2026-01-02 17:52:24 -05:00 | | |
|
| | |
|
2026-02-27 11:19:54 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-31 20:49:37 -05:00 | | | class CiAdxWilder : public CiIndicatorSimple<MQLA_B(3)>
|
2026-02-27 11:19:54 -05:00 | | | {
|
| | | public:
|
| | | CiAdxWilder(void) { m_name = "Adx wilder ind"; }
|
| | | ~CiAdxWilder(void) { }
|
| | |
|
| | | bool Create(ENUM_TIMEFRAMES timeframe, string symbol, int ma_period, bool series, bool hide);
|
| | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CiAdxWilder::Create(ENUM_TIMEFRAMES timeframe, string symbol, int ma_period, bool series, bool hide)
|
| | | {
|
| | | //---
|
| | | if(hide)
|
| | | ::TesterHideIndicators(true);
|
| | |
|
| | | m_handle = ::iADXWilder(symbol, timeframe, ma_period);
|
| | |
|
| | | if(hide)
|
| | | ::TesterHideIndicators(false);
|
| | |
|
| | | //---
|
| | | m_timeframe = timeframe;
|
| | | m_symbol = symbol;
|
2026-08-31 20:49:37 -05:00 | | | return CiIndicatorSimple<MQLA_B(3)>::Create(m_handle, series);
|
2026-02-27 11:19:54 -05:00 | | | }
|
2026-01-02 17:52:24 -05:00 | | | #endif // MQLARTICLES_INDICATORSCTS_INDICATORSBASES_MQH
|
| | | //+------------------------------------------------------------------+
|