Incoroporate existing function into EA code

Lavoro terminato

Tempo di esecuzione 1 ora
Feedback del cliente
Extremly informative and easy to work with.
Feedback del dipendente
Awesome Client (a coder who needed some guidance).

Specifiche

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





Con risposta

1
Sviluppatore 1
Valutazioni
(12)
Progetti
17
29%
Arbitraggio
6
17% / 67%
In ritardo
4
24%
Gratuito
Ordini simili
I want to build a well performance mt4 indicator or trading view indicator for my strategy, please you must make sure you are a professional in building mt4 indicator or trading view indicator with serveral years of experience, so if you are kindly react to this and let talk more on how you will get my indicator working
EA development 30+ USD
HELLO there, am looking for some one that have serveral years of experience in developing a well performance EA, that can use both mt4, mt5 platform for development, please you most be an expert in the coding of EA , THANK YOU
All rights published by the owner. Its about experience and expert advisors may not be 100% accurate but they will assist you placing or execute trades when you are busy for you not to miss entries. Its a component of mixed confluence of strategies as it fit in my trading style
Hi guys I eould like to know if it‘s possible to draw highs and lows with a horizontal line in the line chart? It should be an indicator with buffers that I can integrate it into an EA. If it‘s possible please explain how you would detect those highs and lows. Thanks in advance
Hello, I'm looking for an experienced trader that can teach me a recovery strategy that can be automated in an expert advisor. It must be all about LOW RISK and must be suitable for all Major/Minor pairs. The strategy is used to recover the equity drawdown generated by Grid/Martingale EAs. NOTE: Provide proof of your expertise and a backtest or forward test of the strategy
Smithdrift Ea 35+ USD
Ii have a manual trading trading I use to trade profitable Two time frame is use Indicators are Moving averages ,,macd,,and stochastic The strategy goes as follows ....on higher time frame window stochastic is concidered ... example 30 min time frame is use for this example ... stochastic on 30 min diverge. Main line dross signal line ()above that is a buy signal (2) 1 min chart is concider as filter ...macg default
Seeking someone who can create a robot or algorithm capable of sending 5-10 daily forex signals, each with 3 types of take profit, and achieving a high success rate similar to the one shown in the attached picture
RSI+MA 30 - 70 USD
As seen in the pictures.. Respond and I will give full specifications of what the bot should execute trades.. Please let's not watse each other's time if the pictures don't give you a hint of what is needed
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

Informazioni sul progetto

Budget
30+ USD
Per lo sviluppatore
27 USD
Scadenze
da 1 a 10 giorno(i)