Errors, bugs, questions - page 454

 
Interesting:
It seems to me that you would have to translate each element of the array individually.

I'd like some help, not a rant. Let me clarify, I tried to translate using CharArrayToString with CP_UTF16, but it doesn't seem to be supported. Maybe I need another code page?

Question to developers - it is written in help, that those pages which are not in standard constants, can be added manually. Are all of them supported or not?

 
TheXpert:

I'd like some help, not a rant. Let me get this straight, I tried to use CharArrayToString from CP_UTF16, but I have a feeling it is not supported. Maybe I need another code page?

Question to developers -- in help it is written, that those pages which are not in standard constants, can be added manually. Are all of them supported or not?

I misunderstood the question. If I understood the documentation correctly for CP_UTF16 you need to specify the required numeric code (it remains to be seen which one).

Well, this is probably a question for developers.

 
In addition to the question - https://www.mql5.com/ru/forum/1111/page455#comment_80246 - which I would still like an answer to, I will specify the situation. I have a multicurrency indicator, I am testing it on MetaQuotes and Alpari. I use it for Alpari but with MetaQuotes it often returns BarsCalculated for different symbols and in particular error 4806 or just 0 bars counted. Please point me to where I can read more about what the causes of 4806 might be and how to fix them. I'm using metaquotes code for data synchronization - CheckLoadHistory function from https://www.mql5.com/ru/docs/series/timeseries_access page. Errors from BarsCalculated happen after this function has zeroed out (i.e. the data for the calculation should seem to be in place). Can it be trusted at all or is something else required? To be on the safe side, I'd like to clarify that the indicator uses standard bars for calculation, and it is their readiness that is checked by calling BarsCalculated.
 
marketeer:
In addition to the question - https://www.mql5.com/ru/forum/1111/page455#comment_80246 - which I would still like an answer to, I will specify the situation. I have a multicurrency indicator, I am testing it on MetaQuotes and Alpari. I use it for Alpari but with MetaQuotes it often returns BarsCalculated for different symbols and in particular error 4806 or just 0 bars counted. Please point me to where I can read more about what the causes of 4806 might be and how to fix it. I'm using metaquotes code for data synchronization - CheckLoadHistory function from https://www.mql5.com/ru/docs/series/timeseries_access page. Errors from BarsCalculated happen after this function has zeroed out (i.e. the data for the calculation should seem to be in place). Can it be trusted at all or is something else required? To be on the safe side, I'd like to clarify that the indicator uses the standard masks for calculation and it is their readiness that is checked by calling BarsCalculated.

If the response is not from BarsCalculated, the data is synchronized after a fraction of a second interval. Caught at the moment of synchronization, BarsCalculate=0.
 
Swan:
If the refresh is not from Sami, the data syncs after a dickish amount of time. Caught in sync, BarsCalculate=0.

Thanks for the information, although I can say to "themselves" that I am not very happy with such behaviour - it imposes a significant uncertainty in the functionality of the software. For example, already more than an hour ago I hanged an indicator, in which I indicated a couple of new tickers - in the market review they are - if the reference to the above mentioned functions should have initiated the downloading and counting, then everything should have been finished long ago, but it was not. At least it would be desirable to see in the system journal every sneeze of the terminal about the uploading and other "underground" actions, otherwise it's not clear for what reason it "shut down" - the last entry in the "Expert" with the 4806 error, but in the system - says the terminal is out of sync. Considering that there are no ticks at the weekend, I've changed the settings several times, but still no data.

For example, I took RTS-9.11, but refresh function from MetaQuotes, mentioned above, regularly returns Load failed.

 
Another question. In fourth you could write multidimensional array func(int array[][]) as a function argument. In the fifth one the compiler generates an invalid index value error - it requires the dimensionality to be specified. I wrote func(int &array[][3]) - no error, but it is not a solution. How to write functions then? By definition, their sense is to allocate an abstract code fragment applicable to different data, different arrays.
 
marketeer:
Another question. In fourth, you could write a multidimensional array func(int array[][]) as a function argument. In the fifth one the compiler generates an invalid index value error - it requires the dimension to be specified. I wrote func(int &array[][3]) - no error, but it is not a solution. How to write functions then? Their sense is, by definition, to allocate an abstract code fragment applicable to different data, different arrays.

This is what I do:

class cArray2
  {
   double            _Data[];
   int               _ColumnsCount;
   int               _RowsCount;
   ...
   ...
  }

I pass objects of this class as arguments.

In other words, I use a one-dimensional array as a data store of any dimension, while recalculating the "multidimensional" indices into "one-dimensional" ones (and back) myself.

It works with quite an acceptable speed.

You can understand the metaquotes. If you don't introduce the "only one dimension is undefined" constraint, then you can't generate high-speed code to access an array element at the compile-time stage.

 
marketeer:

Thanks for the information, although I can say to "themselves" that I am not very happy with such behaviour - it imposes a significant uncertainty in the functionality of the software. For example, already more than an hour ago I hanged an indicator, in which I indicated a couple of new tickers - in the market review they are - if the reference to the above functions should have initiated the downloading and counting, then everything should have been completed long ago, but it was not. At least it would be desirable to see in the system journal every sneeze of the terminal about the uploading and other "underground" actions, otherwise it's not clear for what reason it "shut down" - the last entry in the "Expert" with the 4806 error, but in the system - says the terminal is out of sync. Considering that there are no ticks at the weekend, I've changed the settings several times, but still no data.

For example, I took RTS-9.11, but MetaQuotes refresh function, mentioned at the link, regularly returns Load failed.

Reference:

Access to indicator and timeseries data is implemented regardless of the fact that the requested data is ready (the so-called asynchronous access ). This is critical for the calculation of custom indicators, so in the absence of the requested data the functions likeCopy...() immediately return an error.

There are no ticks at the weekend, the indicator is started, and an error is returned...

imho, there is only one solution, i.e. to run additional Expert Advisor, that loads the requested history...

I.e. if data is available to the Expert Advisor, it will be available to the indicator. I haven't checked it, the solution looks crooked.


I will repeat my question:

Help:

The Sleep() function cannot be called fromcustom indicators because indicators are executed in the interface thread and must not slow it down.

You absolutely cannot, or if you really want, you can, but carefully? :)


There is a problem with accessing the data of another symbol from the indicator.

if there are no ticks)
i.e. there is no way for the indicator to retrieve data on the weekend, not its TF, not its symbol...
 
Swan:
i.e. there is no way that the indicator can get its data on the weekend, not its TF, not its symbol...
In my opinion, these are all bugs. The ticks are ticks, but nothing prevents (the terminal) to load data and calculate indices in the absence of ticks. More interesting is that the same code works differently on different demo servers. For example, on Alpari both gold and silver are pulled up, and the index is recalculated. So the problem seems to be wider than that.
 
MetaDriver:

Metacvots are understandable. Unless the "only one dimension is undefined" constraint is imposed, then you can't generate high-speed code to access an array element at compile time.

Well, I can't understand it ;-). A long time ago I suggested, that fifth had to be made maximally compatible with fourth (as to syntax and old API functions support, in particular). Of course, new features, such as fast code generation, could be added, but this could be done for new syntax constructs (constraints) - for example, with these parameters-arrays too: who wants optimization of speed - specify the dimensions, and who wants fast code without problems porting old code - leave it as is, and the same thing if it would be slower. There would be a compromise between speed and convenience, or you could offer assembler as mql5. ;-).
Reason: