Clean up and fix EA MT4

MQL4 指标 专家

工作已完成

执行时间3 小时

指定

Hello. I need to clean up the code of an EA. There are some things to delete, some to be remade better and above all, errors to fix.


Errors are two:

1) The EA gives an error in live trading, in backtesting not, but in live it gives sometimes the error "Order failed - Invalid TP/SL",
and when this error happens the order is not opened. Some say that is because the Stoploss and TakeProfit are too small, but I tried increasing them and the issue persist.
The developer should check on his own on M1 timeframe in Live that the error is fixed.

2) Testing with some brokers, in backtest it returns error "OrderSendError 130". This error should be fixed.


Then, regarding deleting parts and remake some parts better, I scrolled down the code and signed the parts to delete and the ones to check to be fixed:

  • From line 77 to 86 in the properties under "Close Order Settings" and the relative parts in the code, should be deleted (down below I state where are these parts.
  • The lines 75, 76 in the properties and the relative function in the code "IsFarEnough()", should be deleted (down below I state where are these parts).
  •  From line 114 to 119 in the properties under "Martingale Settings" and the relative parts in the code that use Martingale, should be deleted (down below I state where are these parts).
  • From line 412 to 417 I think is useless, so it can be deleted, together with the relative parts in the code.
  • At line 450 and 460 I added on my own the functions: (LastActionTime != Time[0]) and isDelayed(), which both together allow the EA to open only one order per candle after the open of the candle (if signal is true),
    and when the order is closed by StopLoss or TakeProfit, the next order is always opened on the next candle if the signal on that candle is true. But these functions are not the best way to do this, so they should be replaced with better code.
    I summarize how it should be: if signal is true, the EA should open only one order per candle, then after some candles the order is closed by Take Profit, then if signal is true on the same candle where order has been closed the EA should NOT open a new order on that candle,
    but it should wait the next candle to open, so if the signal is true the EA should open an order only one time on that new candle...and so on.
  • From 477 to 513 are Alerts, you can delete them, I don't use them.
  • From Line 518 to 530 is CloseByTime() a function to close order that can be deleted, I don't use it.
  • From 532 to 545 is function IsGoodTime, it's the timefilter, this one I use and you should check if there are no errors. And also for function IsFridayEvening(line 550-555) and function IsCloseTime(Line 560-567)
  • From Line 569 to 760 is the main part, it should be checked if there are errors or bugs.
  • From line 823 to 830 is Martingale, delete it.
  • From 832 to 1020 should be checked for errors, it a buggy part: function Normalize Lots at line 905 is not used, but some parts of it are still used, it should be revised, or better deleted.
  • Recovery() at line 1004 I don't know what is...
  • From 1026 to 1086 are the functions that are called at lines 450, 460...as I said they should be replaced with better solution.
  • From line 1090 to the end, delete all.

    As you can see there are more things to delete than to fix. I hope that doing part of the work can speed up yours. I cannot delete them on my own because I'm afraid to delete something that is useful, it's better the developer do that.

    I guess bugs are in the main parts, the ones to send orders or SL, TP, TrailingStop parts...


    I request final mq4 file source code.

    Thanks.

    Regards





      反馈

      1
      开发者 1
      等级
      项目
      129
      18%
      仲裁
      11
      27% / 55%
      逾期
      4
      3%
      空闲
      2
      开发者 2
      等级
      项目
      72
      49%
      仲裁
      4
      0% / 50%
      逾期
      19
      26%
      空闲
      3
      开发者 3
      等级
      项目
      209
      28%
      仲裁
      0
      逾期
      3
      1%
      空闲
      4
      开发者 4
      等级
      项目
      151
      48%
      仲裁
      6
      83% / 17%
      逾期
      2
      1%
      空闲
      5
      开发者 5
      等级
      项目
      280
      65%
      仲裁
      6
      17% / 33%
      逾期
      10
      4%
      已载入
      6
      开发者 6
      等级
      项目
      12
      42%
      仲裁
      1
      0% / 100%
      逾期
      2
      17%
      空闲
      7
      开发者 7
      等级
      项目
      30
      63%
      仲裁
      0
      逾期
      4
      13%
      空闲
      8
      开发者 8
      等级
      项目
      540
      50%
      仲裁
      55
      40% / 36%
      逾期
      224
      41%
      工作中
      9
      开发者 9
      等级
      项目
      14
      21%
      仲裁
      1
      0% / 100%
      逾期
      1
      7%
      空闲
      10
      开发者 10
      等级
      项目
      143
      34%
      仲裁
      10
      10% / 60%
      逾期
      26
      18%
      空闲
      相似订单
      Hey Guys i've a PineScript /Source Code / ( Trading View ) indicator which has Buy and Sell Sign . i wanna make a MT5/4 Robot by it with some features . I need it has a simple panel to shows some details of robot at screen
      Hi dear coders, I have an EA and for this EA I want additional code for Risk Management at my code, trade is triggered with this line int TheTicket = OrderSend(_Symbol,TradeType,(double)DoubleToString(TheLots,2),TradeType==OP_BUY?Ask:Bid,10,TheSL,TheTP,TheComment,MagicNumber,0,TradeType==OP_BUY?clrBlue:clrRed); I want you create a code and tutorrial how to change my code. the new code will be Risk Management Inputs
      I'm seeking a Forex HFT Scalping EA that operates on live streaming tick data and candlestick patterns, executing a high frequency of trades without balance restrictions. The EA should be compatible with major currency pairs like EUR/USD, GBP/USD, USD/JPY, AUD/USD, GBP/JPY, GBP/AUD, and XAU/USD, as well as US30 indices. Given its HFT nature, it should focus on the 1-minute, 5-minute, 15-minute, and 30-minute
      I need a custom MT5 EA that can place trades (Buy & Sell) from two Telegram channels. One telegram channel will give the trend signal (Bullish or Bearish) and the second telegram channel will give buy and sell signals
      hello i like to have zigzag added to my EA and set orders when it makes a pullback strategy (Higerlow/Lowerhigh) or break of market structure strategy Higherhigh/Lowerlow break set order entry I want it to be able to do these 2 things but one at a time. -Zigzag makes a pullback into an HigherLow/LowerHigh set order entry -Zigzag breaks structure HigherHigh/LowerLow set order entry - For PULLBACK STRATEGY i just want
      Looking for a indicator that can show where the majority of retail stop losses are placed Please can someone advise me how best to achieve this but it needs to be accurate
      I have a grid trading bot that needs debugging. its perfect apart from a random stop loss I encountered. It’s supposed to have a stop loss at 99% but it one time closed trades at around 25% loss. Here is a list of potential things causing it to bug out (it’s running on MQL VPS MT5, I also want to retain the ability to close positions manually); - Chart change (symbol or timeframe) - Recompiling the EA - Server
      Me gustaría poder crear automaticamente varias ordenes que se queden pendientes pudiendo definir los siguientes parámetros: Tipo de orden (Buy y sell stop, buy y sell limit. Precio de compra / venta. Pudiendo entrarlo manualmente o como un numero de puntos a sumar/restar del precio actual de marcado. Numero de puntos que ocuparan en total las ordenes y numero de ordenes a insertar (Ejemplo: 200 puntos, 4 ordenes, es
      tardes desarolladores, quiero hacer un sistema semiatomatico, el deberia abrir las operaciones de venta o compra en un punto donde yo haga el analisis cumpliendo siertos criterios, por ejemplo abrir la operacion despues de que tresvelas del mismo color salga de un punto donde yo deje marcado , abriendo una operación 1/1 tenuendo en cuenta dos lineas que yo dejare marcadas
      Hi developer, I need a EA bot with forex news filtering for JPY currency pairs(usdjpy, audjpy,gbpjpy,cadjpy) and USD currency pairs (audUSD,EURUSD, gbpUSD, NZDUSD, USDcad, USDCHF, xauusd). That's no problem if you can share your own profitable ea to me for 100 usd. I don't have any idea about ea strategy. But, I need profit in this ea Please share backtest, strategy, how ea works and ea's features

      项目信息

      预算
      40+ USD
      VAT (22%): 8.8 USD
      总计: 48.8 USD
      开发人员
      36 USD
      截止日期
       7 天