Files
MQL4Data/Bkp/Used/14020431/Libraries/x-saherelm.models.lib.mq4
2024-01-25 04:05:58 +03:30

153 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
};
//
// these are different signal types ...
enum ENUM_X_SIGNAL_TYPE {
X_SIGNAL_NONE,
X_SIGNAL_LONG,
X_SIGNAL_SHORT,
};
//
// 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 XCycleState {
//
double fast;
double slow;
//
double hh;
double ll;
//
double power;
};
//
// Define a Model to Represent Snapshot of XMA Indicator ...
struct XState {
//
// SC ...
XCycleState sc;
//
// MC ...
XCycleState mc;
//
double di;
//
// LC ...
XCycleState lc;
//
// PARABOLIC-SAR ...
double parabolicSAR;
};
//
// End Models ...
//