{"id":450,"date":"2024-09-09T11:03:21","date_gmt":"2024-09-09T02:03:21","guid":{"rendered":"https:\/\/itadaki-marketing.com\/mpa\/?p=450"},"modified":"2024-09-09T11:03:23","modified_gmt":"2024-09-09T02:03:23","slug":"mql4%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8birsi%e9%96%a2%e6%95%b0%ef%bc%88%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab%e3%82%bd%e3%83%bc%e3%82%b9","status":"publish","type":"post","link":"https:\/\/itadaki-marketing.com\/mpa\/2024\/09\/09\/450\/","title":{"rendered":"MQL4\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3051\u308biRSI\u95a2\u6570\uff08\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3042\u308a\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><code>iRSI<\/code>\u95a2\u6570\u306f\u3001MQL4\u3067RSI\uff08\u76f8\u5bfe\u5f37\u5ea6\u6307\u6570\uff09\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u95a2\u6570\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u3001<code>iRSI<\/code>\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3092\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u3068\u3082\u306b\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><code>iRSI<\/code>\u95a2\u6570\u306e\u69cb\u6587<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\" data-show-lang=\"0\"><code>double iRSI(\n   string symbol,      \/\/ \u30b7\u30f3\u30dc\u30eb\u540d\n   int timeframe,      \/\/ \u6642\u9593\u67a0\n   int period,         \/\/ RSI\u306e\u671f\u9593\n   int applied_price,  \/\/ \u9069\u7528\u4fa1\u683c\n   int shift           \/\/ \u30b7\u30d5\u30c8\n);<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8aac\u660e<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead><tbody><tr><td>symbol<\/td><td>RSI\u3092\u8a08\u7b97\u3059\u308b\u5bfe\u8c61\u306e\u30b7\u30f3\u30dc\u30eb\uff08\u901a\u8ca8\u30da\u30a2\uff09\u3002NULL\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u73fe\u5728\u306e\u30c1\u30e3\u30fc\u30c8\u306e\u30b7\u30f3\u30dc\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/td><\/tr><tr><td>timeframe<\/td><td>RSI\u3092\u8a08\u7b97\u3059\u308b\u6642\u9593\u67a0\uff08\u4f8b: PERIOD_H1\uff09\u30020\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u73fe\u5728\u306e\u30c1\u30e3\u30fc\u30c8\u306e\u6642\u9593\u67a0\u306b\u306a\u308a\u307e\u3059\u3002<\/td><\/tr><tr><td>period<\/td><td>RSI\u306e\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u671f\u9593\u3002<\/td><\/tr><tr><td>applied_price<\/td><td>RSI\u306e\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u4fa1\u683c\uff08\u4f8b: PRICE_CLOSE\uff09\u3002<\/td><\/tr><tr><td>shift<\/td><td>RSI\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30d0\u30fc\u306e\u30b7\u30d5\u30c8\u30020\u306f\u73fe\u5728\u306e\u30d0\u30fc\u3092\u6307\u3057\u307e\u3059\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u306f\u3001RSI\u3092\u8a08\u7b97\u3057\u3001\u305d\u306e\u5024\u306b\u57fa\u3065\u3044\u3066\u58f2\u8cb7\u30b7\u30b0\u30ca\u30eb\u3092\u51fa\u3059\u30b7\u30f3\u30d7\u30eb\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\" data-show-lang=\"0\"><code>\/\/+------------------------------------------------------------------+\n\/\/| Expert initialization function                                   |\n\/\/+------------------------------------------------------------------+\nint OnInit()\n  {\n   return(INIT_SUCCEEDED);\n  }\n\n\/\/+------------------------------------------------------------------+\n\/\/| Expert deinitialization function                                 |\n\/\/+------------------------------------------------------------------+\nvoid OnDeinit(const int reason)\n  {\n  }\n\n\/\/+------------------------------------------------------------------+\n\/\/| Expert tick function                                             |\n\/\/+------------------------------------------------------------------+\nvoid OnTick()\n  {\n   \/\/ RSI\u306e\u8a08\u7b97\n   double rsiValue = iRSI(NULL, 0, 14, PRICE_CLOSE, 0);\n   \n   \/\/ RSI\u306e\u5024\u3092\u8868\u793a\n   Comment(&quot;Current RSI: &quot;, rsiValue);\n\n   \/\/ RSI\u306b\u57fa\u3065\u304f\u58f2\u8cb7\u30b7\u30b0\u30ca\u30eb\n   if(rsiValue &gt; 70)\n     {\n      Print(&quot;Overbought - Consider selling&quot;);\n     }\n   else if(rsiValue &lt; 30)\n     {\n      Print(&quot;Oversold - Consider buying&quot;);\n     }\n  }<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">EA\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">MQL4\u3067iRSI\u95a2\u6570\u3092\u4f7f\u3063\u306670\u4ee5\u4e0a\u3067\u9006\u5f35\u308a\u30b7\u30e7\u30fc\u30c8\u300130\u4ee5\u4e0b\u3067\u9006\u5f35\u308a\u30ed\u30f3\u30b0\u3092\u884c\u3046\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\" data-show-lang=\"0\"><code>#property copyright &quot;Copyright 2024, Your Name&quot;\n#property link      &quot;https:\/\/www.example.com&quot;\n#property version   &quot;1.00&quot;\n#property strict\n\nextern int RSI_Period = 14;     \/\/ RSI\u671f\u9593\nextern double Lots = 0.1;       \/\/ \u53d6\u5f15\u30ed\u30c3\u30c8\u6570\nextern int StopLoss = 50;       \/\/ \u30b9\u30c8\u30c3\u30d7\u30ed\u30b9(\u30dd\u30a4\u30f3\u30c8)\nextern int TakeProfit = 100;    \/\/ \u5229\u76ca\u78ba\u5b9a(\u30dd\u30a4\u30f3\u30c8)\n\nint OnInit()\n{\n    return(INIT_SUCCEEDED);\n}\n\nvoid OnDeinit(const int reason)\n{\n}\n\nvoid OnTick()\n{\n    if(OrdersTotal() == 0) \/\/ \u30dd\u30b8\u30b7\u30e7\u30f3\u304c\u306a\u3044\u5834\u5408\u306e\u307f\u30a8\u30f3\u30c8\u30ea\u30fc\n    {\n        double rsi = iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, 0);\n        \n        if(rsi &gt;= 70) \/\/ RSI\u304c70\u4ee5\u4e0a\u306e\u5834\u5408\u3001\u9006\u5f35\u308a\u30b7\u30e7\u30fc\u30c8\n        {\n            double entry = Bid;\n            double sl = entry + StopLoss * Point;\n            double tp = entry - TakeProfit * Point;\n            \n            int ticket = OrderSend(Symbol(), OP_SELL, Lots, entry, 3, sl, tp, &quot;RSI Reverse Short&quot;, 0, 0, Red);\n            \n            if(ticket &gt; 0)\n            {\n                Print(&quot;\u30b7\u30e7\u30fc\u30c8\u30dd\u30b8\u30b7\u30e7\u30f3\u3092\u958b\u304d\u307e\u3057\u305f\u3002\u30c1\u30b1\u30c3\u30c8\u756a\u53f7: &quot;, ticket);\n            }\n            else\n            {\n                Print(&quot;\u30a8\u30e9\u30fc: \u30b7\u30e7\u30fc\u30c8\u30dd\u30b8\u30b7\u30e7\u30f3\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u30a8\u30e9\u30fc\u30b3\u30fc\u30c9: &quot;, GetLastError());\n            }\n        }\n        else if(rsi &lt;= 30) \/\/ RSI\u304c30\u4ee5\u4e0b\u306e\u5834\u5408\u3001\u9006\u5f35\u308a\u30ed\u30f3\u30b0\n        {\n            double entry = Ask;\n            double sl = entry - StopLoss * Point;\n            double tp = entry + TakeProfit * Point;\n            \n            int ticket = OrderSend(Symbol(), OP_BUY, Lots, entry, 3, sl, tp, &quot;RSI Reverse Long&quot;, 0, 0, Blue);\n            \n            if(ticket &gt; 0)\n            {\n                Print(&quot;\u30ed\u30f3\u30b0\u30dd\u30b8\u30b7\u30e7\u30f3\u3092\u958b\u304d\u307e\u3057\u305f\u3002\u30c1\u30b1\u30c3\u30c8\u756a\u53f7: &quot;, ticket);\n            }\n            else\n            {\n                Print(&quot;\u30a8\u30e9\u30fc: \u30ed\u30f3\u30b0\u30dd\u30b8\u30b7\u30e7\u30f3\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u30a8\u30e9\u30fc\u30b3\u30fc\u30c9: &quot;, GetLastError());\n            }\n        }\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><canvas width=\"1110\" height=\"74\"><\/canvas><\/p>\n","protected":false},"excerpt":{"rendered":"<p>iRSI\u95a2\u6570\u306f\u3001MQL4\u3067RSI\uff08\u76f8\u5bfe\u5f37\u5ea6\u6307\u6570\uff09\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u95a2\u6570\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u3001iRSI\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3092\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u3068\u3082\u306b\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002 iRSI\u95a2\u6570\u306e\u69cb\u6587 \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8aac\u660e \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc \u8aac\u660e sy [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":451,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[8,1],"tags":[],"class_list":["post-450","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mql","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/posts\/450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/comments?post=450"}],"version-history":[{"count":1,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/posts\/450\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/posts\/450\/revisions\/452"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/media\/451"}],"wp:attachment":[{"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/media?parent=450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/categories?post=450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itadaki-marketing.com\/mpa\/wp-json\/wp\/v2\/tags?post=450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}