Help fixing EA and adding horizontal line

Job finished

Execution time 27 days

Specification

I found a code here, that allows displaying the MQL5 Calendar news in real and backtesting mode as vertical lines, with the news for one currency in one color and the news of the other currency in a different color. However, I am getting an error  ("array out of range ") that I want you to fix.

In addition, I want you to create another function that will draw a horizontal line covering some time before and after a news event.

This function will be called "DisplayNewsWindow" and will take as variables (Currency, EventName, and WindowHours). Say that for the Currency ,  "USD", the EventName "Wholesale Sales m/m" will be on January 10 at 8am, so if I use DisplayNewsWindow ("USD","Wholesale Sales m/m", 2), and horizontal line at the bottom of the chart should appear between 6am and 10 am on that day (i.e., 2hours before and after the news event). The currency name and News event name should appear as tooltip, as you mouse hover the horizontal bar.

I attach the files: "News" is a Class file that saves and updates the list of events in a local computer. "NewsEA" is the EA in which that function is used. You need to create the DisplayNewsWindow function in the News file and use it in the EA.


I think the error is in the fucntion CNews::next2


Ultimately, I want the news events drawn as vertical lines in two colors (one for each currency in a symbol), and some specific news drawn as horizontal lines in the chart, also color coded by currency.

Files:

MQH
News.mqh
30.6 Kb
MQ5
NewsEA.mq5
347 b

Responded

1
Developer 1
Rating
Projects
0
0%
Arbitration
1
0% / 100%
Overdue
0
Free
2
Developer 2
Rating
(137)
Projects
161
22%
Arbitration
7
14% / 43%
Overdue
4
2%
Working
3
Developer 3
Rating
(140)
Projects
204
80%
Arbitration
17
29% / 47%
Overdue
10
5%
Working
4
Developer 4
Rating
(31)
Projects
41
20%
Arbitration
9
11% / 89%
Overdue
5
12%
Free
5
Developer 5
Rating
(17)
Projects
18
28%
Arbitration
4
50% / 25%
Overdue
1
6%
Working
6
Developer 6
Rating
(38)
Projects
40
25%
Arbitration
20
15% / 75%
Overdue
8
20%
Loaded
7
Developer 7
Rating
(3)
Projects
1
0%
Arbitration
2
0% / 100%
Overdue
0
Working
8
Developer 8
Rating
(57)
Projects
177
71%
Arbitration
4
100% / 0%
Overdue
1
1%
Free
9
Developer 9
Rating
(74)
Projects
86
57%
Arbitration
0
Overdue
0
Free
10
Developer 10
Rating
(27)
Projects
27
26%
Arbitration
2
0% / 50%
Overdue
1
4%
Free
11
Developer 11
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
I have an indicator i will like to view in form of dashboard across various timeframes, i also will like a push notifications alert feature that will appear on my mt4 mobile to keep track of my trading pairs
Make ea 30+ USD
I want close option signal option even when tp and sl is active with take profit stop loss and trailing stop loss. time filter, auto lots x balance. i get paid on 00:00 uk time so i can send the agreement
i get paid in 12 hour too send agreement Once the Tp or stop loss or trailing sl is hit a new order is placed in the direction of where the Tp and sl or tsl is hit immediately So trail profits until close and open new trade in reverse direction immediately and trail until close again points for trailing sl, tp and sl I want the trailing stop too have two different functions one is that it’s trails from the entry
// @version= 5 strategy ( "EMA Crossover Strategy with 1:1.6 Risk-Reward" , overlay = true ) // Define the EMAs shortEma = ta.ema ( close , 10 ) longEma = ta.ema ( close , 20 ) // Plot the EMAs on the chart plot ( shortEma , color = color.blue , title = "10 EMA" ) plot ( longEma , color = color.red , title = "20 EMA" ) // Calculate the crossover conditions longCondition = ta.crossover ( shortEma , longEma )
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
Hello, I am looking for a highly skilled and experienced MT4 developer to assist with transferring a strategy currently coded in Pine Script to MetaTrader 4 (MT4). The project requires a professional who can handle this project successfully. I am looking for a dedicated and professional developer who can deliver high-quality results. If you have any questions or need further details about the project, feel free to
Hello, I am looking for a highly skilled and experienced MT5 developer to assist with modifying an existing MT5 file. I am looking for a dedicated and professional developer who can deliver high-quality results. If you have any questions or need further details about the project, feel free to reach out. Thank you for your time and consideration. I look forward to working with the right expert to bring this project to
An EA based on zigzag and some indicators ( The ea is already working i need to add this indicator to guide and control trades) Project Overview: - I am seeking a skilled freelance developer to enhance my existing Expert Advisor (EA) by creating source code that I can easily integrate. The EA currently uses Moving Averages (MA) and lines to place trades. I need to add a zigzag function with a true/false option and
We are looking for an experienced coder to develop a trading robot that utilizes two main indicators: 1) Brain Trend Signal 2) TMA (Triple Moving Average) Centered Bands. The robot should generate buy and sell signals based on specific conditions and include robust risk management features. Initial Requirements - **Indicators**: 1. Brain Trend Signal 2. TMA Centered Bands - **Timeframes**: - H4/D1 for trend
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
from 1 to 7 day(s)