/////////////////////////////////////////////////////// // // 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_OSC_PROVIDER, X_CCI_PROVIDER, X_SHP_PROVIDER, X_XMA_PROVIDER, X_RMA_PROVIDER, X_XXX_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; }; // // this is Signal Request Response model ... struct XSignalRequest { bool hasSignal; XSignal signal; ENUM_X_SIGNAL_TYPE type; ENUM_X_SIGNAL_PROVIDER provider; }; // struct XBndState { double high; double open; double close; double low; }; // struct XMKTState { // double highestHigh; double highestLow; double highestOpen; double highestClose; // double lowestHigh; double lowestLow; double lowestOpen; double lowestClose; }; // struct XCycleState { double fast; double slow; }; // // Define a Model to Represent Snapshot of XMA Indicator ... struct XState { // // SC ... XCycleState sc; // // MC ... XCycleState mc; // // LC ... XCycleState lc; // // OSC ... XCycleState osc; // // MIDDLEAGE ... double marketMiddleage; // // PARABOLIC-SAR ... double parabolicSAR; // double cci; // XBndState bnd; // XMKTState mkt; }; // // Parsed XMA Buffer ... struct XStateInfo { // // Check Market Cross Exists or not ... // bool isSCFastCrossOverSlow; bool isSCFastCrossUnderSlow; // double scMin; double scMax; // bool isMCFastCrossOverSlow; bool isMCFastCrossUnderSlow; // double mcMin; double mcMax; bool isLCFastCrossOverSlow; bool isLCFastCrossUnderSlow; // double lcMin; double lcMax; // bool isMMCrossOverSCFast; bool isMMCrossUnderSCFast; // bool isMMCrossOverMCFast; bool isMMCrossUnderMCFast; // double mmMin; double mmMax; }; // // End Models ... //