Lavoro terminato
Tempo di esecuzione 2 giorni
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Feedback del cliente
Excelente resolvió mi problema en muy poco tiempo. espero trabajar con el de nuevo.
Specifiche
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); }
Con risposta
1
Valutazioni
Progetti
415
38%
Arbitraggio
86
44%
/
19%
In ritardo
70
17%
Occupato
2
Valutazioni
Progetti
117
47%
Arbitraggio
7
14%
/
29%
In ritardo
11
9%
Gratuito
Ordini simili
Necesito copiar trades de mt4 a ctrader y de mt4 a mt5 mediante una copiadora. Entre lo parámetros modiifcables necesito que se pueda elegir el riesgo de una cuenta y de otra
Nombre: Serpiente Lote: 0.01 ZigZag true - true/False 1 Depth 100 2 Deviation 40 3 Backstep 25 GRID Niveles grid 3 Distancia lotes 30 SL lotes 0 TP lotes 0 Abrir Largos true/false Abrir Cortos true/false Abrir Ordenes Limite true/false Abrir Ordenes Stops true/false CONDICIONES --Cuando ZZ, sea positivo abrir solo ordenes largas. --Cuando ZZ, sea negativo abrir solo ordenes
Informazioni sul progetto
Budget
40+ USD
Per lo sviluppatore
36
USD