A series is an array of values of the same type. Most series used on Tradery com contain floating point data values, but there are also time stamp series.
Series are a core concept of trading system development as they contain data points for various variables as they change over time, such as securities prices, volume, as well as results of applying various transformations to data, such indicators etc.
Series can be manipulated in various ways in order to extract useful information from their data and various technical or statistical indicators can be applied to them to generate derivative series. Series arithmetic can also be applied, using one of the supported operators: +, -, *, /. These operations can be performed between Series objecs,or between Series and numeric values.
Here are a few example on how to create Series variables:
Arithmetic operators can be used to add, subtract, multily and divide two Series, or a Series and a constant
Series s1;
Series s2;
Series s3 = s1 + s2; // this creates a new series s3, with each
element the sum of corresponding elements in s1 and s2
In order to add, subtract etc 2 series, they must be of the same size, or a runtime error will be triggered.
Constants can also be added, subtracted etc to series:
Series can be involved in more complex expressions, and operator precedence rules as well as grouping using parantheses work as expected
In general, different series used within a trading system are aligned to each other and to the data for the default symbol, which means that they contain as many data points as the available data for the default symbol, and each point represents some value corrsponding to the same time stamp as the corrsponding point in the data for the default symbol.
There are trading systems that use data from multiple symbols, and since their data may not contain the same number of points, or the points with the same indexes in the series may not correspond to the same timestamps, they must be synchronized. This will ensure that when running the bar loop, the bar index refers always to data points with the same timestamp, which ensures accurrate and meaningful calculations.
© 2006-2010 Tradery.com
info@tradery.com