Files
xMQL4/xLibraries/x-saherelm.models.lib.mq4
2024-01-25 04:03:36 +03:30

155 lines
2.4 KiB
Plaintext

///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL4 Models Global Library
// ---------------------------------------------
// saherelm useful tools and definitions ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
#property library
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://www.saherelm.ir"
#property version "1.00"
#property strict
//
// START STATIC Variables ...
//
//
static int totalSignals = 0;
static int totalLongSignals = 0;
static int totalShortSignals = 0;
//
static double initialBalance = 0;
//
static int countedBars = 0;
static bool isNewBar = false;
static bool isNewDay = false;
//
// END STATIC Variables ...
//
//
// Start Models ...
//
//
// Signal Providers ...
enum ENUM_X_SIGNAL_PROVIDER {
X_UNKNOWN_PROVIDER,
X_XXX_PROVIDER,
X_XR_PROVIDER,
X_XTPW_PROVIDER
};
//
// these are different signal types ...
enum ENUM_X_SIGNAL_TYPE {
X_SIGNAL_NONE,
X_SIGNAL_LONG,
X_SIGNAL_SHORT,
};
//
// Model Market Highs and Lows ...
struct XPvtState {
//
double hh;
double ho;
double hc;
double hl;
//
double ll;
double lo;
double lc;
double lh;
};
//
// we Model each signals as this type ...
struct XSignal {
//
// Signal Symbol ...
string symbol;
//
// Signal Type ...
ENUM_X_SIGNAL_TYPE type;
//
// Signal ID ...
int id;
//
// Signal Ticket Number, when Opening Trade ...
int ticket;
//
// Signal Provider ...
ENUM_X_SIGNAL_PROVIDER provider;
//
// Target Point ...
double tp;
//
// Stop Loss ...
double sl;
//
// Signal Entry Price ...
double entry;
//
// Signalling Time ...
datetime time;
//
// Signal Comments ...
string comment;
//
// Signal TAG ...
string tag;
};
//
// this is Signal Request Response model ...
struct XSignalRequest {
bool hasSignal;
XSignal signal;
ENUM_X_SIGNAL_TYPE type;
ENUM_X_SIGNAL_PROVIDER provider;
};
//
struct XRState {
//
datetime start;
int length;
//
double hh;
double ll;
double mid;
};
//
struct XTPOWState {
//
double powerUp;
double powerDown;
//
double signal;
};
//
// End Models ...
//