103 lines
2.0 KiB
Plaintext
103 lines
2.0 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 ...
|
|
//
|
|
|
|
//
|
|
// How To Calculate Static Volume ...
|
|
enum ENUM_STATIC_VOLUME_METHODS
|
|
{
|
|
//
|
|
// Based On Deposit ...
|
|
X_STATIC_VOLUME_BASED_ON_DEPOSIT,
|
|
//
|
|
// Based On Balance ...
|
|
X_STATIC_VOLUME_BASED_ON_BALANCE,
|
|
};
|
|
|
|
//
|
|
// START Model Definitions ...
|
|
//
|
|
|
|
|
|
//
|
|
// Select Positions Type ...
|
|
enum ENUM_X_POSITION_SELECT_METHODS
|
|
{
|
|
X_POSITION_SELECT_NONE, // None
|
|
X_POSITION_SELECT_MAX, // Max
|
|
X_POSITION_SELECT_MIN, // Min
|
|
X_POSITION_SELECT_ALL, // Min
|
|
};
|
|
|
|
//
|
|
// Available Guard Action ...
|
|
enum ENUM_X_GUARD_ACTIONS
|
|
{
|
|
X_GUARD_ACTION_NOTHING, // Nothing
|
|
X_GUARD_ACTION_HEDGE, // Hedge
|
|
X_GUARD_PARTIAL_CLOSE, // Partial Close
|
|
X_GUARD_ACTION_TRAIL_STOP, // Trail StopLoss
|
|
X_GUARD_ACTION_FORCE_CLOSE, // Force Close
|
|
X_GUARD_ACTION_ADD_SUPPORT_SIGNAL, // Add Support Signal
|
|
X_GUARD_ACTION_CANCEL_PENDING_ORDERS, // Cancel Pending Orders
|
|
};
|
|
|
|
//
|
|
// Model Guard Info ...
|
|
struct XGuard
|
|
{
|
|
string symbol;
|
|
string provider;
|
|
ENUM_TIMEFRAMES period;
|
|
ENUM_POSITION_TYPE type;
|
|
ENUM_X_GUARD_ACTIONS action;
|
|
|
|
//
|
|
double dblPayLoad;
|
|
string strPayload;
|
|
};
|
|
|
|
//
|
|
// EXTENSION Methods ...
|
|
|
|
//
|
|
// END Provided Functions ...
|
|
//
|