Multi Symbol EA – Bug Fix

MQL5 Indicators Experts

Specification

Objective: Find/fix 3 Bugs

Tasks:


1)       Bug find/fix: automatically identify and exclude orders in the “placed” status

2)       Bug find/fix: understand why sometimes the position opens with double volume and solve it

3)       “Force close” positions after the max position time (existent parameter)


EA details:

The EA monitors 75 symbols identified in a CSV file placed on the FILE folder. The same CSV also contains a series of parameters that are used to control when to open and close positions.

The code contains 1200 rows, and the open signal is on the following part:

 

And the close signal is on this part:

 

Other important aspects of the EA:

-          Whenever MultiSymbol = False, EA will only runs for the graphic where the EA was apply to (single symbol) and all inputs will come from the input screen. This should also be the choice when backtesting.

-          Whenever MultiSymbol = True, EA will search for the for the .csv file and get the customized inputs for each symbol

-          When using the MultiSymbol, the graphical lines (TP, SL, etc) will only appear for the graph where the EA is applied. If you open another screen, the lines will not appear, but if you drag another symbol to the same graph, the lines will change to reflect the scenario of this new symbol

-          None of the issues happens in the backtest, meaning that the issue happens when interacting with the broker, which is something that makes the fixing more difficult, also because the issues are not consistent

 

Why ALL issues happen:

When the buy signal is open, EA sends the order, but sometimes, this order does not get processed because:

·         Something is wrong in the broker for that particular Symbol

·         There is no more volume available at that price

All this will lead the order to stay in a “Placed” status. The big problem is that EA only checks if there is no position open for a Symbol, before sending a new order for that Symbol. This is expected, to have only one position open for each Symbol.

By not checking these placed positions, if the signal stays open, EA will keep sending orders, causing a big risk to the user if the case is that of opening a position. If the case if trying to close a position, the placed get there, never is processed and EA seems to “forget” about that position, never closing it, even after the Max time is reached

 

1)       Bug find/fix: automatically identify and exclude orders in the “placed” status

Sometimes, the buy/sell signal opens, the order is sent, but the order remains in the “placed” status, causing a lot of issues later. This happens in rare occasions, usually when the symbol “freezes” for some reason, right when the signal opens.

These placed positions might also be the reason why the EA malfunction regarding an open position, not closing for any of the “close triggers”

The expect solution (open to suggestion) is to constantly look for this status and remove them (on tick)

Also, in order to avoid more issues, if a symbol is on placed status, check and do not send other orders for the same symbol while this situation is not changed.


 

2)       Bug find/fix: understand why sometimes the position opens with double volume and solve it

The volume to fill the order is calculated based on the lot size defined in the parameter. Example: If the lot size = $10k and price of the stock is $35, the EA should try to buy 10k/35 volume, or 285 units. Then the lower next multiple of 100 need to be select, in this case 200.

In this market, all order must be in multiples of 100 (100, 200, 300, etc). This is controlled by the Lot_Min parameter.

Must of the time, this process works well, and the right volume is sent as an order, but in 1% of the cases, the order is sent with double the volume. There is apparently no relation to a specific symbol or price

After many testing, it seems that when the order takes time to be processed, EA sends another order (because the signal still open) and when broker manages to process the order, it process both of them.

 

3)       Force EA to close positions after the Max time is reached

It seems that when above issues (previously explained) happen, that particular Symbol are not monitored anymore for SL,TP and Time limit. Apparently that symbol might be getting out of the EA array that checks the open positions.

Closing a position after X minutes, should not be linked to anything else, for safety purposes, any position open more than X minutes should be closed

 

How to test the Fixes:

Backtest can be used to check basic keyl aspects of the code, but only in Single Symbol mode.

As mentioned before, these issues only happen in real accounts in live mode, since the issue is related to the interaction with the broker

Once the project starts I will share user/password to an demo account with the correct broker that will allow you to better test the EA


Files:

Responded

1
Developer 1
Rating
(356)
Projects
632
26%
Arbitration
89
73% / 13%
Overdue
12
2%
Free
Similar orders
I want to convert my tradingview indicator to MT4. I need a developer who can get it completed under the course of 24-48hrs. And I need some who is more experience at this level. Thank you
I need a indicator that will be based on RSI combined with MACD and algorithm, when I plug the indicator it must be able to give me signal of buy or sell and entry point and take profit 1 2 3 and stop loss if is a buy it must be blue arrow if is a sellthe arrow must be red
Hello, I am searching for a reliable mt4 programmer who can have a look at my existing mt4 indicator, I'm curious of having a specialist in coding to check the entire code and highlight any errors or bugs that might be affecting this indicator from not having optimal performance, keep in mind that the algorithm code will be shared with you in comment section, The purpose of this job is just to modify this indicator
I want to build an indicator or EA that calculates the statistics on an instrument, and show the statistical distribution of the calculated sample statistics. The statistics will be based on Open high low close of a candle. I want the right to the EA and the source code I want to be able to change to different timeframes and get the statistics on those time frame. When i apply the indicator to intraday timeframe, i
Pvi 30 - 200 USD
pips volume indicator between 1 to 10k counting indicator. on only specified periods of open close low hi with selected time period m1 m5 m15 etc etc with level can customize by users. changes color after each 25 percent of pips count means u set 1000 pips it must first change its color after 25 percent than 50 than 75 first the final color should be the signal of buy sell user can select the levels colors. i want to
i need someone to do a reverse engineer and decompile the indicator with the help of file provided. there are some more projects in the pipeline. The indicator should be capable of analyzing real-time market data and generating accurate trading signals for different financial instruments listed on the
Indicator Functionality: Display 4 lights on the top right corner of the chart. Each light reflects a specific timeframe and EMA condition: Light 1 (1H timeframe): Red: Close price below both EMA 12 and EMA 16. Green: Close price above both EMA 12 and EMA 16. Light 2 (15M timeframe): Red: Close price below both EMA 12 and EMA 16. Green: Close price above both EMA 12 and EMA 16. Light 3 (1M timeframe): Red: Close
I need to correct/modify EA based on Martingale strategy which include no. of modules, manual lot size, Martingale factor, TP, SL, Cutt-off SL, Balance DD limit, Enable new orders, Reverse orders, Equity Rise, News filter, Time filter, Alert, Chart Panel etc,. MA crossover logic to be added. Details can be discussed on personal basis. Base source files shall be submitted by freelancer. Existing EA can be shared which
I have an Indicator that buffers values I can see, but those are not working with EA. I needed to be ready for those buffer values that would work with an EA. Thank you
Hello I am looking for a developer to help me backtest my custom ninjatrader 8 strategy andake it work perfectly your expertise is highly need for this project kindly reach out to me and let proceed

Project information

Budget
50+ USD
For the developer
45 USD