Files
xMQL5/X121-EA/V1.0/Helpers/x-saherelm.xcc.helper.mq5
T
2024-10-11 19:46:23 +03:30

245 lines
4.3 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
//
// Imports ...
#include "../Classes/x-saherelm.xhelper.class.mq5"
//
// Definitions ...
//
// Input Models ...
struct XCCInputs
{
//
// Props ...
//
// Chart Style ...
ENUM_CHART_MODE mode; // Mode
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
//
// Constructor(s) ...
XCCInputs()
{
//
Clean();
}
//
// Tools ...
//
// Clean ...
void Clean()
{
//
mode = CHART_CANDLES;
//
upColor = CLR_NONE;
downColor = CLR_NONE;
lineColor = CLR_NONE;
bearishColor = CLR_NONE;
bullishColor = CLR_NONE;
volumesColor = CLR_NONE;
//
showCandles = false;
}
//
// Default ...
void Default()
{
//
mode = CHART_CANDLES;
//
upColor = clrLime;
downColor = clrRed;
lineColor = clrLime;
bearishColor = clrRed;
bullishColor = clrLime;
volumesColor = clrGreen;
//
showCandles = true;
}
//
// Validate ...
bool IsValid()
{
//
bool result = false;
//
result =
//
true
//
;
//
return result;
}
//
// Retrieve MAx Length ...
int Max()
{
//
int result = 0;
//
result = MathMax(0, 0);
//
return result;
}
};
//
// Class ...
class XSCXCCHelper : public XSCBaseHelper
{
//
// Public ...
public:
//
// Props ...
//
// Constructors ...
XSCXCCHelper() : XSCBaseHelper(_Symbol, _Period)
{
}
//
// Deconstructor ...
~XSCXCCHelper() {}
//
// Tools ...
bool Init(
string symbol, // Trading Symbol
ENUM_TIMEFRAMES period, // Trading Period
XCCInputs &inputs // Inputs
)
{
//
bool result = false;
//
mSymbol = symbol;
mPeriod = period;
//
result = inputs.IsValid();
if (!result)
{
return result;
}
//
mInputs = inputs;
//
mHandler = iCustom(
mSymbol,
mPeriod,
"x-saherelm.xcc",
//
// Inputs ...
//
// Chart Style ...
"",
mInputs.mode, // Mode
mInputs.upColor, // Up Color
mInputs.downColor, // Down Color
mInputs.lineColor, // Line mode and Doji candlestick Color
mInputs.bearishColor, // Bullish Color
mInputs.bullishColor, // Bearish Color
mInputs.volumesColor, // Volumes Color
//
// Presentation ...
"",
mInputs.showCandles // Show Candles
//
);
result = mHandler != INVALID_HANDLE;
if (!result)
{
return result;
}
//
return result;
}
//
// Inputs ...
//
XCCInputs GetInputs()
{
return mInputs;
}
//
bool SetInputs(
XCCInputs &inputs // Configs
)
{
//
return Init(
mSymbol,
mPeriod,
inputs
//
);
}
//
// Protected ...
protected:
//
// Private ...
private:
//
// Props ...
XCCInputs mInputs; // Inputs ...
};
//
// Tools ...