Clean up and fix EA MT4

MQL4 Indicators Experts

Job finished

Execution time 3 hours

Specification

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





      Responded

      1
      Developer 1
      Rating
      (115)
      Projects
      129
      18%
      Arbitration
      11
      27% / 55%
      Overdue
      4
      3%
      Free
      2
      Developer 2
      Rating
      (43)
      Projects
      72
      49%
      Arbitration
      4
      0% / 50%
      Overdue
      19
      26%
      Free
      3
      Developer 3
      Rating
      (182)
      Projects
      186
      27%
      Arbitration
      0
      Overdue
      3
      2%
      Free
      4
      Developer 4
      Rating
      (126)
      Projects
      151
      48%
      Arbitration
      6
      83% / 17%
      Overdue
      2
      1%
      Free
      5
      Developer 5
      Rating
      (220)
      Projects
      249
      61%
      Arbitration
      3
      33% / 67%
      Overdue
      5
      2%
      Working
      6
      Developer 6
      Rating
      (7)
      Projects
      12
      42%
      Arbitration
      0
      Overdue
      2
      17%
      Free
      7
      Developer 7
      Rating
      (28)
      Projects
      30
      63%
      Arbitration
      0
      Overdue
      4
      13%
      Free
      8
      Developer 8
      Rating
      (259)
      Projects
      533
      50%
      Arbitration
      54
      41% / 37%
      Overdue
      224
      42%
      Working
      9
      Developer 9
      Rating
      (14)
      Projects
      14
      21%
      Arbitration
      1
      0% / 100%
      Overdue
      1
      7%
      Free
      10
      Developer 10
      Rating
      (66)
      Projects
      143
      34%
      Arbitration
      10
      10% / 60%
      Overdue
      26
      18%
      Working
      Similar orders
      I have the source code attached which is my attempt at merging / converting: Into MQL5 code, but instead of being an indicator I just need it to return the same values as the indicator. What I need help with: I need the values in the comments to return similar to the demo indicator below - currently it is showing values near the price, but would instead expect - values from -80 to 80 like the indicator How to test: -
      The EA follows a simple trading strategy without the need for any signals. Entry and exits rules for new positions are based on profit and time triggers of previous positions. An overall profit triggers closes all open positions. A sequence of max 10 open positions is envisaged. 3 parameters for each position shall be configurable in input settings. A detailled requirements specification as well as examples are
      Im going to automate my strategy, see attached file with description of the requirements. Everything you need in order to understand the strategy is listed in the document. If any questions appear feel free to ask! Please leave a quote. thanks ahead. /Axel
      — EA RULES — 1. At the OPEN of each new candlestick: BUY / SELL / DO NOTHING — Trades all symbols and timeframes simultaneously — EA SETTINGS — 1. Max Exposure Risk %: (Input) (On/Off) 2. Max Daily TakeProfit %: (Input) (On/Off) 3. Max Daily Trailing Drawdown %: (Input) (On/Off) — Parameter optimization is based on these 3 settings ======================================== 1. Data EA: — All symbols data (Done) — All
      EA is based on Zig Zag indicator and candlestick patterns and is not catching all valid trades due to Zig Zag limitations, lagging last leg or repainting I guess. Before I will select you please present me a solution for this issue. I am so sorry, but I haven't got time for an amateur programmers. I am searching a programmer for a longer co-operation
      Brizzo bot 1.2 30 - 150 USD
      *Strategy Name:* Mean Reversion Bot *Market:* Stocks (e.g., S&P 500) *Timeframe:* Daily *Entry Rules:* 1. Calculate the 50-day simple moving average (SMA) of the stock price. 2. If the current stock price is below the 50-day SMA by 2% or more, buy the stock. 3. If the current stock price is above the 50-day SMA by 2% or more, sell the stock (or short if allowed). *Exit Rules:* 1. Set a stop-loss at 5% below the entry
      Diamond back 1,2 30 - 150 USD
      I can't create a trading robot for you, but I can help you design a basic trading strategy that you can use as a starting point to develop a trading robot. Here's a simple example of a mean reversion strategy: *Strategy Name:* Mean Reversion Bot *Market:* Stocks (e.g., S&P 500) *Timeframe:* Daily *Entry Rules:* 1. Calculate the 50-day simple moving average (SMA) of the stock price. 2. If the current stock price is
      An EA that monitors orders and enters them into recovery mode when a certain DD is reached. Recovery mode uses the well known 'Zone recovery' to help orders that are in drawdown exit at breakeven or even in profit. It is also possible to open trades with a trade panel and there are settings to activate a 'positive grid' (grid in profit) Please read the document carefully before responding to the job, this is not a
      Hi, I need EA’s that are based on hedge or martingale with partial closing of bad trades. Below please find examples of what I am looking for: https://www.mql5.com/en/signals/1998313 https://www.mql5.com/en/signals/1925739 I need valid proof of historical trading such as trade report etc. Finally, I need the ex4 to run on my own computer. Please help me out
      I need a tool with which I can trade range trading with Martingale strategy, I want to draw a range in the chart and the tool should set a buy order above and a sell order below the range until the specified percentage (not dollar value) take profit is reached in one direction. I would like to be able to change the take profit if necessary as in the Range and Take profit video it must be so that the open orders in

      Project information

      Budget
      40+ USD
      VAT (22%): 8.8 USD
      Total: 48.8 USD
      For the developer
      36 USD
      Deadline
      to 7 day(s)