ArraySetAsSeries meaning

 

Hi,

What does ArraySetAsSeries?

I read the documentation but i have not grasped full its potential.

Sometimes buffers in indicators work only when transforming them e.g ArraySetAsSeries(myBuffer,false)


What does it do?

ArraySetAsSeries - Array Functions - MQL4 Reference
ArraySetAsSeries - Array Functions - MQL4 Reference
  • docs.mql4.com
The AS_SERIES flag can't be set for multi-dimensional arrays or static arrays (arrays, whose size in square brackets is preset already on the compilation stage). Indexing in timeseries differs from a common array in that the elements of timeseries are indexed from the end towards the beginning (from the newest to oldest data...
 
billysballo:

Hi,

What does ArraySetAsSeries?

I read the documentation but i have not grasped full its potential.

Sometimes buffers in indicators work only when transforming them e.g ArraySetAsSeries(myBuffer,false)


What does it do?

Say you have an indicator with 4051 values (or bars) showing.

When you reference the rightmost bar: is it bar 0, or is it bar 4051?

ArraySetAsSeries() lets you choose.

 
Anthony Garot:

Say you have an indicator with 4051 values (or bars) showing.

When you reference the rightmost bar: is it bar 0, or is it bar 4051?

ArraySetAsSeries() lets you choose.

hi @Anthony,

so, when you set it to false, the most recent one (the rightmost bar) is 0. correct?

 
billysballo:

hi @Anthony,

so, when you set it to false, the most recent one (the rightmost bar) is 0. correct?

Best way to know is to look at the indexes and see for yourself.

Check out this thread starting here:

https://www.mql5.com/en/forum/150431#comment_8193376

The code should compile on MT4 as well. Just change the extension.

 
Anthony Garot:

Best way to know is to look at the indexes and see for yourself.

Check out this thread starting here:

https://www.mql5.com/en/forum/150431#comment_8193376

The code should compile on MT4 as well. Just change the extension.Are you talking about the code above?

thanks Anthony.

 i downloaded the code but it returns something like this:

Is it normal?

 
billysballo:

thanks Anthony.

 i downloaded the code but it returns something like this:

Is it normal?

Zoom in . . . hover over one of the green bars.

The answer to your previous question:

0 is on the right when true.

Bars() is on the right when false.

 
Anthony Garot:

Zoom in . . . hover over one of the green bars.

The answer to your previous question:

0 is on the right when true.

Bars() is on the right when false.

Thank you :)

 
JimSingadventure # :

Hello gurus,

i'm trying to capture the previous 3rd bar value of the Bollinger Band middle line for Nasdaq100 (price range in the +1600s now) .

I"m flabergasted at why this value jumps wildly from around 16392.59 to arond 96.099 and back at every tick.

My code is shown below and appreciate if anyone can point out where i went wrong and why!

Thank you in advance!


Mistake # 1: the MQL5 style implies that the indicator handle is created ONCE and must be done in OnInit. I saw this gross error and I did not look further at the code.

Correct this gross mistake.


An example of get values from the iBands indicator

How to start with MQL5
How to start with MQL5
  • 2020.07.05
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...