derivato da nique_372/MQLArticles
//+------------------------------------------------------------------+
| |
//| Main.mqh |
| |
//| Copyright 2026, Niquel Mendoza. |
| |
//| https://www.mql5.com |
| |
//+------------------------------------------------------------------+
| |
#property copyright "Copyright 2026, Niquel Mendoza."
| |
#property link "https://www.mql5.com"
| |
#property strict
| |
| |
#ifndef MQLARTICLES_INDICATORCTS_IMP_CODE_MAIN_MQH
| |
#define MQLARTICLES_INDICATORCTS_IMP_CODE_MAIN_MQH
| |
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
#include "..\\..\\Base\\WBuf.mqh"
| |
#include "..\\..\\Rscr\\Main.mqh"
| |
#include "..\\..\\CtsDef\\Common.mqh"
| |
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
namespace TSN
| |
{
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiRsi : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiRsi() : CiIndicatorSimple<MQLA_B(1)>(IND_RSI) {}
| |
~CiRsi() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int period, ENUM_APPLIED_PRICE applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iRSI(symbol, timeframe, period, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiMa : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiMa() : CiIndicatorSimple<MQLA_B(1)>(IND_MA) {}
| |
~CiMa() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int period, int ma_shift, ENUM_MA_METHOD ma_method, ENUM_APPLIED_PRICE applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iMA(symbol, timeframe, period, ma_shift, ma_method, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiCci : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiCci() : CiIndicatorSimple<MQLA_B(1)>(IND_CCI) {}
| |
~CiCci() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int period, ENUM_APPLIED_PRICE applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iCCI(symbol, timeframe, period, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiStocastic : public CiIndicatorSimple<MQLA_B(2)>
| |
{
| |
public:
| |
CiStocastic() : CiIndicatorSimple<MQLA_B(2)>(IND_STOCHASTIC) {}
| |
~CiStocastic() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int kperiod, int dperiod, int slowing, ENUM_MA_METHOD ma_method, ENUM_STO_PRICE stop_price)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iStochastic(symbol, timeframe, kperiod, dperiod, slowing, ma_method, stop_price);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(2)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiVIDyA : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiVIDyA() : CiIndicatorSimple<MQLA_B(1)>(IND_VIDYA) {}
| |
~CiVIDyA() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int cmo_period, int ema_period, int ma_shift, ENUM_APPLIED_PRICE applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iVIDyA(symbol, timeframe, cmo_period, ema_period, ma_shift, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiBands : public CiIndicatorSimple<MQLA_B(3)>
| |
{
| |
public:
| |
CiBands() : CiIndicatorSimple<MQLA_B(3)>(IND_BANDS) {}
| |
~CiBands() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int bands_period, int bands_shift, double deviation, ENUM_APPLIED_PRICE applied_price)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iBands(symbol, timeframe, bands_period, bands_shift, deviation, applied_price);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(3)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiAD : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiAD() : CiIndicatorSimple<MQLA_B(1)>(IND_AD) {}
| |
~CiAD() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, ENUM_APPLIED_VOLUME applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iAD(symbol, timeframe, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiObv : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiObv() : CiIndicatorSimple<MQLA_B(1)>(IND_OBV) {}
| |
~CiObv() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, ENUM_APPLIED_VOLUME applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iOBV(symbol, timeframe, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiStandartDeviation : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiStandartDeviation() : CiIndicatorSimple<MQLA_B(1)>(IND_STDDEV) {}
| |
~CiStandartDeviation() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int ma_period, int ma_shift, ENUM_MA_METHOD ma_method, ENUM_APPLIED_PRICE applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iStdDev(symbol, timeframe, ma_period, ma_shift, ma_method, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiSar : public CiIndicatorSimple<MQLA_B(1)>
| |
{
| |
public:
| |
CiSar() : CiIndicatorSimple<MQLA_B(1)>(IND_SAR) {}
| |
~CiSar() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, double step, double maxium)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iSAR(symbol, timeframe, step, maxium);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(1)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiAdx : public CiIndicatorSimple<MQLA_B(3)>
| |
{
| |
public:
| |
CiAdx() : CiIndicatorSimple<MQLA_B(3)>(IND_ADX) {}
| |
~CiAdx() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int ma_period)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iADX(symbol, timeframe, ma_period);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(3)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiAdxWilder : public CiIndicatorSimple<MQLA_B(3)>
| |
{
| |
public:
| |
CiAdxWilder() : CiIndicatorSimple<MQLA_B(3)>(IND_ADXW) {}
| |
~CiAdxWilder() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int ma_period)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iADXWilder(symbol, timeframe, ma_period);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(3)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiSuperTrend : public CiIndicatorSimple<MQLA_B(2)>
| |
{
| |
public:
| |
CiSuperTrend() : CiIndicatorSimple<MQLA_B(2)>(52) {}
| |
~CiSuperTrend() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, int cci_period, ENUM_APPLIED_PRICE applied, int atr_period)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iCustom(symbol, timeframe, "::Super trend cts.ex5", cci_period, applied, atr_period);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(2)>::Create(h, series);
| |
}
| |
};
| |
//+------------------------------------------------------------------+
| |
//| |
| |
//+------------------------------------------------------------------+
| |
class CiVwapChange : public CiIndicatorSimple<MQLA_B(2)>
| |
{
| |
public:
| |
CiVwapChange() : CiIndicatorSimple<MQLA_B(2)>(51) {}
| |
~CiVwapChange() {}
| |
bool Create(ENUM_TIMEFRAMES timeframe, string symbol, bool series, bool hide, ENUM_VWAP_Period period, ENUM_APPLIED_PRICE applied)
| |
{
| |
if(hide)
| |
::TesterHideIndicators(true);
| |
const int h = ::iCustom(symbol, timeframe, "::VWAP.ex5", period, applied);
| |
if(hide)
| |
::TesterHideIndicators(false);
| |
m_timeframe = timeframe;
| |
m_symbol = symbol;
| |
return CiIndicatorSimple<MQLA_B(2)>::Create(h, series);
| |
}
| |
};
| |
//---
| |
}
| |
#endif // MQLARTICLES_INDICATORCTS_IMP_CODE_MAIN_MQH
|