{"id":2855,"date":"2008-12-02T12:22:33","date_gmt":"2008-12-02T03:22:33","guid":{"rendered":"http:\/\/www.ibi-square.jp\/blog\/?p=73"},"modified":"2023-05-13T16:19:58","modified_gmt":"2023-05-13T07:19:58","slug":"tech-calc-macd","status":"publish","type":"post","link":"https:\/\/atmtech.net\/main\/tech-calc-macd\/","title":{"rendered":"MACD\uff08\u8a08\u7b97\u5f0f\u3001\u30c1\u30e3\u30fc\u30c8\u3001\u30a8\u30af\u30bb\u30ebVBA\u30b3\u30fc\u30c9\uff09\u30c6\u30af\u30cb\u30ab\u30eb\u6307\u6a19"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h1>MACD\u306b\u3064\u3044\u3066\u3002\u8a08\u7b97\u5f0f\u3001\u30c1\u30e3\u30fc\u30c8\u3001\u30a8\u30af\u30bb\u30ebVBA\u30b3\u30fc\u30c9<\/h1>\n<p>&nbsp;<\/p>\n<p>MACD\u306f2\u672c\u306e\u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u5747\u7dda\u306e\u5dee\u304b\u3089\u6c42\u3081\u3089\u308c\u3001\u30c8\u30ec\u30f3\u30c9\u3084\u4e56\u96e2\u306a\u3069\u3092\u5224\u65ad\u3059\u308b\u969b\u306b\u4f7f\u7528\u3055\u308c\u308b\u6307\u6a19\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u5747\u7dda\u306f\u3001\u5168\u671f\u9593\u306e\u30c7\u30fc\u30bf\u3092\u8003\u616e\u3057\u305f\u79fb\u52d5\u5e73\u5747\u7dda\u3067\u3059\u304c\u3001\u8a73\u7d30\u306f<a href=\"https:\/\/atmtech.net\/main\/?p=2890\" target=\"_self\" rel=\"noopener\">\u79fb\u52d5\u5e73\u5747\u7dda\u306e\u8a08\u7b97\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/a>\u306e\u6295\u7a3f\u3092\u3054\u89a7\u4e0b\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8a08\u7b97\u5f0f\u3084\u8a08\u7b97\u65b9\u6cd5\u3001\u30c1\u30e3\u30fc\u30c8\u3001\u30a8\u30af\u30bb\u30ebVBA\u30b3\u30fc\u30c9\u3092\u63b2\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>MACD\u306e\u8a08\u7b97\u5f0f<\/h2>\n<p>MACD\u306f\u4e0a\u8ff0\u306e\u901a\u308a2\u672c\u306e\u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u5747\uff08EMA\uff09\u306e\u5dee\u304b\u3089\u6c42\u3081\u3089\u308c\u307e\u3059\u306e\u3067\u3001\u4e0b\u8a18\u304c\u8a08\u7b97\u5f0f\u3068\u306a\u308a\u307e\u3059\u3002(x,y,z\u306f\u305d\u308c\u305e\u308c\u63a1\u7528\u672c\u6570)<\/p>\n<p>&nbsp;<\/p>\n<p>MACD = EMA(x) &#8211; EMA(y)<\/p>\n<p>&nbsp;<\/p>\n<p>***EMA\u306e\u8a08\u7b97***(N\u306f\u63a1\u7528\u672c\u6570)<\/p>\n<p>1\u672c\u76ee\uff08\u671f\u9593\u306e\u6700\u521d\u306e\u8a08\u7b97\uff09\uff1d\uff08\u5f53\u65e5\u3082\u542b\u3081\uff09N\u672c\u306e\u7d42\u5024\u306e\u5e73\u5747<\/p>\n<p>2\u672c\u76ee\u4ee5\u964d\uff1d\u524d\u65e5\u306eEMA\uff0bY\u00d7{\u5f53\u65e5\u7d42\u5024-\u524d\u65e5\u306eEMA}<\/p>\n<p>\u203bY\uff1d2\u00f7\uff08N+1\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f8b\u3048\u3070\u30013\u672c\u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u5747\u7dda\u306e\u5834\u5408\u30011\u672c\u76ee\u306f3\u672c\u306e\u5358\u7d14\u79fb\u52d5\u5e73\u5747\u7dda\u3002<\/p>\n<p>2\u672c\u76ee\u4ee5\u964d\u306f\u3001Y=2\u00f7\uff083+1)=0.5\u3000\u3067\u3001\u76f4\u524dEMA\uff0b0.5\u00d7\uff08\u5f53\u65e5\u7d42\u5024-\u76f4\u524dEMA\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>**********************************<\/p>\n<p>MACD(\u30b7\u30b0\u30ca\u30eb) = MACD\u306eZ\u672c\u5358\u7d14\u79fb\u52d5\u5e73\u5747<\/p>\n<p>MACD(OSCI) = MACD \u2010 MACD(\u30b7\u30b0\u30ca\u30eb)<\/p>\n<p>MACD\u3068MACD(\u30b7\u30b0\u30ca\u30eb)\u306e\u30af\u30ed\u30b9\u3067\u58f2\u8cb7\u30b5\u30a4\u30f3\u3068\u307f\u306a\u3057\u307e\u3059\u3002<\/p>\n<p>MACD(OSCI)\u306f\u3001\u4e0a\u6607\u8ee2\u63db\uff08\u597d\u8ee2\uff09\u3067\u8cb7\u3044\u30b5\u30a4\u30f3\u3001\u4e0b\u964d\u8ee2\u63db\uff08\u6697\u8ee2\uff09\u3067\u58f2\u308a\u30b5\u30a4\u30f3\u3068\u898b\u308c\u307e\u3059\u3057\u3001\u4e0a\u6607\u4e2d\u306f\u4e0a\u6607\u30c8\u30ec\u30f3\u30c9\u306e\u7d99\u7d9a\u3001\u4e0b\u964d\u4e2d\u306f\u4e0b\u964d\u30c8\u30ec\u30f3\u30c9\u306e\u7d99\u7d9a\u3068\u5224\u65ad\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>MACD\u306e\u30c1\u30e3\u30fc\u30c8<\/h2>\n<p>\u9ec4\u8272\u7dda=MACD\u3001\u8d64\u7dda=MACD(\u30b7\u30b0\u30ca\u30eb)\u3001\u9752\u306e\u68d2\u30b0\u30e9\u30d5=MACD(OSCI)<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/atmtech.net\/main\/tech\/macd1.JPG\" alt=\"\" width=\"460\" height=\"234\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>MACD\u306f\u30ec\u30fc\u30c8\u306b\u9650\u3089\u305a\u4efb\u610f\u306e\u6307\u6a19\u306e\u5024\u306e\u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u5747\u7dda\u30922\u672c\u8a08\u7b97\u3059\u308c\u3070\u3001\u3069\u3093\u306a\u6307\u6a19\u3067\u3082\u9069\u7528\u3057\u8a08\u7b97\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4e0b\u8a18\u306f\u30b9\u30c8\u30ad\u30e3\u30b9\u30c6\u30a3\u30af\u30b9(%K)\u3092MACD\u5316\u3057\u305f\u30c1\u30e3\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/atmtech.net\/main\/tech\/macd2.JPG\" alt=\"\" width=\"460\" height=\"234\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b21\u306f\u3001\u4e00\u76ee\u5747\u8861\u8868\u306e\u5148\u884c\u30b9\u30d1\u30f31\u3092MACD\u5316\u3057\u305f\u30c1\u30e3\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/atmtech.net\/main\/tech\/macd3.JPG\" alt=\"\" width=\"460\" height=\"247\" \/><\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>&nbsp;<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>MACD\u306e\u30a8\u30af\u30bb\u30ebVBA\u30b3\u30fc\u30c9<\/h2>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u5f8c\u306bMACD\u306eVBA\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>&#8216;\u203b\u3000\u30a8\u30af\u30bb\u30eb\u306e1\u5217\u76ee(A\u5217)\u306b\u884c\u756a\u53f7\u30012\u5217\u76ee(B\u5217)\u306b\u65e5\u6642\u3001<br \/>\n&#8216;\u203b\u30003\u5217\u76ee(C\u5217)\uff5e6\u5217\u76ee(F\u5217)\u306b\u59cb\u5024\u30fb\u9ad8\u5024\u30fb\u5b89\u5024\u30fb\u7d42\u5024<br \/>\n&#8216;********************************<br \/>\n&#8216;ema1 \uff1aMACD\u306eEMA(1)\u306e\u63a1\u7528\u672c\u6570<br \/>\n&#8216;ema2 \uff1aMACD\u306eEMA(2)\u306e\u63a1\u7528\u672c\u6570<br \/>\n&#8216;sig \uff1aMACD(\u30b7\u30b0\u30ca\u30eb)\u306e\u63a1\u7528\u672c\u6570<br \/>\n&#8216;num\uff1a\u73fe\u5728\u306e\u884c<br \/>\n&#8216;cell_ema1\uff1aEMA(1)\u306e\u66f8\u8fbc\u307f\u5217<br \/>\n&#8216;cell_ema2\uff1aEMA(2)\u306e\u66f8\u8fbc\u307f\u5217<br \/>\n&#8216;cell_macd\uff1aMACD\u306e\u66f8\u8fbc\u307f\u5217<br \/>\n&#8216;cell_sig\uff1aMACD(\u30b7\u30b0\u30ca\u30eb)\u306e\u66f8\u8fbc\u307f\u5217<br \/>\n&#8216;cell_osci\uff1aMACD(OSCI)\u306e\u66f8\u8fbc\u307f\u5217<br \/>\n&#8216;********************************<\/p>\n<p>ema1 = 5<br \/>\nema2 = 10<br \/>\nsig = 3<\/p>\n<p>cell_ema1 = 7<br \/>\ncell_ema2 = 8<br \/>\ncell_macd = 9<br \/>\ncell_sig = 10<br \/>\ncell_osci = 11<br \/>\n&#8216;&#8212;&#8211;ema1<br \/>\nIf num + 1 = ema1 Then<br \/>\nCells(num, cell_ema1) = Application.WorksheetFunction.Average _<br \/>\n(Range(Cells(num &#8211; (ema1 &#8211; 1), 6), .Cells(num, 6)))<br \/>\nEnd If<br \/>\nIf num + 1 &gt; ema1 Then<br \/>\nCells(num, cell_ema1) = Cells(num &#8211; 1, cell_ema1) + _<br \/>\n((Cells(num, 6) &#8211; Cells(num &#8211; 1, cell_ema1)) * 2 _<br \/>\n\/ (ema1 + 1))<br \/>\nEnd If<\/p>\n<p>&#8216;&#8212;&#8211;ema2<br \/>\nIf num + 1 = ema2 Then<br \/>\nCells(num, cell_ema2) = Application.WorksheetFunction.Average _<br \/>\n(Range(Cells(num &#8211; (ema2 &#8211; 1), 6), .Cells(num, 6)))<br \/>\nEnd If<br \/>\nIf num + 1 &gt; ema2 Then<br \/>\nCells(num, cell_ema2) = Cells(num &#8211; 1, cell_ema2) + _<br \/>\n((Cells(num, 6) &#8211; Cells(num &#8211; 1, cell_ema2)) * 2 _<br \/>\n\/ (ema2 + 1))<br \/>\nEnd If<\/p>\n<p>&#8216;&#8212;&#8211;macd<br \/>\nIf Cells(num &#8211; 1, cell_ema1) &lt;&gt; &#8220;&#8221; _<br \/>\nAnd .Cells(num &#8211; 1, cell_ema2) &lt;&gt; &#8220;&#8221; Then<br \/>\nCells(num, cell_macd) = Cells(num, cell_ema1) &#8211; Cells(num, cell_ema2)<br \/>\nEnd If<\/p>\n<p>&#8216;&#8212;&#8211;signal<br \/>\nIf num &gt;= ema2 + sig + 1 Then<br \/>\nCells(num_1, cell_sig) = Application.WorksheetFunction.Average _<br \/>\n(Range(Cells(num &#8211; (sig &#8211; 1), cell_macd), _<br \/>\nCells(num, cell_macd)))<br \/>\nEnd If<\/p>\n<p>&#8216;&#8212;&#8211;osci<br \/>\nIf .Cells(num, cell_macd) &lt;&gt; &#8220;&#8221; _<br \/>\nAnd .Cells(num, cell_sig) &lt;&gt; &#8220;&#8221; Then<br \/>\nCells(num_1, cell_osci) = Cells(num, cell_macd) &#8211; Cells(num, cell_sig)<br \/>\nEnd If<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/atmtech.net\/main\/?cat=30\" target=\"_blank\" rel=\"noopener\">\u30c6\u30af\u30cb\u30ab\u30eb\u6307\u6a19\u4e00\u89a7<\/a><\/p>\n<p><a href=\"https:\/\/atmtech.net\/main\/?cat=109\" target=\"_blank\" rel=\"noopener\">\u7f6b\u7dda\u8ac7\u7fa9\u4e00\u89a7<\/a><\/p>\n<p>(\u5916\u90e8\u30ea\u30f3\u30af)<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%83%86%E3%82%AF%E3%83%8B%E3%82%AB%E3%83%AB%E6%8C%87%E6%A8%99%E4%B8%80%E8%A6%A7\" target=\"_blank\" rel=\"noopener\">\u30c6\u30af\u30cb\u30ab\u30eb\u6307\u6a19(Wikipedia)<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; MACD\u306b\u3064\u3044\u3066\u3002\u8a08\u7b97\u5f0f\u3001\u30c1\u30e3\u30fc\u30c8\u3001\u30a8\u30af\u30bb\u30ebVBA\u30b3\u30fc\u30c9 &nbsp; MACD\u306f2\u672c\u306e\u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u5747\u7dda\u306e\u5dee\u304b\u3089\u6c42\u3081\u3089\u308c\u3001\u30c8\u30ec\u30f3\u30c9\u3084\u4e56\u96e2\u306a\u3069\u3092\u5224\u65ad\u3059\u308b\u969b\u306b\u4f7f\u7528\u3055\u308c\u308b\u6307\u6a19\u3067\u3059\u3002 &nbsp; \u6307\u6570\u5e73\u6ed1\u79fb\u52d5\u5e73\u2026 <span class=\"read-more\"><a href=\"https:\/\/atmtech.net\/main\/tech-calc-macd\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":2856,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[31,47,48,49,50,80,36,52],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/posts\/2855"}],"collection":[{"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/comments?post=2855"}],"version-history":[{"count":6,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/posts\/2855\/revisions"}],"predecessor-version":[{"id":3901,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/posts\/2855\/revisions\/3901"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/media\/2856"}],"wp:attachment":[{"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/media?parent=2855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/categories?post=2855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmtech.net\/main\/wp-json\/wp\/v2\/tags?post=2855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}