ArraySetAsSeries - page 2

 
Fleder:
I just added to it a couple of functions.


Oh ok but I dont think that will change anything, the buffers are set to false at every tick in OnCalculate.

I looked at the mql5 version ATR there is none of the reversal of arrays we see in the new mql4 version.

 
SDC:

...

I am confused by this information, how can an array's indexing direction be uncertain ? 

...
It is unknown. 
But, to be sure, is to check ArrayGetAsSeries ().
 
barabashkakvn:
It is unknown. 
But, to be sure is to check ArrayGetAsSeries ().

I know, but if you read my other posts after that one you will see why I feel there is an issue with that.
 
SDC:

I know, but if you read my other posts after that one you will see why I feel there is an issue with that.

There is no issue. What is it so hard to understand ?

Now, you have the same OnCalculate() event handler in MT4 and MT5 (this is also true for indicator buffers). Currently timeseries array are indexed differently :

  • With MT4 they are indexed as series, index 0 is the most recent value.
  • With MT5 they are NOT indexed as series, index 0 is the most old value.

If you want to write a code that works with MT4 AND MT5, you have to set explicitly which indexing you want to use, otherwise your code will be buggy.

Some years ago, when MT5 was create the default indexing was like with MT4, as series. Later it has been changed. That can still be changed. This is what the documentation says. You can't be sure of the indexing, so you have to set it explicitly to avoid surprise in the future.

 
angevoyageur:

There is no issue. What is it so hard to understand ?

Now, you have the same OnCalculate() event handler in MT4 and MT5 (this is also true for indicator buffers). Currently timeseries array are indexed differently :

  • With MT4 they are indexed as series, index 0 is the most recent value.
  • With MT5 they are NOT indexed as series, index 0 is the most old value.

If you want to write a code that works with MT4 AND MT5, you have to set explicitly which indexing you want to use, otherwise your code will be buggy.

Some years ago, when MT5 was create the default indexing was like with MT4, as series. Later it has been changed. That can still be changed. This is what the documentation says. You can't be sure of the indexing, so you have to set it explicitly to avoid surprise in the future.


You just explained what the mql4 documentation does not. That is why it is so hard to understand.

 
SDC:


You just explained what the mql4 documentation does not. That is why it is so hard to understand.

Ah. I thought I only repeat the same. I am glad it helped.
 

angevoyageur:
Ah. I thought I only repeat the same. I am glad it helped.  


Well after all what is a series array ? There is no such thing I have heard of in any context outside of mql4/5 so who is to know what the developers mean when they say the "indexing is not guarenteed" ? They could mean anything by that. They could mean the data can be reversed while not being flagged as series any more. Who is to know when they do not explain what they mean?

This should be explained clearly in the docs especially when it is an critical issue of mql4/mql5 compatability.

Reason: