Files
MQL5Data/Helpers/x-saherelm.x121.xct.helper.mq5
T
2025-05-19 19:19:33 +03:30

241 lines
3.9 KiB
Plaintext

///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Helper Class Library
// ----------------------------------------------
// Name: XSCX121XCTHelper
// 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.x-helper.class.mq5"
//
// Definitions ...
//
// Input Models ...
struct X121XCTInputs
{
//
// Props ...
//
string font; // Font
int fontSize; // Font Size;
color clr; // Text Color
ENUM_BASE_CORNER corner; // Text Position
//
// Presentation ...
bool showCandleTime; // Show Candle Time
//
// Constructor(s) ...
X121XCTInputs()
{
Clean();
}
//
// Tools ...
//
// Clean ...
void Clean()
{
//
font = NULL;
fontSize = 15;
clr = CLR_NONE;
corner = CORNER_RIGHT_LOWER;
//
// Presentation ...
showCandleTime = false;
//
ZeroMemory(this);
}
//
// Default ...
void Default()
{
//
font = "Arial";
fontSize = 15;
clr = clrYellow;
corner = CORNER_RIGHT_LOWER;
//
// Presentation ...
showCandleTime = true;
}
//
// Hide all Visible Buffers ...
void Hide()
{
showCandleTime = false;
}
//
// 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 XCX121XCTHelper : public XCBaseHelper
{
//
// Public ...
public:
//
// Props ...
//
// Constructors ...
XCX121XCTHelper()
: XCBaseHelper(_Symbol, _Period)
{
}
//
// Deconstructor ...
~XCX121XCTHelper()
{
mInputs.Clean();
}
//
// Tools ...
bool Init(
string symbol, // Trading Symbol
ENUM_TIMEFRAMES period, // Trading Period
X121XCTInputs &inputs // Inputs
)
{
//
bool result = false;
//
mSymbol = symbol;
mPeriod = period;
//
result = inputs.IsValid();
if (!result)
{
return result;
}
//
mInputs = inputs;
//
mHandler = iCustom(
mSymbol,
mPeriod,
"x-saherelm.x121.xct",
//
// Inputs ...
mInputs.fontSize, // Font Size ...
mInputs.font, // Font ...
mInputs.clr, // Text Color ...
mInputs.corner, // Text Position ...
//
// Presentation ...
"",
mInputs.showCandleTime // Show Candle Time
//
);
result = mHandler != INVALID_HANDLE;
if (!result)
{
return result;
}
//
return result;
}
//
// Inputs ...
//
X121XCTInputs GetInputs()
{
return mInputs;
}
//
bool SetInputs(
X121XCTInputs &inputs // Configs
)
{
//
return Init(
mSymbol,
mPeriod,
inputs
//
);
}
//
// Protected ...
protected:
//
// Private ...
private:
//
// Props ...
X121XCTInputs mInputs; // Inputs ...
};
//
// Tools ...