123 lines
1.9 KiB
Plaintext
123 lines
1.9 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Class Library
|
|
// ----------------------------------------------
|
|
// Name: XSCBaseHelper
|
|
// Description: provides all Base Indicator
|
|
// Helper requirements ...
|
|
//
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
// Includes ...
|
|
#include "../Libraries/x-saherelm.common.lib.mq5"
|
|
|
|
//
|
|
// Definitions ...
|
|
|
|
//
|
|
// a Class for Handle base requirements ...
|
|
// for indicators ...
|
|
class XSCBaseHelper
|
|
{
|
|
//
|
|
// Public ...
|
|
public:
|
|
//
|
|
// Constructor ...
|
|
void XSCBaseHelper(
|
|
string symbol, // Trading Symbol
|
|
ENUM_TIMEFRAMES period // Trading Time Frame
|
|
)
|
|
{
|
|
//
|
|
mSymbol = symbol;
|
|
mPeriod = period;
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
void ~XSCBaseHelper()
|
|
{
|
|
//
|
|
IndicatorRelease(mHandler);
|
|
}
|
|
|
|
//
|
|
// Setter(s) / Getter(s) ...
|
|
|
|
//
|
|
// Symbol ...
|
|
string GetSymbol()
|
|
{
|
|
return mSymbol;
|
|
}
|
|
|
|
//
|
|
// Period ...
|
|
ENUM_TIMEFRAMES GetPeriod()
|
|
{
|
|
return mPeriod;
|
|
}
|
|
|
|
//
|
|
// Retrieve Bars ...
|
|
int CountBars()
|
|
{
|
|
//
|
|
int result =
|
|
Bars(
|
|
mSymbol,
|
|
mPeriod);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int CountCalculatedBars()
|
|
{
|
|
return BarsCalculated(mHandler);
|
|
}
|
|
|
|
//
|
|
// Functions ...
|
|
|
|
//
|
|
// Protected ...
|
|
protected:
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Symbol ...
|
|
string mSymbol;
|
|
|
|
//
|
|
// Period ...
|
|
ENUM_TIMEFRAMES mPeriod;
|
|
|
|
//
|
|
// Indicator Handler ...
|
|
int mHandler;
|
|
|
|
//
|
|
// Private ...
|
|
private:
|
|
//
|
|
};
|
|
|
|
//
|
|
// Tools .... |