{"id":38879,"date":"2026-06-22T20:37:17","date_gmt":"2026-06-23T01:37:17","guid":{"rendered":"https:\/\/library-staging.tradingtechnologies.com\/doc\/moving-average-block-2\/"},"modified":"2026-06-22T20:37:18","modified_gmt":"2026-06-23T01:37:18","slug":"moving-average-block-2","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/ja\/moving-average-block-2\/","title":{"rendered":"Moving Average \u30d6\u30ed\u30c3\u30af"},"content":{"rendered":"<p><!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p>     <!-- in source YML header, should also match the filename\/url --><\/p>\n<div>\n<h2 hidden>Moving Average \u30d6\u30ed\u30c3\u30af<\/h2>\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2026\/06\/db-moving-average-block-1.png\"><\/p>\n<p>[Moving Average] \u30d6\u30ed\u30c3\u30af\u306f\u3001\u5185\u90e8\u6570\u5f0f\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u6570\u5024 (\u76f4\u8fd1\u5024\u3001LTP \u306a\u3069) \u306e\u5185\u90e8\u96c6\u5408\u3092\u7dad\u6301\u3057\u3066\u3001\u6700\u3082\u6700\u8fd1\u306e\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u6570\u5024\u306e\u5e73\u5747\u3092\u51fa\u529b\u3057\u307e\u3059 (<strong>#bars<\/strong>)\u3002\u30d6\u30ed\u30c3\u30af\u304c [<strong>intervals<\/strong>] \u30dd\u30fc\u30c8\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\u305f\u3073\u306b\u3001\u4ee5\u4e0b\u306e\u64cd\u4f5c\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u304c\u6307\u5b9a\u3057\u305f\u5024\u306e\u5185\u90e8\u96c6\u5408\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/li>\n<li>\u5024\u306e <strong>#bars<\/strong> \u306e\u6700\u65b0\u5024\u306e\u5e73\u5747\u3092\u8a08\u7b97\u3057\u3001[<strong>avg<\/strong>] \u51fa\u529b\u30dd\u30fc\u30c8\u3092\u901a\u3058\u3066\u5e73\u5747\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002<\/li>\n<li>[<strong>msg<\/strong>] \u51fa\u529b\u30dd\u30fc\u30c8\u3092\u901a\u3058\u3066\u3001\u5143\u306e [<strong>intervals<\/strong>] \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5909\u3048\u305a\u306b\u6e21\u3057\u307e\u3059\u3002<\/li>\n<li>\u6700\u521d\u306e <strong>#bars<\/strong> \u30e1\u30c3\u30bb\u30fc\u30b8\u6570\u306e\u5f8c\u3001\u6e96\u5099\u30dd\u30fc\u30c8\u3092\u901a\u3058\u3066 [TRUE] \u3092\u9001\u4fe1\u3057\u3001[<strong>avg<\/strong>] \u51fa\u529b\u306b\u5e0c\u671b\u306e\u30c7\u30fc\u30bf \u30dd\u30a4\u30f3\u30c8\u6570\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<p hidden><span class=\"label label-success\">\u4f8b<\/span> <b>Moving Average \u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u3063\u3066\u30011\u5206\u9593\u30685\u5206\u9593\u306e\u79fb\u52d5\u5e73\u5747\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002<\/b><\/p>\n<p><!-- Example\n\n  \n\n<p><span class=\"label label-success\">Example<\/span> <b>The two Moving Average blocks receive an empty discrete message from the <a href=\"db-generator-block.html\">Generator<\/a> block every second. Each time they receive an input message through their <strong>intervals<\/strong> ports, the blocks update their values based on their internal formulas. The <a href=\"bb-number.html\">Number<\/a> blocks connected to their <strong>#bars<\/strong> port determine the number of intervals to use when calculating the moving average; so the top Moving Average block calculates its moving average based on 60 one-second intervals (1-minute moving average), while the bottom block calculates its moving average based on 300 one-second intervals (5-minute moving average). When each block receives the input message, it sends its current value through the <strong>avg<\/strong> output port to downstream logic. Each block also uses its Boolean <strong>ready<\/strong> output port to indicate when the block has received the number of inputs as specified by its <strong>#tbars<\/strong> input port.<\/b><\/p>\n\n\n  \n\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"Content\/db-moving-average-block-example.png\" alt=\"\"><\/p>\n\n\n  --> <!-- Example\n  --><\/p>\n<p><span class=\"label label-success\">\u4f8b<\/span> <b>[Moving Average] \u30d6\u30ed\u30c3\u30af\u306f\u3001\u6bce\u79d2 [<a href=\"db-generator-block.html\">Generator<\/a>] \u30d6\u30ed\u30c3\u30af\u304b\u3089\u7a7a\u306e\u96e2\u6563\u30a4\u30d9\u30f3\u30c8 \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u4fe1\u3057\u307e\u3059\u3002[<strong>#bars<\/strong>] \u5165\u529b\u30dd\u30fc\u30c8\u306b\u6e21\u3055\u308c\u305f\u6570\u306f\u3001\u79fb\u52d5\u5e73\u5747\u306e\u8a08\u7b97\u306f\u30011\u5206\u9593\u306b\u6e21\u3063\u3066\u53ce\u96c6\u3055\u308c\u308b 60 \u306e\u5024\u306b\u57fa\u3065\u3044\u3066\u884c\u308f\u308c\u308b\u3079\u304d\u3067\u3042\u308b\u3053\u3068\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002[<strong>intervals<\/strong>] \u30dd\u30fc\u30c8\u3092\u901a\u3058\u3066\u5165\u529b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u4fe1\u3059\u308b\u969b\u306f\u5e38\u306b\u3001\u30d6\u30ed\u30c3\u30af\u306f\u96c6\u5408\u306b\u65b0\u898f\u5024\u3092\u8ffd\u52a0\u3057\u3001\u6700\u65b0\u306e 60 \u306e\u5024\u306b\u57fa\u3065\u3044\u3066\u3001\u79fb\u52d5\u5e73\u5747\u306e\u518d\u8a08\u7b97\u3092\u884c\u3044\u3001[<strong>avg<\/strong>] \u30dd\u30fc\u30c8\u3092\u901a\u3058\u3066\u5e73\u5747\u3092\u51fa\u529b\u3057\u3001\u3053\u308c\u306f\u30c0\u30a6\u30f3\u30b9\u30c8\u30ea\u30fc\u30e0 \u30ed\u30b8\u30c3\u30af\u306b\u3088\u308a\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002[Moving Average] \u30d6\u30ed\u30c3\u30af\u304c 60 \u500b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u4fe1\u3059\u308b\u3068\u3001\u6e96\u5099\u30dd\u30fc\u30c8\u304c [<strong>TRUE<\/strong>] \u306b\u5909\u308f\u308a\u3001\u30c0\u30a6\u30f3\u30b9\u30c8\u30ea\u30fc\u30e0 \u30ed\u30b8\u30c3\u30af\u3092\u4f7f\u3063\u3066\u3001[<strong>avg<\/strong>] \u51fa\u529b\u306b\u5341\u5206\u306a\u30c7\u30fc\u30bf \u30dd\u30a4\u30f3\u30c8\u304c\u542b\u307e\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u6c7a\u5b9a\u3067\u304d\u307e\u3059\u3002<\/b><\/p>\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2026\/06\/db-moving-average-block-example-1-1.png\" alt=\"\"><\/p>\n<p>\u76f4\u8fd1\u5024 (LTP) \u306e\u79fb\u52d5\u5e73\u5747\u306e\u6570\u5f0f<\/p>\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2026\/06\/db-moving-average-block-formula-1.png\" alt=\"\"><\/p>\n<p>\u4ee5\u4e0b\u306e\u30dd\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u3001\u30a2\u30eb\u30b4\u304c\u79fb\u52d5\u5024\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\n<p>ready: \u3053\u306e\u30dd\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u3001\u30d6\u30ed\u30c3\u30af\u304c [<strong>#bars<\/strong>] \u5165\u529b\u3092\u6e80\u305f\u3059\u306e\u306b\u5341\u5206\u306a\u6570\u306e\u30d0\u30fc\u3092\u53ce\u96c6\u3057\u305f\u304b\u3069\u3046\u304b\u3092\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002\u30d6\u30ed\u30c3\u30af\u306b\u5341\u5206\u306a\u30d0\u30fc\u6570\u304c\u306a\u3044\u5834\u5408\u306f\u3001[<strong>ready<\/strong>] \u30dd\u30fc\u30c8\u306f [False] \u3092\u51fa\u529b\u3057\u307e\u3059\u3002\u30d6\u30ed\u30c3\u30af\u304c\u5341\u5206\u306a\u30d0\u30fc\u6570\u3092\u84c4\u7a4d\u3059\u308b\u3068\u3001[<strong>ready<\/strong>] \u30dd\u30fc\u30c8\u306f [TRUE] \u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p>reset: \u3053\u306e\u30dd\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u3001\u96e2\u6563\u30a4\u30d9\u30f3\u30c8 \u30e1\u30c3\u30bb\u30fc\u30b8\u304c [<strong>reset<\/strong>] \u30dd\u30fc\u30c8\u3092\u30c8\u30ea\u30ac\u30fc\u3059\u308b\u3068\u3001[Moving Average] \u30d6\u30ed\u30c3\u30af\u304c\u5185\u90e8\u30c7\u30fc\u30bf\u96c6\u5408\u3092\u524a\u9664\u3057\u3001[<strong>avg<\/strong>] \u3092 [NaN] (Not A Number) \u306b\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u3088\u3046\u306b\u5f37\u5236\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/li>\n<\/ul>\n<p><!--\n  Block Properties section\n  --><\/p>\n<div>\n<h2 id=\"block-properties\">Block \u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<p>\u30d6\u30ed\u30c3\u30af\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u306b\u306f\u3001[<strong>Block Properties<\/strong>] \u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<p><!--\n    \n\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"Content\/discrete-block-moving-average-settings.png\"><\/p>\n\n\n    --><\/p>\n<table class=\"table table-striped table-bordered\" border=\"1\">\n<thead>\n<tr>\n<th>\u30d7\u30ed\u30d1\u30c6\u30a3<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Name (\u540d\u524d)<\/td>\n<td>ADL \u30ad\u30e3\u30f3\u30d0\u30b9\u306e\u30d6\u30ed\u30c3\u30af\u306e\u4e0b\u306b\u8868\u793a\u3055\u308c\u308b\u540d\u524d\u3002<\/td>\n<\/tr>\n<p><!--\n        \n\n<tr>\n          \n\n<td>BodyColor<\/td>\n\n\n          \n\n<td>Background color of the block<\/td>\n\n\n        <\/tr>\n\n\n    --><\/p>\n<tr>\n<td>Formula (\u6570\u5f0f)<\/td>\n<td>\n<p>\u30d6\u30ed\u30c3\u30af\u306e\u5024\u306e\u8a08\u7b97\u306b\u4f7f\u7528\u3055\u308c\u308b\u6570\u5f0f\u3002<\/p>\n<p><strong>\u7de8\u96c6<\/strong>\u30ea\u30f3\u30af\u306b\u3088\u308a [<a href=\"ac-formula-editior.html\">Formula Editor<\/a>] \u304c\u8d77\u52d5\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/td>\n<\/tr>\n<p><!--\n        \n\n<tr>\n          \n\n<td>Description<\/td>\n\n\n          \n\n<td>Optional text to explain how the block is used<\/td>\n\n\n        <\/tr>\n\n\n    --><\/tbody>\n<\/table><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Moving Average \u30d6\u30ed\u30c3\u30af [Moving Average] \u30d6\u30ed\u30c3\u30af\u306f\u3001\u5185\u90e8\u6570\u5f0f\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u6570\u5024 (\u76f4\u8fd1\u5024\u3001LTP \u306a\u3069) \u306e\u5185\u90e8\u96c6\u5408\u3092\u7dad\u6301\u3057\u3066\u3001\u6700\u3082\u6700\u8fd1\u306e\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u6570\u5024\u306e\u5e73\u5747\u3092\u51fa\u529b\u3057\u307e\u3059 ( [&hellip;]<\/p>\n","protected":false},"author":2,"template":"","meta":{"_acf_changed":false,"footnotes":""},"docs-category":[208],"class_list":["post-38879","doc","type-doc","status-publish","hentry","docs-category-discrete-blocks"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/38879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/38879\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=38879"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=38879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}