Incoroporate existing function into EA code

작업 종료됨

실행 시간 1 시간
고객의 피드백
Extremly informative and easy to work with.
피고용인의 피드백
Awesome Client (a coder who needed some guidance).

명시

The developer will create a usable function that uses the attached MUTEX code to stop an EA from opening orders on multiple charts at the same time.


I will then add the developers created function into my EA's code.


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class Mutex
  {
#ifndef MUTEX_TIMEOUT_MSEC
#define MUTEX_TIMEOUT_MSEC    60000 // Trade context busy maximum delay 
#endif

public:
   void                 Mutex()                     : mName("GV_Mutex"), mLocked(false) {Lock();}
   void                 Mutex(const string& aName)  : mName(aName), mLocked(false) {Lock();}
   void                ~Mutex() {Release();}
   void                 Lock(void)
     {
      if(mLocked)
         return;
      uint startWaitingTime  = 0;
      if(!GlobalVariableTemp(mName))
        {
         int err = GetLastError();
         if(err != ERR_GLOBAL_VARIABLES_PROCESSING)
           {
            PrintFormat("Mutex: GVSet Failed: %i", err);
           }
         return;
        }

      while(true)
        {
         if(!IsTradeContextBusy()&& GlobalVariableSetOnCondition(mName, 1, 0))
           {
            if(startWaitingTime != 0)
              {
               RefreshRates();
              }
            mLocked = true;
            return;
           }
         if(IsStopped())
           {
            Print("Mutex: The expert was terminated by the user!");
            return;
           }

         if(startWaitingTime == 0)
           {
            startWaitingTime  = GetTickCount(); // Remember start time.
           }
         else
           {
            uint delay = GetTickCount() - startWaitingTime;

            if(delay > MUTEX_TIMEOUT_MSEC)      // Abort.
              {
               PrintFormat("Wait time (%i sec) exceeded!", MUTEX_TIMEOUT_MSEC / 1000);
               return;
              }

            Sleep(1000);
           }
        }// while
     }  // Lock

   void              Release(void)
     {
      if(mLocked)
        {
         if(!GlobalVariableSet(mName, 0))
           {
            PrintFormat("Mutex: GlobalVariableSet(UNLOCK): Error #", _LastError);
           }

         mLocked=false;
        }
     }

   bool                 IsLocked(void)             const {return mLocked;}

private:
   string               mName;
   bool                 mLocked;
  }; // Mutex





응답함

1
개발자 1
등급
(12)
프로젝트
17
29%
중재
6
17% / 67%
기한 초과
4
24%
무료
비슷한 주문
I need an expert in the development of a fully automated trading robot For MetaTrader. The Trading Robot must be "Web based" so it can be accessed or used through a website, You can view a screenshot here; https://www.awesomescreenshot.com/image/48030918?key=79b0ff91455d862746e9b649341f4cdb Why do i need? Simple Enough, This is what i need from my Trading Robot EA. The Trading Robot can only be accessed through a
Metatrader 30+ USD
I would like to calculate the deviations between the companies listed below with Meta Trader. Would you be interested? BETWEEN 01.00 AT NIGHT AND 00.00 OF THE NEXT DAY (FOR HOURS WHEN THE GOLD MARKET IS OPEN) *Instant comparison of prices of the same parities of different companies *Determination of deviation rates in downward or upward movements (average prices, prices below and above the average) *Detection of
Greenprint strategy 30 - 100 USD
Hello i need someone who can create an indicator to show the resistance support and pivot areas like in the shown images the indicators are bollinger bands moving averages also we have rsi and ma . Pictures below. You should be able to do work properly requesting a trial check when work is complete the indicator should also work with synthetic indices
SpotBot45 30+ USD
I know nothing about trading so am looking for a custom made automated trading bot with medium risk and maximum returns.I am looking for about a ten percent return per day minimum and minimise as much risk where possible
I would like to make a SMC EA for MT5 based on multi timeframes analyzing the price action. and make it more details with more user input added.'' source code needed'' First of all here's a video which helped me for this: https://www.youtube.com/watch?v=vEXji2ClXMc The ea should find a entry signal that based on the SMC concept below and each entry trigger can be turned on and off. Based on the Multi timeframe of
Hello, I need a quote for developing a bot for my renko based trading system on ctrader platform and based on the attached specification your expertise is highly needed for this project Thanks
i want an EA that enters based on the form of a candle if the lower wick is bigger then the rest of the candle i want buy and if the upperwick is bigger then the rest of the candle i want a sell single, i want it to enter with the sl 1 tick lower or higher then the lower or upperwick depening on buy or sell trade. then the stoploos needs to move when the trade goes to 0,5% sl too break even, when trad eis on 1% sl to
Hello, please let me know if any of these strategies can be turned into a bot (automation) and run 24/7 on a vps. Also note that they might not use the latest versions of indicators, if this matters, then please check for the latest versions. Thank you! Dan https://1drv.ms/f/s!Alr17W7ddJLYgYgiFKZYluOfokbfQg
Hello! Thanks for reading. I need an EA with an inbuilt/already made strategy that I can use for prop firms. The drawdown should be very low of only 2-4% max and another criteria is that no one else other than you are currently using it and if you happen to use it you must tell me which prop firm you are using it on to avoid us using the same EA on the same prop firm to get the account denied. As you know or may
Hello, I would like you to help me develop a simple Expert Advisor (EA) for trading the Boom and Crash markets. All the project requirements is available with me . kindly bid if you can develop EA for boom and out crash . Thanks

프로젝트 정보

예산
30+ USD
개발자에게
27 USD
기한
에서 1  10 일