Files
xEaPacks/EURUSD-5M-V0.1/MQ5/Libraries/x-saherelm.models.lib.mq5
T
2024-01-25 04:08:38 +03:30

188 lines
2.9 KiB
Plaintext

///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Models Library
// ---------------------------------------
// Name: XModels
// Description: provides all required models ...
//
//
// 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 Inputs ...
//
//
// END Inputs ...
//
//
// START Global Definitions: Variables, Properties and etc ...
//
//
// END Global Definitions: Variables, Properties and etc ...
//
//
// START Provided Functions ...
//
//
// START Model Definitions ...
//
//
// OHCL Candel Model ...
enum ENUM_X_PRICE
{
X_PRICE_HIGH,
X_PRICE_OPEN,
X_PRICE_CLOSE,
X_PRICE_LOW
};
//
// Describe an Specific Candle ...
struct XOHCL
{
double high;
double open;
double close;
double low;
};
//
// Swing Types Enum ...
enum ENUM_X_SWING_TYPE
{
X_NO_SWING = 0,
X_SWING_HIGH = 1,
X_SWING_LOW = -1,
};
//
// XTrader Execution Signal Result ...
enum ENUM_EXECUTION_SIGNAL_RESULT
{
//
X_INVALID_SIGNAL_ERROR,
X_XTRADER_NOT_ENOUGH_BALANCE_ERROR,
X_XTRADER_NOT_ENOUGH_MARIGIN_ERROR,
X_XTRADER_MAX_ALLOWED_TRADE_KIND_REACHED_ERROR,
X_XTRADER_MAX_ALLOWED_SUPPORT_KIND_REACHED_ERROR,
//
X_TRADER_SUPPORT_DISTANCE_NOT_HAPPENS_ERROR,
//
X_UNKNOWN_ERROR,
X_SUCCEED_EXECUTION
};
//
// Signal Types ...
enum ENUM_X_SIGNAL_TYPE
{
X_SIGNAL_LONG,
X_SIGNAL_SHORT,
X_SIGNAL_UNKNOWN,
};
//
// Represent a Signal issued for Trade or Support a Trade ...
enum ENUM_X_SIGNAL_KIND
{
X_KIND_TRADE,
X_KIND_SUPPORT
};
//
// Signal Structure ...
struct XSignal
{
//
// Identifier ...
ulong id;
//
// Which Symbol used for Signal ...
string symbol;
//
// Which Type of operations ...
ENUM_X_SIGNAL_TYPE type;
//
// Signal Kind ...
ENUM_X_SIGNAL_KIND kind;
//
// Parent Ticket ...
ulong parent;
//
// Magic Number ...
ulong magicNumber;
//
// Ticket ...
ulong ticket;
//
// Entry/Open Price ...
double entry;
//
// TP ...
double tp;
//
// SL ...
double sl;
//
// Make Risk Free Trade on this Value if provided ...
double riskFree;
//
// a Multiplier for determines how much trade volume exit on risk free time ...
double riskFreeRate;
//
// Trade Profit ...
double profit;
//
// Time of Operation ...
datetime time;
//
// Volume ...
double volume;
//
// Comment ...
string comment;
};
//
// TP/SL Struct ...
struct XTPSL
{
ENUM_X_SIGNAL_TYPE type;
double tp;
double sl;
double entry;
double r2r;
};
//
// END Provided Functions ...
//