Files
xMQL5/MQLTestWorkspace/BKPS/BKP/Constructor Issues/Helpers/x-saherelm.x121.xcc.helper.class.mq5
T

331 lines
6.5 KiB
Plaintext

///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Helper Class Library
// ----------------------------------------------
// Name: XSCXCCHelper
// Description: provides all 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
//
// START Definitions ...
//
//
struct XCCInputs
{
//
// Chart Style ...
color upColor; // Up Color
color downColor; // Down Color
color lineColor; // Line mode and Doji candlestick Color
color bearishColor; // Bullish Color
color bullishColor; // Bearish Color
color volumesColor; // Volumes Color
//
// Presentation ...
bool showCandles; // Show Candles
};
//
// END Definitions ...
//
//
// START Import and Inclused requirements ...
//
//
// Includes ...
#include "../Libraries/x-saherelm.common.lib.mq5"
#include "../Classes/x-saherelm.xhelper.class.mq5"
//
// END Import and Inclused requirements ...
//
//
// START Overrides ...
//
//
// END Overrides ...
//
//
// a Class for Helping Indicators Requirements ...
class XSCXCCHelper : public XSCBaseHelper
{
//
// Public ...
public:
//
// Constructor ...
void XSCXCCHelper(
string symbol, // Trading Symbol
ENUM_TIMEFRAMES period, // Trading Time Frame
XCCInputs &config // Indicator Properties ...
) : XSCBaseHelper(symbol, period)
{
//
XSCXCCHelper(symbol,
period,
config.upColor,
config.downColor,
config.lineColor,
config.bearishColor,
config.bullishColor,
config.volumesColor,
config.showCandles);
}
void XSCXCCHelper(
string symbol, // Trading Symbol
ENUM_TIMEFRAMES period, // Trading Time Frame
//
// Indicator Properties ...
//
// Chart Style ...
//
// Up Color ...
color upColor = clrLime,
//
// Down Color ...
color downColor = clrRed,
//
// Line mode and Doji candlestick Color ...
color lineColor = clrLime,
//
// Bearish Color ...
color bearishColor = clrRed,
//
// Bullish Color ...
color bullishColor = clrLime,
//
// Volumes Color ...
color volumesColor = clrGreen,
//
// Presentations ...
//
// Show Candles ...
bool showCandles = false
//
) : XSCBaseHelper(symbol, period)
{
//
// Indicator Properties ...
mUpColor = upColor;
mDownColor = downColor;
mLineColor = lineColor;
mBearishColor = bearishColor;
mBullishColor = bullishColor;
mVolumesColor = volumesColor;
mShowCandles = showCandles;
//
PrepareTag();
}
//
// Deconstructor ...
void ~XSCXCCHelper()
{
}
//
// START Properties ...
//
//
// Show Candles ...
bool ShowCandles(
bool show // Show or Hide
)
{
//
bool result = false;
//
if (mShowCandles == show)
{
return true;
}
//
mShowCandles = show;
result = Init();
//
return result;
}
//
// END Properties ...
//
//
// START Provided Functions ...
//
//
// Prepare Tag ...
virtual void PrepareTag()
{
mTag = "XCC" + GetTagPrefix();
}
//
// Initial Indicator Handler ...
bool Init()
{
//
bool result = false;
//
// Initialize Handler ...
mHandler = iCustom(
//
mSymbol,
mPeriod,
"x-saherelm.x121.xcc",
//
// Inputs ...
//
// Chart Style ...
"",
//
// Up Color ...
mUpColor,
//
// Down Color ...
mDownColor,
//
// Line mode and Doji candlestick Color ...
mLineColor,
//
// Bullish Color ...
mBearishColor,
//
// Bearish Color ...
mBullishColor,
//
// Volumes Color ...
mVolumesColor,
//
// Presentation ...
"",
//
// Show Candles ...
mShowCandles
//
);
result = mHandler != INVALID_HANDLE;
//
return result;
}
//
// Retrieve Current Config ...
XCCInputs GetConfig()
{
//
XCCInputs result;
//
result.upColor = mUpColor;
result.downColor = mDownColor;
result.lineColor = mLineColor;
result.bearishColor = mBearishColor;
result.bullishColor = mBullishColor;
result.volumesColor = mVolumesColor;
result.showCandles = mShowCandles;
//
return result;
}
//
// Set Config ...
bool SetConfig(XCCInputs &config)
{
//
bool result = false;
//
mUpColor = config.upColor;
mDownColor = config.downColor;
mLineColor = config.lineColor;
mBearishColor = config.bearishColor;
mBullishColor = config.bullishColor;
mVolumesColor = config.volumesColor;
mShowCandles = config.showCandles;
//
result = Init();
//
return result;
}
//
// END Provided Functions ...
//
//
// Protected ...
protected:
//
// Private ...
private:
//
// Indicator Properties ...
//
// Chart Style ...
//
// Up Color ...
color mUpColor;
//
// Down Color ...
color mDownColor;
//
// Line mode and Doji candlestick Color ...
color mLineColor;
//
// Bullish Color ...
color mBearishColor;
//
// Bearish Color ...
color mBullishColor;
//
// Volumes Color ...
color mVolumesColor;
//
// Presentation ...
//
// Show Candles ...
bool mShowCandles;
};
//
// START Usefull Functions ...
//
//
// END Usefull Functions ...
//