Asesoría para convertir un programa de MQL4 a MQL5

Работа завершена

Время выполнения 2 дня
Отзыв от заказчика
Excelente resolvió mi problema en muy poco tiempo. espero trabajar con el de nuevo.

Техническое задание

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); 
}


Откликнулись

1
Разработчик 1
Оценка
(294)
Проекты
470
39%
Арбитраж
102
40% / 24%
Просрочено
78
17%
Занят
Опубликовал: 2 примера
2
Разработчик 2
Оценка
(78)
Проекты
117
47%
Арбитраж
7
14% / 29%
Просрочено
11
9%
Свободен
Похожие заказы
Buenas tengo un bot de metatrader 4 y me gustaria que me lo transformaran en lenguaje de mql5 para que funcione en la plataforma de Metatrader 5 SIN MODIFIFCAR nada de la estrategia del bot ni nada, es decir, convertir el codigo de mt4 a mt5 y a mayores, quisiera aprovechar para poder crear un menu para configurar los parametros del EA, que sea intuitivo, seperado por modulos con sus titulos y que sea mas atractivo
I am looking for an experienced MQL4 / MQL5 developer to convert my existing Risk–Reward indicator into a fully functional Expert Advisor (EA) . ⚠️ Important: The indicator is my own and I already have the full source code . At the moment, it works exactly like the Risk–Reward tool in TradingView , visually showing entry, stop loss, and take profit. Now, I want to transform it into an EA capable of executing and
1. Que se trace línas diagonales de "SOPORTE" que entre toques por acción del precio de velas de un tiempo, ejemplo: H1, empate con la MA sobre velas de precio, con confirmación de MACD (12.26.3) 2. Que se trace línea diagonal desde 2 toques en la RSI, y que empate en el "3" tercer toque con la MA sobre precio en H1. 3. Arreglar un Bug, donde cuando toque el take profit o stop lost de money management, pare los bots

Информация о проекте

Бюджет
40+ USD