Menu
Brokers
MT4 Forex Brokers
MT5 Forex brokers
PayPal Brokers
Skrill Brokers
Oil Trading Brokers
Gold Trading Brokers
Web Browser Platform
Brokers with CFD Trading
ECN Brokers
Bitcoin FX Brokers
PAMM Forex Brokers
With Cent Accounts
With High Leverage
Cryptocurrency Brokers
Forums
All threads
New threads
New posts
Trending
Search forums
What's new
New threads
New posts
Latest activity
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Reply to thread
Forums
Trading Platforms
MetaTrader 5
MetaTrader 5 Client Terminal Build 2755
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
[QUOTE="9nix6, post: 192068, member: 71974"] There is a serious bug in the latest version of [B]the CustomRatesUpdates [/B]function of MQL5. Actually, the bug has been around for quite some time. Some developers tested all of the previous versions between 2755-2784 (pus all of the latest beta releases). Here is my sample code that will cause the bug to surface. It can be used as a test harness by the developers of MT5. [CODE=mql5]static string _CustomSymbol = "Custom"+_Symbol; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { ResetLastError(); if(!CustomSymbolCreate(_CustomSymbol, "", _Symbol)) { Print("Failed creating custom chart, error #"+(string)GetLastError()); ResetLastError(); } else { Print("Created "+_CustomSymbol+" chart"); } return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { MqlRates ratesArr[]; if(CopyRates(_Symbol, PERIOD_M1, 0, 1, ratesArr) == -1) { Print("Error on CopyRates #"+(string)GetLastError()); ResetLastError(); } else { if(CustomRatesUpdate(_CustomSymbol, ratesArr) == -1) { Print("Error on CustomRatesUpdate #"+(string)GetLastError()); ResetLastError(); // this error surfaces when a new day starts // Error on CustomRatesUpdate #5304 // 5304 -> A custom symbol with the same name already exists // or // Error on CustomRatesUpdate #0 // Messages in the Journal // HistoryCache 'CustomSymbol' invalid container header [2] // HistoryBase 'CustomSymbol' invalid container (1970.01.01) found (off: 2683897016, size: 86589, file: 6978951150) } } }[/CODE] The undocumented errors that will pop up in the Journal, causing the entire history to vanish are: HistoryCache 'CustomENQH21' invalid container header [3] HistoryBase 'CustomENQH21' invalid container (1970.01.01) found (off: 883540262, size: 38469, file: 5178546525) To replicate the problem, you need to: [LIST=1] [*] Attach the EA to 5 or more symbols [*] Let it run for several hours before the server date changes. [*]The error will trigger, sooner or later. Always around the same time (server time going from one day to the next). [/LIST] It would be nice if the developers took some time to go over this. [/QUOTE]
Insert quotes…
Verification
Post reply
Top
Bottom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…