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
등급
(468)
프로젝트
486
75%
중재
6
67% / 17%
기한 초과
0
작업중
5
개발자 5
등급
(21)
프로젝트
24
17%
중재
15
20% / 40%
기한 초과
6
25%
무료
비슷한 주문
I run an ea it makes good profits bit that one bad grid blows up the account. I want an EA which runs parallel to it which can intelligently close bad trades or grids. It shouldn't close recoverable trades but close very bad entries and grids. It can even close with hedging. The goal recover max and also not blow up the account
I need a bot that open a trade when I click on a button. the only use case is for prop firm to see that I am operating from a bot. It need only the lot size and direction input
I am looking for an expert MQL5 developer to build a high-precision Hedging System between two different MT5 brokers running on the same local PC. Core Objective: Execute opposite (inverse) trades between a Master and Slave account (e.g., Master BUY = Slave SELL, Master SELL = Slave BUY). The Challenge: Standard "Trade Copiers" are insufficient as they cannot prevent single-legged exposure when using manual trading
Aranda 30+ USD
- Project Overview: A brief description of the project’s purpose and the main problem it solves. - Core Features: List the essential functionalities required (e.g., user registration, payment gateway integration, real-time data tracking). - Technical Stack Preferences: Specify if you require a particular programming language, framework, or platform (e.g., Python/Django, React Native, MQL5). - User Interface (UI)
I want robot that can help me trade and make some money so that I can be able to learn from it while I'm still in depot account now.Is how it gonna help me with some money
Project Requirements: I need a professional MQL5 developer to create a high-frequency Gold (XAUUSD) scalping EA for MT5, optimized for Exness Zero/Raw Spread accounts. ​Core Logic: ​Strategy: Scalping on M1/M5 Timeframe using price momentum. ​No Time Limit: Since I am using an ECN broker, I do not need the 4-minute duration rule. The EA should close trades as soon as the target is hit. ​Filters: > 1. Max Spread
Hello, I have two requests: First: Feature Modification Request Currently, the EA places only one pending order at a time. I want to modify this to place two opposite pending orders (Buy Stop and Sell Stop) simultaneously, with the distance between them aligned with the existing Breakeven and Trailing Stop settings in the bot. How it should work: The EA places a Buy Stop above current price and a Sell Stop
Hello, I am looking for a professional developer to create a fully automated MT5 Expert Advisor with complete source code and resell rights. Below are my requirements: 🔹 Strategy Details: Strategy Type: (Trend + Controlled Grid / or your preferred logic) Indicators: EMA 50, EMA 200, RSI (customizable inputs) Entry Conditions: Buy when price above EMA 50 & EMA 200 + RSI confirmation Sell when price below EMA 50 & EMA
Hello, I need a professional MT5 Expert Advisor for currency trading. PAIRS: EURUSD, GBPUSD, USDJPY, USDCHF TIMEFRAME: M15 STRATEGY: - EMA 8 cross EMA 21 (entry signal) - EMA 50 for trend filter - RSI 14 confirmation (Buy > 52, Sell < 48) - No trade if RSI > 75 or < 25 SESSION: London + New York only 07:00 to 17:00 GMT No weekend trading TRADE MANAGEMENT: - Lot size: 0.06 - Take Profit: $15 per trade - Stop Loss: $8
Knight king 30+ USD
1. The bot must start when the markets start. 2.Then his capacity must be $1000. 3.and his trades must start at 0.04 slot and it must open up most available trades

프로젝트 정보

예산
50+ USD