Search for "news trader" and filter (left side) for articles, CodeBase and Forum - you'll find lots of examples you can use!
I need a code that print the actual number of a specific news event on opening of every candle. But it always returns "0.0"!!
Where exactly did I make mistake?
How did you get the magic number 144520? NB. You should not never use magic numbers in your code except for magic numbers in orders for EAs ;-)
The ID in CalendarValueById is an ID of a value (specific news event record).
The ID in CalendarEventById is an ID of an event type (general/repetitive/continuous news set with the same nature, for example NFP, GDP, etc).
Both should be obtained from the calendar database, and can be equal only as a meaningless coincidence.
You can find examples of retrieval of calendar news in the docs or in the book.
The value 0 in actual_value means that the event is not yet happen (in future).

- www.mql5.com
The value 0 in actual_value means that the event is not yet happen (in future).
Correction: The value 0 in actual_value means that the event is not indicative (not of the type CALENDAR_TYPE_INDICATOR). For future quantitative events "no value" is specified by storing LONG_MIN (-9223372036854775808) in the field.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Everyone!
I need a code that print the actual number of a specific news event on opening of every candle. But it always returns "0.0"!!
Where exactly did I make mistake?