Multi Symbol EA – Bug Fix

MQL5 指标 专家

指定

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


附加的文件:

反馈

1
开发者 1
等级
(12)
项目
12
25%
仲裁
1
0% / 100%
逾期
0
空闲
2
开发者 2
等级
(41)
项目
46
28%
仲裁
9
0% / 100%
逾期
7
15%
空闲
3
开发者 3
等级
(26)
项目
34
26%
仲裁
7
14% / 43%
逾期
7
21%
空闲
4
开发者 4
等级
(438)
项目
458
73%
仲裁
5
80% / 0%
逾期
0
工作中
5
开发者 5
等级
(21)
项目
24
17%
仲裁
15
20% / 40%
逾期
6
25%
空闲
相似订单
I already have an Expert Advisor coded in MQL4, but it refuses to trade anything other than its hard-coded symbol. I want that filter gone so the same strategy can fire on any instrument—forex, indices, metals such as XAUUSD—across any timeframe. The trading logic, money management and inputs must stay exactly as they are; I simply need universal symbol support. After the MT4 file is fixed and compiles cleanly, I
Description: Gildepak is a purchasing cooperative for packaging materials. We need a program to calculate and fairly distribute the annual bonus (received from preferred suppliers) among our member companies (partners and members). The program should work with a set of predefined tables and data flows, and it must be able to import and export Excel files. Main Tables: Member Companies Company ID Company Name Partner
Hi I am looking for a coder who can write me a code which picks up a pdf from my desktop and has it run through Claude with a pre-defined prompt. After that the result should be posted in a chat. This process needs to happen twice a day with different pdfs each day. In a stage 2 the bot should be fetching that pdf automatically from my inbox and run through the mentioend process. Work output needs to be a script that
Forex Signal Indicator 50 - 100 USD
I’m looking for an experienced Forex signal copier/trader who can copy trades from multiple signal groups into my live account during the London and New York trading sessions. I currently have access to 4 different Forex signal groups. The first step will be to analyze and test which group provides the best results and aligns with our trading goals. Once we identify the most effective group, you will copy the signals
S-ONE ROBOT – MT5 EA Developer Brief 1. Trading Pairs & Timeframes Pair Timeframe Strategy Type Gold (XAU/USD) M15–H1 Scalping + Trend-following + Attacking EUR/USD H1–H4 Swing trading + Attacking Separate configurable parameters per pair (risk %, max trades, SL/TP, indicators). Timeframe Logic: Lower timeframe → precise entries (M15 for Gold, H1 for EUR/USD) Higher timeframe → trend confirmation (M30/H1 for Gold, H4
Fractal Multi-Timeframe Strategy (H4→M15→M2) — Developer Spec Abstract This document specifies a fractal trading workflow leveraging H4 for regime identification, M15 for Area of Value (AoV) location, and M2 for execution using CHoCH-based triggers. The goal is a robust, developer-friendly specification that minimizes ambiguity and matches the operational style already discussed (Liquidity → Order Block →
عنوان المشروع: مطلوب مبرمج MQL4 لإنشاء أداة إدارة لأوامر إيقاف الشراء وأوامر إيقاف البيع وصف المشروع: أبحث عن مبرمج MQL4 خبير لتطوير مستشار خبير (EA) متخصص يدير أوامر إيقاف الشراء وأوامر إيقاف البيع فقط. المواصفات الفنية: 1. الوظائف الأساسية: · يجب على المستشار الخبير مراقبة أوامر إيقاف الشراء وأوامر إيقاف البيع المعلقة الموجودة على الرسم البياني. · بمجرد تشغيل أمر معلق وتحوله إلى أمر سوق مفتوح، يجب على المستشار
Hello, good day, I want to get a MT5 Trade Copier to use on different prop firms. I am not sure of all the settings that would be required for this, I would like someone who knows how this work to help me figure it out. I need for it to have the LOT SIZE where I can multiply, divide, add, subtract and to be the same as the signal account. This is to help with brokers that are using more than 1 digit at the end. I am
Tk capital bot 50+ USD
Trading bot for trading and forex trading and other markets trade with low accounts risk management and accuracy trade in a multiple account and enter a trade when it's necessary
Ethereum EA 30 - 35 USD
I am looking for an Expert Advisor (EA) that performs well on Ethereum. Ideally it should be an HFT-style EA; a swing trading EA is acceptable. I require the full MQL5 source code — the EA must be written entirely in MQL5 (no external languages such as Python). Performance target: minimum 70% win rate with a 1:1 risk:reward. Input variables required: - Stop Levels: Stop Loss (SL) and Take Profit (TP) - Trailing stop

项目信息

预算
50+ USD
开发人员
45 USD