/////////////////////////////////////////////////////// // // SaherElm IT Center MQL5 Class Library // ---------------------------------------------- // Name: XSCBaseProvider // Description: provides all Base Provider // requirements ... // // // 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 // // Includes ... #include "../Classes/x-saherelm.xalert.class.mq5" #include "../Libraries/x-saherelm.xtrade.lib.mq5" // // Class ... // // Base Provider Class ... class XSCBaseProvider : public XSCBaseAlert { // // Public ... public: // // Props ... // // Constructor ... XSCBaseProvider( string symbol, // Trading Symbol ENUM_TIMEFRAMES period, // Trading Period double staticVolume // Static Volume for Positions ) { // // Initialize Cycle ... mCycle.Init( symbol, period, X_MARKET_CYCLE_SHORT, X_PERIOD_MANUALLY, period, "HOST Period" // ); // mStaticVolume = staticVolume; } // // Deconstructor ... ~XSCBaseProvider() { DeInit(); } // // Properties Gettr(s) / Setter(s) ... // // DeInit all Requirements ... virtual void DeInit(); // // Functions ... // string GetSymbol() { return mCycle.symbol; } // ENUM_TIMEFRAMES GetPeriod() { return mCycle.hostPeriod; } // double GetStaticVolume() { return mStaticVolume; } // // Count Bars ... int CountBars() { // return mCycle .CountBars(); } // // Check New Bar ... bool IsNewBar() { // return mCycle .IsNewBar(); } // // Protected ... protected: // // Props ... // double mStaticVolume; // Static Volume for Positions // XMarketCycle mCycle; // bool mWaitsUntilNewBar; // // Can Ignore Process ... bool CanIgnoreProcess() { // bool result = false; // result = // IsRunningOnTestMode() ? !IsNewBar() : !IsNewBar() && mWaitsUntilNewBar // ; // return result; } // // Toggle Waititng Until New Candle ... void ToggleWaitingUntilNewBar() { mWaitsUntilNewBar = !mWaitsUntilNewBar; } // // Private ... private: // // Props ... // // Tools ... }; // // Tools ...