Forum

How can I fix rates_total/Bars()/iBars() being out of sync with charts?

The iTime() function (and no doubt other i____() functions) return 0 if they get an index that's greater than the TERMINAL_MAXBARS value returned by TerminalInfoInteger(). Rates_total, Bars(), and iBars() have no trouble returning bar counts that exceed TERMINAL_MAXBARS. The standard arrays passed

Any ideas why my custom indicators are blank when I start the terminal in the morning?

Here's what I see when I start the MT5 terminal, also when its running but my internet connection is interrupted. The indicator plot shows briefly (subsecond) and then disappears: All I need to do is switch the timeframe of the chart to anything and then back and the window shows up like it should

CopySeries refuses to work, 3 AIs and I can't see why

I created a script to show the error. When I tried to run it in the original script, it gave me: Error: <4113> [CHART_WINDOW_NOT_FOUND] ... even if I hard-coded the symbol "USDJPY" ( which appears as the first in the list in my Market Watch window in the terminal), and used "_Period" as the

What is the terminal up to between OnInit and OnCalculate?

I've got an indicator that's very similar to other indicators I've written, all of them running super-simple algorithms (90% of the code or more is just about getting the data in) that calculate the slope of another indicator's values between two bars, a simple Y2 - Y1 for a user-selectable period

How do you turn off the automatic populating of variables in the Debug tab of the Metaeditor Toolbox?

This was introduced in a recent update, didn't used to work like this. When I'm debugging, I'm focused on the problem at hand. Filling the screen with variables that are irrelevant to the problem just amounts to noise. I delete all the ones I don't want, but the very next F10 puts them all right

Can't get 2-colored histogram to work, except I already did elsewhere... a little help, please?

I've got two indicators I'm experimenting with, having not plotted a histogram before. The first one works but was just fooling around to make sure I got the color side of things right. The second one is set up just like the first one in the relevant areas, but doesn't work. Code for the one that

Hey MetaQuotes software guys: Please fix this MetaEditor behavior which I consider to be a bug: "View Toolbar" setting keeps getting reset.

NOTE I originally penned this post from memory. It seems, now having double-checked, that I referred to the wrong bar setting. When I did the tests/attempted fixes described below, I'd found the right one, and the actions I took and results I got were as described. I've already spent too much time

Can someone say why the compiler doesn't think these arrays are the right type for CopySeries?

On top of it all, the statements were working fine when I was asking just for close price . As soon as I added time, it started throwing up. 1005 double daNowPrce[]; 1006 datetime dtaNowPrce[]; 1007 ResetLastError (); 1008 1009 double dNowPrce = 0 ; 1010 1011 int

Flummoxed: unless you can find a problem with this code, MQL5 has a serious bug

I have a simple indicator that I use a lot in coding and testing, called BarID. Its intent is: for any bar you point to on a chart, to give you both its AsSeries = true and AsSeries = false index values, along with the best I could do to show its date and time, given all that's available are type

Where can I programmatically get a count of the input parameters of an indicator, custom or otherwise?

It would be awesome, before using IndicatorCreate, to get a total/count of the indicator's input parameters. Where can I get this in MQL5