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
(12)
Projects
12
25%
Arbitration
1
0% / 100%
Overdue
0
Free
2
Developer 2
Rating
(41)
Projects
46
28%
Arbitration
9
0% / 100%
Overdue
7
15%
Free
3
Developer 3
Rating
(26)
Projects
34
26%
Arbitration
7
14% / 43%
Overdue
7
21%
Free
4
Developer 4
Rating
(351)
Projects
372
70%
Arbitration
4
100% / 0%
Overdue
0
Working
5
Developer 5
Rating
(21)
Projects
24
17%
Arbitration
15
20% / 40%
Overdue
6
25%
Free
Similar orders
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
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
Hello, I’m looking for an experienced MQL5 developer to help integrate cloud-based parameter control for an existing MT5 EA. The goal is to allow EA parameters to be adjusted via a secure web interface. Please reach out via private message for more details and to discuss further

Project information

Budget
50+ USD
For the developer
45 USD