Asesoría para convertir un programa de MQL4 a MQL5

Job finished

Execution time 2 days
Feedback from customer
Excelente resolvió mi problema en muy poco tiempo. espero trabajar con el de nuevo.

Specification

quiero convertir un programa y necesito asesoria para la conversion y aprender.

quiero mantener el mismo formato tanto como sea posible .

son varias funciones a convertir dejo ejemlo de una funcion.

bool Buy(int MagicIndex, double Lots, int StopLossMethod, double StopLossPoints, int TakeProfitMethod, double TakeProfitPoints, int Slippage, int MaxOpenTrades,
         int MaxFrequencyMins, string TradeComment)
{
   static double pipSize = 0;   
   if(pipSize == 0) pipSize = Point * (1 + 9 * (Digits == 3 || Digits == 5));

   double sl = 0, tp = 0;
   double stopLossPoints = 0, takeProfitPoints = 0;
   
   int numberOfOpenTrades = 0;
   
   for(int i=OrdersTotal()-1;i>=0;i--){
      if(!OrderSelect(i, SELECT_BY_POS)) continue;
      if(OrderMagicNumber() != __STRATEGY_MAGIC + MagicIndex || OrderSymbol() != Symbol()) continue;
      numberOfOpenTrades ++;    
   }   

   if(MaxOpenTrades > 0 && numberOfOpenTrades >= MaxOpenTrades) return(false);       
  
   if(MaxFrequencyMins  > 0)
   {   
      int recentSeconds = MaxFrequencyMins * 60;

      for(int i=OrdersTotal()-1;i>=0;i--){
         if(!OrderSelect(i, SELECT_BY_POS)) continue;
         if(OrderMagicNumber() != __STRATEGY_MAGIC + MagicIndex || OrderSymbol() != Symbol()) continue;
         if(TimeCurrent() - OrderOpenTime() < recentSeconds) return(false);
      }  

      int hstTotal=OrdersHistoryTotal();
   
      for(int i=hstTotal-1;i>=0;i--)
      {  
         if(!OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) continue;
         if(OrderMagicNumber() != __STRATEGY_MAGIC + MagicIndex || OrderSymbol() != Symbol()) continue;      
         if(TimeCurrent() - OrderOpenTime() < recentSeconds) return(false);
         break;            
      }  
   }
   
   if(Lots < MarketInfo(Symbol(),MODE_MINLOT)) return(false);
   
   if(AccountFreeMarginCheck(Symbol(), OP_SELL,Lots) <= 0) {
      Print("Buy error: insufficient capital");
      return(false);
   }   

   if (StopLossPoints > 0)
   {
      if(StopLossMethod == 0)
      {
         sl = NormalizeDouble(Ask - StopLossPoints * Point, Digits);
         stopLossPoints = StopLossPoints;
      }
      else if (StopLossMethod == 1)
      {
         sl = NormalizeDouble(Ask - StopLossPoints * pipSize, Digits);
         stopLossPoints = StopLossPoints * (1 + 9 * (Digits == 3 || Digits == 5));
      }
      else
      {
         sl  = StopLossPoints;
         stopLossPoints = (Ask - sl)/Point; 
      }
   }
   
   if (TakeProfitPoints > 0)
   {
      if(TakeProfitMethod == 0)
      {
         tp = NormalizeDouble(Ask + TakeProfitPoints * Point, Digits);
         takeProfitPoints = TakeProfitPoints;
      }
      else if (TakeProfitMethod == 1)
      {
         tp = NormalizeDouble(Ask + TakeProfitPoints * pipSize, Digits);
         takeProfitPoints = TakeProfitPoints * (1 + 9 * (Digits == 3 || Digits == 5));
      }
      else
      {
         tp = TakeProfitPoints;
         takeProfitPoints = (tp - Ask)/Point; 
      }
   }  
   
   double stopLevel = MarketInfo(Symbol(),MODE_STOPLEVEL) + MarketInfo(Symbol(),MODE_SPREAD);
   
   if( (sl > 0 && stopLossPoints <= stopLevel) || (tp > 0 && takeProfitPoints <= stopLevel) )
   {
      Print("Cannot Buy: Stop loss and take profit must be at least " 
      + DoubleToStr(MarketInfo(Symbol(),MODE_STOPLEVEL) + MarketInfo(Symbol(),MODE_SPREAD),0) 
      + " points away from the current price");
      return (false);
   }
          
   RefreshRates();
        int result = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, sl, tp, " " + "(" + WindowExpertName() + ") " + TradeComment, __STRATEGY_MAGIC + MagicIndex);
        
        if (result == -1){
                Print("Failed to Buy: " + IntegerToString(GetLastError()));
                Sleep(__SLEEP_AFTER_EXECUTION_FAIL);
           return(false); 
        }
         
   return(true); 
}


Responded

1
Developer 1
Rating
(298)
Projects
478
40%
Arbitration
105
40% / 24%
Overdue
82
17%
Loaded
Published: 2 codes
2
Developer 2
Rating
(78)
Projects
117
47%
Arbitration
7
14% / 29%
Overdue
11
9%
Free
Similar orders
EA Vencido 30 - 100 USD
Hace tiempo compré un EA, y se suponía que no tenía fecha de vencimiento y dejo de funcionar porque aparece vencido, solo tengo ex5 y el programador no responde, usa un indicador y se el TP y SL y nada más. ¿Puedes arreglar esto
Necesito un Expert Advisor para MetaTrader 5 que opere XAUUSD en temporalidad M1 (broker XM). La idea es que el EA lea el mercado rápido, decida si va a subir o bajar y entre de inmediato, sin filtros que lo dejen inactivo mucho tiempo. Lógica de entrada: Tendencia con EMA 8, 21 y 50 en M1, con entradas por retroceso y recuperación de la EMA. ADX como filtro de fuerza, sin zonas muertas donde el bot no opere. M5 (EMA
NECESITO UN BOT QUE OPERE EN ORO 24/5 DONDE ANALICE EL MERCADO, CONFORME SU FUERZA TOME OPERACIONES CORTAS TIPO SCALPING CORTO, SEÑALES ABIERAS POR TIEMPO LIMITADO QUE SE ADAPTE AL PRECIO DEL MERCADO Y SU VOLATILIDAD
Hello. I need a professional developer to translate a proprietary strategy from a TradingView Indicator (Pine Script) into a fully automated Expert Advisor (EA) for MetaTrader 5 (MT5). The bot will trade NAS100 based strictly on specific New York session windows, volume confluences, and a daily VWAP filter. Execution must be via Market Orders only (no pending orders). I have a complete ZIP folder prepared with the

Project information

Budget
40+ USD