New Post has been published on http://patternsmart.com/wp/three-types-of-aggregation-in-tos-charts-thinkscript/
three types of aggregation in TOS Charts thinkScript
So far, we have learned many things about the bars on charts and values which can be calculated for them. But we never discussed the way they are formed (or, aggregated). In TOS Charts, three types of aggregation are available: time aggregation, tick aggregation, and range aggregation. Time charts represent price action in terms of time: a new bar (or candlestick, line section, etc.) is plotted after completion of a certain time period (called aggregation period). For example, the 1y D bar chart plots the price action for one year, marking Open, High, Low, and Close prices on the daily basis. Tick charts represent intraday price action in terms of quantity of trades: a new bar (or candlestick, line section, etc.) is plotted after completion of a certain number of trades (ticks). This aggregation type can be used on intraday charts with time interval not greater than five days. For example, the 2d 133t bar chart plots the price action for two days, defining Open, High, Low, and Close prices every time the number of trades becomes equal to 133. Range charts represent price action in terms of price accumulation. Three modes of range aggregation are available in TOS Charts: Range Bars, Momentum Bars, and Renko Bars. However, these are not the subject of this chapter as we are going to discuss time aggregation in thinkScript® (information on range charts is available here). All scripts we created before were the ones using aggregation period defined in chart settings. In order to access data of a different aggregation period in your code, specify the period parameter using the corresponding Aggregation Period constant. You can also use a pre-defined string value for this purpose:
1 min, 2 min, 3 min, 4 min, 5 min, 10 min, 15 min, 20 min, 30 min, 1 hour, 2 hours, 4 hours, Day, 2 Days, 3 Days, 4 Days, Week, Month, Opt Exp,
. Here is an example script:
plot dailyOpen = open(period = AggregationPeriod.DAY);
This script plots daily Open price for the current symbol. - aggregation, Thinkorswim TOS, thinkScript, timeframe, TOS