Series can be Auto Indexed or indexed manually.

 

An Auto-Indexed series is sized and indexed to the test or instrument.   A manually indexed series must have its size declared in the series creation dialog.  It can then be managed and maintained when more or less series elements are required. All series elements are initialized to the value given in the series creation dialog.  Manually-Indexed series can be cleared and re-sized using script to adjust and clear the series by calling a series function.

 

Accessing a Manually-Index series element value requires the script to determine the index value placed in the "[]" braces.  Value placed in those brackets is the absolute element location reference.  

 

Auto-Indexed series automatically have their size set according to the number of bars contain in the instrument data file or number of test dates in the test.

 

Block Permanent Series (BPV) Auto-Index aligned to test.currentDay.

 

Instrument Permanent Series (IPV) Auto-Index aligned to instrument.bar.

 

This difference is because some markets/instruments don't trade on certain days because of exchange-specific holidays.

 

Example of an IPV Auto-Indexed series:

Day 1:

myIPVSeries = 10                   '   Sets the value of 10 for the series on day 1
                                   

Day 2:

myIPVSeries = 20                   '   Sets the value of 20 for the series on day 2
                                   

Day 3:

Print myIPVSeries               '  Prints the default value as set in the variable editor, likely 0.

Print myIPVSeries[1]             '  Prints 20.

Print myIPVSeries[2]             '  Prints 10.

 

 

Series Indexing Notes:

Dialog example for creating a Manually-Index series.  

 

Manually-Index series are not Auto-Indexed using either the test.currentDay (BPV) or instrument.bar (IPV) properties:

Series Dialog Auto-Index - Manual-Index

When you do not enable the Auto-Index option each element is accessed by a script calculated index value.  

 

Manually-Index series are adjustable in size.  This is different than Auto-Index series. Auto-Index series are sized to test.currentDay (BPV) number of test bars, and (IPV) series are sized to the instrument.bar record count of the instrument.

 

This means you need to set each value using the [] braces.  Retrieve a value will require you to use the same manually set index.

 

You also need to manage the series size yourself since Trading Blox won't know how many elements the system are required in the series.

 

Errors will be generated when the non auto indexed array is used:

Without an index []

When the index is less than 1 or greater than the number of Manually-Index series defined elements.

 

Example of an Manually-Indexed series:

Series is a non auto-indexed array of size 10.

 

Day 1:

customArray[1] = 10     '   Sets the value of 10 into the
                        '   series at index 1

Day 2:

customArray[3] = 20     '   Sets the value of 20 into the
                        '   series at index 3

Day 3:

Print customArray[1]     '   Will print the value 10, since
                        '   that is the value at index 1

 

Links:

GetSeriesSize, SetSeriesColorStyle, SetSeriesSize, SetSeriesValues

See Also:

Series Functions

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 254

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software