{"id":129,"date":"2025-06-17T07:14:36","date_gmt":"2025-06-17T07:14:36","guid":{"rendered":"https:\/\/blog.alltick.co\/ja-jp\/?p=129"},"modified":"2025-06-17T07:14:38","modified_gmt":"2025-06-17T07:14:38","slug":"andreas-clenows-trend-following-strategy","status":"publish","type":"post","link":"https:\/\/blog.alltick.co\/ja-jp\/andreas-clenows-trend-following-strategy\/","title":{"rendered":"\u30a2\u30f3\u30c9\u30ec\u30a2\u30b9\u30fb\u30af\u30ec\u30ce\u30a6\u306e\u30c8\u30ec\u30f3\u30c9\u30d5\u30a9\u30ed\u30fc\u6226\u7565"},"content":{"rendered":"\n<p>\u30af\u30ec\u30ce\u30a6\u306e\u6226\u7565\u306e\u4e2d\u3067\u3001\u30c8\u30ec\u30f3\u30c9\u30d5\u30a9\u30ed\u30fc\u30a2\u30d7\u30ed\u30fc\u30c1\u306f\u304a\u305d\u3089\u304f\u6700\u3082\u6709\u540d\u3067\u3059\u3002\u3053\u306e\u6226\u7565\u306f\u3001\u30c6\u30af\u30cb\u30ab\u30eb\u6307\u6a19\u3084\u30c8\u30ec\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u5e02\u5834\u306e\u65b9\u5411\u6027\u3092\u7279\u5b9a\u3057\u3001\u9577\u671f\u7684\u306a\u5e02\u5834\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u6349\u3048\u308b\u3053\u3068\u306b\u7126\u70b9\u3092\u5f53\u3066\u3066\u3044\u307e\u3059\u3002\u76ee\u6a19\u306f\u3001\u30c8\u30ec\u30f3\u30c9\u306e\u59cb\u307e\u308a\u3067\u5e02\u5834\u306b\u30a8\u30f3\u30c8\u30ea\u30fc\u3057\u3001\u305d\u306e\u30c8\u30ec\u30f3\u30c9\u304c\u7d42\u308f\u308b\u307e\u3067\u305d\u308c\u306b\u4e57\u308a\u3001\u6301\u7d9a\u7684\u306a\u4fa1\u683c\u306e\u52d5\u304d\u304b\u3089\u5229\u76ca\u3092\u5f97\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u6226\u7565\u306e\u6838\u5fc3\u306b\u306f\u3001\u5e02\u5834\u306f\u9577\u671f\u7684\u306a\u30c8\u30ec\u30f3\u30c9\u3067\u52d5\u304f\u50be\u5411\u304c\u3042\u308a\u3001\u305d\u308c\u3092\u7279\u5b9a\u3057\u3066\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u4fe1\u5ff5\u304c\u3042\u308a\u307e\u3059\u3002\u6226\u7565\u306f\u3001\u5f37\u6c17\u304a\u3088\u3073\u5f31\u6c17\u306e\u30c8\u30ec\u30f3\u30c9\u4e21\u65b9\u3092\u6d3b\u7528\u3057\u3001\u6a2a\u3070\u3044\u307e\u305f\u306f\u4e71\u9ad8\u4e0b\u3059\u308b\u5e02\u5834\u306e\u72b6\u614b\u3067\u306e\u30ea\u30b9\u30af\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u3053\u3068\u3092\u76ee\u6307\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6226\u7565\u306e\u4ed5\u7d44\u307f<\/strong><\/h2>\n\n\n\n<p>\u30c8\u30ec\u30f3\u30c9\u30d5\u30a9\u30ed\u30fc\u6226\u7565\u3067\u306f\u3001\u30c6\u30af\u30cb\u30ab\u30eb\u6307\u6a19\u3084\u30c8\u30ec\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30ec\u30f3\u30c9\u3092\u691c\u51fa\u3057\u3001\u8ffd\u8de1\u3059\u308b\u3053\u3068\u304c\u4e00\u822c\u7684\u3067\u3059\u3002\u4e3b\u8981\u306a\u30c4\u30fc\u30eb\u306b\u306f\u4ee5\u4e0b\u304c\u542b\u307e\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u79fb\u52d5\u5e73\u5747<\/strong>\uff08\u4f8b\uff1a50\u65e5\u79fb\u52d5\u5e73\u5747\u3001200\u65e5\u79fb\u52d5\u5e73\u5747\uff09<\/li>\n\n\n\n<li><strong>\u76f8\u5bfe\u529b\u6307\u6570\uff08RSI\uff09<\/strong><\/li>\n\n\n\n<li><strong>\u5e73\u5747\u771f\u306e\u7bc4\u56f2\uff08ATR\uff09<\/strong>\uff08\u30dc\u30e9\u30c6\u30a3\u30ea\u30c6\u30a3\u306e\u6e2c\u5b9a\uff09<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6307\u6a19\u306f\u3001\u30c8\u30ec\u30f3\u30c9\u306e\u65b9\u5411\u3068\u5f37\u3055\u3092\u5224\u65ad\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u30b9\u30a4\u30f3\u30b0\u30cf\u30a4\u3068\u30b9\u30a4\u30f3\u30b0\u30ed\u30fc\u3092\u7d50\u3093\u3067\u63cf\u304b\u308c\u308b\u30c8\u30ec\u30f3\u30c9\u30e9\u30a4\u30f3\u3082\u3001\u30c8\u30ec\u30f3\u30c9\u306e\u7d99\u7d9a\u3092\u8996\u899a\u5316\u3059\u308b\u305f\u3081\u3084\u3001\u6f5c\u5728\u7684\u306a\u30c8\u30ec\u30f3\u30c9\u53cd\u8ee2\u3092\u793a\u3059\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6226\u7565\u306e\u5229\u70b9<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9577\u671f\u7684\u306a\u5b89\u5b9a\u6027<\/strong>\uff1a\u3053\u306e\u6226\u7565\u306f\u9577\u671f\u7684\u306a\u5229\u76ca\u3092\u76ee\u7684\u3068\u3057\u3066\u304a\u308a\u3001\u3055\u307e\u3056\u307e\u306a\u5e02\u5834\u74b0\u5883\u3067\u826f\u3044\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u767a\u63ee\u3059\u308b\u50be\u5411\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5e02\u5834\u306b\u4f9d\u5b58\u3057\u306a\u3044<\/strong>\uff1a\u4e88\u6e2c\u3084\u7279\u5b9a\u306e\u5e02\u5834\u6761\u4ef6\u306b\u4f9d\u5b58\u305b\u305a\u3001\u4fa1\u683c\u306e\u52d5\u304d\u81ea\u4f53\u306b\u57fa\u3065\u3044\u3066\u610f\u601d\u6c7a\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u9069\u5fdc\u6027<\/strong>\uff1a\u7570\u306a\u308b\u8cc7\u7523\u30af\u30e9\u30b9\uff08\u682a\u5f0f\u3001\u5148\u7269\u3001\u5916\u56fd\u70ba\u66ff\uff09\u304a\u3088\u3073\u6642\u9593\u67a0\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u30ea\u30b9\u30af\u3068\u8003\u616e\u4e8b\u9805<\/strong><\/h2>\n\n\n\n<p>\u305d\u306e\u5f37\u307f\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001\u30c8\u30ec\u30f3\u30c9\u30d5\u30a9\u30ed\u30fc\u6226\u7565\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u8ab2\u984c\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6a2a\u3070\u3044\u5e02\u5834<\/strong>\uff1a\u6a2a\u3070\u3044\u5e02\u5834\u3067\u306f\u3001\u6226\u7565\u304c\u8aa4\u3063\u305f\u30b7\u30b0\u30ca\u30eb\u3092\u751f\u6210\u3057\u3001\u983b\u7e41\u306a\u53d6\u5f15\u3084\u30b3\u30b9\u30c8\u5897\u52a0\u3092\u5f15\u304d\u8d77\u3053\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30c8\u30ec\u30f3\u30c9\u53cd\u8ee2<\/strong>\uff1a\u30c8\u30ec\u30f3\u30c9\u306f\u6c38\u9060\u306b\u7d9a\u304f\u308f\u3051\u3067\u306f\u306a\u304f\u3001\u6025\u6fc0\u306a\u53cd\u8ee2\u304c\u767a\u751f\u3059\u308b\u3068\u9069\u5207\u306b\u7ba1\u7406\u3057\u306a\u3044\u3068\u640d\u5931\u306b\u3064\u306a\u304c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u305d\u306e\u305f\u3081\u3001\u30ea\u30b9\u30af\u7ba1\u7406\u3068\u30dd\u30b8\u30b7\u30e7\u30f3\u30b5\u30a4\u30ba\u306e\u8abf\u6574\u306f\u3001\u6210\u529f\u3059\u308b\u30c8\u30ec\u30f3\u30c9\u30d5\u30a9\u30ed\u30fc\u6226\u7565\u306e\u91cd\u8981\u306a\u8981\u7d20\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Java\u30b3\u30fc\u30c9\u4f8b<\/strong><\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import java.util.ArrayList;\nimport java.util.List;\n\npublic class TrendFollowingStrategy {\n\n    public static void main(String[] args) {\n        List&lt;Double> prices = new ArrayList&lt;>();\n        prices.add(100.0);\n        prices.add(105.0);\n        prices.add(110.0);\n        prices.add(95.0);\n        prices.add(120.0);\n        prices.add(130.0);\n\n        List&lt;Double> movingAverages = calculateMovingAverages(prices, 5);\n\n        for (int i = 1; i &lt; prices.size(); i++) {\n            double currentPrice = prices.get(i);\n            double previousPrice = prices.get(i - 1);\n            double movingAverage = movingAverages.get(i - 1);\n\n            if (currentPrice > movingAverage &amp;&amp; previousPrice &lt;= movingAverage) {\n                System.out.println(\"Buy @ \uffe5\" + currentPrice);\n            } else if (currentPrice &lt; movingAverage &amp;&amp; previousPrice >= movingAverage) {\n                System.out.println(\"Sell @ \uffe5\" + currentPrice);\n            }\n        }\n    }\n\n    private static List&lt;Double> calculateMovingAverages(List&lt;Double> prices, int period) {\n        List&lt;Double> movingAverages = new ArrayList&lt;>();\n        for (int i = period - 1; i &lt; prices.size(); i++) {\n            double sum = 0.0;\n            for (int j = i - period + 1; j &lt;= i; j++) {\n                sum += prices.get(j);\n            }\n            double movingAverage = sum \/ period;\n            movingAverages.add(movingAverage);\n        }\n        return movingAverages;\n    }\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Python\u30b3\u30fc\u30c9\u4f8b<\/strong><\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def calculate_moving_averages(prices, period):\n    moving_averages = []\n    for i in range(period - 1, len(prices)):\n        sum_prices = sum(prices[i - period + 1: i + 1])\n        moving_average = sum_prices \/ period\n        moving_averages.append(moving_average)\n    return moving_averages\n\ndef trend_following_strategy(prices, moving_averages):\n    for i in range(1, len(prices)):\n        current_price = prices[i]\n        previous_price = prices[i - 1]\n        moving_average = moving_averages[i - 1]\n\n        if current_price > moving_average and previous_price &lt;= moving_average:\n            print(\"Buy @ \uffe5\", current_price)\n        elif current_price &lt; moving_average and previous_price >= moving_average:\n            print(\"Sell @ \uffe5\", current_price)\n\nprices = [100.0, 105.0, 110.0, 95.0, 120.0, 130.0]\n\nmoving_averages = calculate_moving_averages(prices, 5)\n\ntrend_following_strategy(prices, moving_averages)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30af\u30ec\u30ce\u30a6\u306e\u6226\u7565\u306e\u4e2d\u3067\u3001\u30c8\u30ec\u30f3\u30c9\u30d5\u30a9\u30ed\u30fc\u30a2\u30d7\u30ed\u30fc\u30c1\u306f\u304a\u305d\u3089\u304f\u6700\u3082\u6709\u540d\u3067\u3059\u3002\u3053\u306e\u6226\u7565\u306f\u3001\u30c6\u30af\u30cb\u30ab\u30eb\u6307\u6a19\u3084\u30c8\u30ec\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u5e02\u5834\u306e\u65b9\u5411\u6027\u3092\u7279\u5b9a\u3057\u3001\u9577\u671f\u7684\u306a\u5e02\u5834\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u6349\u3048\u308b\u3053\u3068\u306b\u7126\u70b9\u3092\u5f53\u3066\u3066\u3044\u307e\u3059\u3002\u76ee\u6a19\u306f\u3001\u30c8\u30ec\u30f3\u30c9\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":130,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide"],"featured_image_src":"https:\/\/i0.wp.com\/blog.alltick.co\/ja-jp\/wp-content\/uploads\/sites\/2\/2025\/06\/0_nRNAiWbEkwT__obO.jpg?fit=1400%2C933&ssl=1","author_info":{"display_name":"admin","author_link":"https:\/\/blog.alltick.co\/ja-jp\/author\/admin\/"},"_links":{"self":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":1,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts\/129\/revisions\/131"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/media\/130"}],"wp:attachment":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}