{"id":494,"date":"2017-02-22T02:45:02","date_gmt":"2017-02-22T02:45:02","guid":{"rendered":"http:\/\/www.patternsmart.com\/cn\/?p=494"},"modified":"2017-02-22T02:45:02","modified_gmt":"2017-02-22T02:45:02","slug":"two-different-secondary-aggregation-periods-cannot-be-used-within-a-single-variable-in-thinkscript","status":"publish","type":"post","link":"https:\/\/www.patternsmart.com\/cn\/two-different-secondary-aggregation-periods-cannot-be-used-within-a-single-variable-in-thinkscript\/","title":{"rendered":"two different secondary aggregation periods cannot be used within a single variable in thinkscript"},"content":{"rendered":"<p>Another restriction is that two different secondary aggregation periods cannot be used within a single variable:<\/p>\n<div class=\"codeblock\">\n<div class=\"title\">Code:<\/div>\n<div class=\"body\" dir=\"ltr\"><code>plot Data = close(period = AggregationPeriod.MONTH) + close(period = AggregationPeriod.WEEK);<\/code><\/div>\n<\/div>\n<p>This script will not work on daily charts. In order to make it work, you need to break into two variables:<\/p>\n<div class=\"codeblock\">\n<div class=\"title\">Code:<\/div>\n<div class=\"body\" dir=\"ltr\"><code>def a = close(period = AggregationPeriod.MONTH);<br \/>\ndef b = close(period = AggregationPeriod.WEEK);<br \/>\nplot Data = a + b;<\/code><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Another restriction is that two different secondary agg [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[71],"tags":[177],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-thinkorswim","tag-thinkscript"],"_links":{"self":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":1,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/494\/revisions\/495"}],"wp:attachment":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}