{"id":283487,"date":"2017-03-19T16:45:39","date_gmt":"2017-03-19T13:45:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283487"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283487","title":{"rendered":"\u041a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0432 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0435?"},"content":{"rendered":"<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0432 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u0430\u043a \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438. <br \/>  \u0411\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 Forex \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u0432, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<br \/>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u2014 \u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 (\u043f\u043e\u0447\u0442\u0438) \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432), \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0442\u043e\u0440\u0433\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e.<br \/>  \u0412\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? <\/h2>\n<p>  <b>\u041f\u0430\u0442\u0442\u0435\u0440\u043d<\/b> \u2014 \u044d\u0442\u043e \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f, \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0441\u043b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0446\u0435\u043d\u0430 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443.<br \/>  \u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0438\u0437 \u043b\u0435\u0433\u043a\u0438\u0445, \u043d\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438, \u0442\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u043e. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u044b\u0431\u043e\u0440\u0443 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e.<br \/>  \u0422\u0430\u043a\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0432 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0440\u044b\u043d\u043a\u0430.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>  <\/p>\n<ol>\n<li> \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u044f\u0432\u043a\u0438 \u043d\u0430 Forex \u0447\u0435\u0440\u0435\u0437 RESTv20 API, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f demo \u0441\u0447\u0435\u0442 \u0443 <a href=\"http:\/\/oanda.com\">\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0431\u0440\u043e\u043a\u0435\u0440\u0430<\/a>. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0438\u043d\u0443\u0442\u0443, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 token (\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430) \u0438 \u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430. <\/li>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c Python \u0432\u0435\u0440\u0441\u0438\u0438 2.7 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438: oandapyV20, sklearn, matplotlib, numpy, psycopg2. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 pip.  <\/li>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c PostgreSQL, \u0443 \u043c\u0435\u043d\u044f \u0432\u0435\u0440\u0441\u0438\u044f 9.6.  <\/li>\n<\/ol>\n<h2>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h2>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 Candle, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0432\u0435\u0447\u0435:  <\/p>\n<pre><code class=\"python\">class Candle:     def __init__(self, datetime, ask, bid, volume):         self.datetime = datetime         self.ask = ask         self.bid = bid         self.volume = volume <\/code><\/pre>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"python\">class Pattern:     result = ''     serie = list()      def __init__(self, serie, result):         self.serie = serie         self.result = result <\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e\u043a\u0443\u043f\u043a\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0430.<br \/>  \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <b>\u0444\u043e\u0440\u043c\u0430<\/b>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0440\u043e\u0441\u0442\u043e \u0446\u0435\u043d\u0430\u043c\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0432\u0435\u0440\u043d\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0438\u0445 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>  <img decoding=\"async\" align=\"left\" src=\"https:\/\/habrastorage.org\/files\/6c2\/79c\/b44\/6c279cb448414a7286f6c65e0467ec74.jpg\"\/><br \/>  \u0412\u0432\u0435\u0434\u0435\u043c \u0435\u0449\u0435 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:  <\/p>\n<ol>\n<li> \u0414\u043b\u0438\u043d\u0430 \u0441\u0435\u0440\u0438\u0438 (<b>Length<\/b>) \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0441\u0435\u0440\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430<\/li>\n<li> \u0428\u0438\u0440\u0438\u043d\u0430 \u043e\u043a\u043d\u0430 (<b>window<\/b> size) \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0440\u0438\u0438, \u0434\u043b\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f <i><b>\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430<\/b><\/i> <\/li>\n<\/ol>\n<p>  <b>\u041a\u0430\u043a\u0438\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432<\/b>? \u2014 \u0442\u0430\u043a\u0438\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0431\u044b\u043b\u044c:<br \/>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043a\u0443\u043f\u0430\u0435\u043c \u043f\u043e \u0446\u0435\u043d\u0435 <b>ask<\/b> = X, \u0442\u043e \u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e \u0432\u043e\u0437\u0440\u043e\u0441\u0448\u0435\u0439 \u0446\u0435\u043d\u0435 <b>bid<\/b> &gt; X. \u0418 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0434\u0430\u0435\u043c \u043f\u043e \u0446\u0435\u043d\u0435 <b>bid<\/b> = Y, \u0442\u043e \u043a\u0443\u043f\u0438\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e \u0446\u0435\u043d\u0435 <b>ask<\/b> &lt; Y. \u0412 \u044d\u0442\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043f\u0440\u0435\u0434\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0440\u0438\u0431\u044b\u043b\u044c. <br \/>  <i>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u043e\u0442\u0431\u043e\u0440\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u043d\u043e, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043a \u043d\u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u042d\u0442\u043e \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0412\u0430\u043c \u043f\u043e\u0437\u0436\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/i> \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u0440\u044b\u043d\u043a\u0430, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0442\u043f) \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u0435\u043d \u2014 \u0433\u0434\u0435-\u0442\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0435\u0441\u0442\u044c, \u0430 \u0433\u0434\u0435-\u0442\u043e \u043d\u0435\u0442. \u0418\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0445 \u043e\u0442\u0431\u043e\u0440\u0430.<\/p>\n<h2>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u0445 \u0432 \u0411\u0414 PostgreSQL.<br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435:  <\/p>\n<pre><code class=\"python\">import pandas from oandapyV20.endpoints import instruments  class StockDataDownloader(object):      def get_data_from_finam(self, ticker, period, marketCode, insCode, dateFrom, dateTo):         &quot;&quot;&quot;Downloads data from FINAM.ru stock service&quot;&quot;&quot;         addres = 'http:\/\/export.finam.ru\/data.txt?market=' + str(marketCode) + '&em=' + str(insCode) + '&code=' + ticker + '&df=' + str(dateFrom.day) + '&mf=' + str(dateFrom.month-1) + '&yf=' + str(dateFrom.year) + '&dt=' + str(dateTo.day) + '&mt=' + str(dateTo.month-1) + '&yt=' + str(dateTo.year) + '&p=' + str(period + 2) + 'data&e=.txt&cn=GAZP&dtf=4&tmf=4&MSOR=1&sep=1&sep2=1&datf=5&at=1'         return pandas.read_csv(addres)      def get_data_from_oanda_fx(self, API, insName, timeFrame, dateFrom, dateTo):         params = 'granularity=%s&from=%s&to=%s&price=BA' % (timeFrame, dateFrom.isoformat('T') + 'Z', dateTo.isoformat('T') + 'Z')         r = instruments.InstrumentsCandles(insName, params=params)         API.request(r)         return r.response <\/code><\/pre>\n<p>  <b>\u0411\u043e\u043d\u0443\u0441:<\/b> \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0424\u0438\u043d\u0430\u043c\u0430. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a Forex, \u0442\u0430\u043a \u0438 \u0440\u044b\u043d\u043a\u0438 \u041c\u041c\u0412\u0411 \u0438 \u0424\u041e\u0420\u0422\u0421. \u041c\u0438\u043d\u0443\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 1 \u043c\u0438\u043d\u0443\u0442\u044b, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c 5-\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u044b\u0435 \u0441\u0432\u0435\u0447\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0411\u0414:  <\/p>\n<pre><code class=\"python\">import psycopg2 from StockDataDownloader import StockDataDownloader from Conf import DbConfig, Config from datetime import datetime, timedelta import oandapyV20 import re  step = 60*360  # download step, s daysTotal = 150 # download period, days dbConf = DbConfig.DbConfig() conf = Config.Config() connect = psycopg2.connect(database=dbConf.dbname, user=dbConf.user, host=dbConf.address, password=dbConf.password) cursor = connect.cursor()  print 'Successfully connected' cursor.execute(&quot;SELECT * FROM pg_tables WHERE schemaname='public';&quot;) tables = list() for row in cursor:     tables.append(row[1]) for name in tables:     cmd = &quot;DROP TABLE &quot; + name     print cmd     cursor.execute(cmd) connect.commit()  tName = conf.insName.lower() cmd = ('CREATE TABLE public.&quot;{0}&quot; (' \\        'datetimestamp TIMESTAMP WITHOUT TIME ZONE NOT NULL,' \\        'ask FLOAT NOT NULL,' \\        'bid FLOAT NOT NULL,' \\        'volume FLOAT NOT NULL,' \\        'CONSTRAINT &quot;PK_ID&quot; PRIMARY KEY (&quot;datetimestamp&quot;));' \\        'CREATE UNIQUE INDEX timestamp_idx ON {0} (&quot;datetimestamp&quot;);').format(tName) cursor.execute(cmd) connect.commit()  print 'Created table', tName  downloader = StockDataDownloader.StockDataDownloader() oanda = oandapyV20.API(environment=conf.env, access_token=conf.token)  def parse_date(ts):     # parse date in UNIX time stamp     return datetime.fromtimestamp(float(ts))   date = datetime.utcnow() - timedelta(days=daysTotal) dateStop = datetime.utcnow()  candleDiff = conf.candleDiff if conf.candlePeriod == 'M':     candleDiff = candleDiff * 60 if conf.candlePeriod == 'H':     candleDiff = candleDiff * 3600  last_id = datetime.min while date &lt; dateStop - timedelta(seconds=step):     dateFrom = date     dateTo = date + timedelta(seconds=step)     data = downloader.get_data_from_oanda_fx(oanda, conf.insName, '{0}{1}'.format(conf.candlePeriod, conf.candleDiff),                                              dateFrom, dateTo)     if len(data.get('candles')) &gt; 0:         cmd = ''         cmd = ('INSERT INTO {0} VALUES').format(tName)         cmd_bulk = ''         for candle in data.get('candles'):             id = parse_date(candle.get('time'))             volume = candle.get('volume')             if volume != 0 and id!=last_id:                 cmd_bulk = cmd_bulk + (&quot;(TIMESTAMP '{0}',{1},{2},{3}),\\n&quot;                                    .format(id, candle.get('ask')['c'], candle.get('bid')['c'],                                            volume))             last_id = id         if len(cmd_bulk) &gt; 0:             cmd = cmd + cmd_bulk[:-2] + ';'             cursor.execute(cmd)             connect.commit()     print (&quot;Saved candles from {0} to {1}&quot;.format(dateFrom, dateTo))     date = dateTo  cmd = &quot;REINDEX INDEX timestamp_idx;&quot; print cmd cursor.execute(cmd) connect.commit()  connect.close()  <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 Oanda, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u0435\u0447\u0438 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u044b. \u041f\u0440\u0438\u0447\u0435\u043c, \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0435\u0440\u0438\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0446\u0435\u043d\u0430 \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0430\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u0435\u0447\u0438 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0432\u0435\u0447\u0435 \u043e\u0442 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c. \u0412 <a href=\"https:\/\/github.com\/antonkorbalev\/StockDataProcessing\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 Github<\/a> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u0422\u0430\u043a \u0436\u0435, \u0435\u0441\u043b\u0438 \u0412\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u044b\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u0435\u0447\u0438, \u0435\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 DbCheck.py, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u0435\u0447\u0435\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f.<\/p>\n<h3>\u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"python\">import psycopg2 from Conf import DbConfig, Config from Desc.Candle import Candle from Desc.Pattern import Pattern import numpy  def get_patterns_for_window_and_num(window, length, limit=None):     conf = Config.Config()     dbConf = DbConfig.DbConfig()     connect = psycopg2.connect(database=dbConf.dbname, user=dbConf.user, host=dbConf.address, password=dbConf.password)     cursor = connect.cursor()      print 'Successfully connected'     tName = conf.insName.lower()     cmd = 'SELECT COUNT(*) FROM {0};'.format(tName)     cursor.execute(cmd)     totalCount = cursor.fetchone()[0]     print 'Total items count {0}'.format(totalCount)     cmd = 'SELECT * FROM {0} ORDER BY datetimestamp'.format(tName)     if limit is None:         cmd = '{0};'.format(cmd)     else:         cmd = '{0} LIMIT {1};'.format(cmd, limit)     cursor.execute(cmd)      wl = list()     patterns = list()     profits = list()     indicies = list()     i = 1     for row in cursor:         nextCandle = Candle(row[0], row[1], row[2], row[3])         wl.append(nextCandle)         print 'Row {0} of {1}, {2:.3f}% total'.format(i, totalCount, 100*(float(i)\/float(totalCount)))         if len(wl) == window+length:             # find pattern of 0..length elements             # that indicates price falls \/ grows             # in the next window elements to get profit             candle = wl[length-1]             ind = length + 1             # take real data only             if candle.volume != 0:                 while ind &lt;= window + length:                     iCandle = wl[ind-1]                     # define patterns for analyzing iCandle                     if iCandle.volume != 0:                         if iCandle.bid &gt; candle.ask:                             # buy pattern                             p = Pattern(wl[:length],'buy')                             patterns.append(p)                             indicies.append(ind - length)                             profits.append(iCandle.bid - candle.ask)                             break                         if iCandle.ask &lt; candle.bid:                             # sell pattern                             p = Pattern(wl[:length],'sell')                             patterns.append(p)                             indicies.append(ind - length)                             profits.append(candle.bid - iCandle.ask)                             break                     ind = ind + 1             wl.pop(0)         i = i + 1     print 'Total patterns: {0}'.format(len(patterns))     print 'Mean index[after]: {0}'.format(numpy.mean(indicies))     print 'Mean profit: {0}'.format(numpy.mean(profits))     connect.close()     return patterns   def pattern_serie_to_vector(pattern):     sum = 0     for candle in pattern.serie:         sum = sum + float(candle.ask + candle.bid) \/ 2;     mean = sum \/ len(pattern.serie)     vec = []     for candle in pattern.serie:         vec = numpy.hstack((vec, [ (candle.ask+candle.bid) \/ (2 * mean) ]))     return vec   def get_x_y_for_patterns(patterns, expected_result):     X = []     y = []     for p in patterns:         X.append(pattern_serie_to_vector(p))         if (p.result == expected_result):             y.append(1)         else:             y.append(0)     return X, y  <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <b>pattern_serie_to_vector<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u0446\u0435\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435, \u0430 <i><u>\u0444\u043e\u0440\u043c\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f<\/u><\/i> (\u0430\u043d\u0430\u043b\u043e\u0433 \u0432 \u0442\u0435\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u2014 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u043d\u0435\u0432\u0430\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u0435 \u0446\u0435\u043d\u044b, \u0432\u0430\u0436\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0432\u0435\u0447\u0435\u0439).<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u2014 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438. \u0411\u0443\u0434\u0435\u043c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u043e\u0449\u0430\u0442\u044c \u043f\u043e\u0434 ROC \u043a\u0440\u0438\u0432\u043e\u0439 (AUC_ROC) \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u043e 5 \u0431\u043b\u043e\u043a\u0430\u043c, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.<br \/>  \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 ROC \u043a\u0440\u0438\u0432\u043e\u0439 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0.5 (\u0441\u0430\u043c\u044b\u0439 \u043f\u043b\u043e\u0445\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440) \u0434\u043e 1 (\u0441\u0430\u043c\u044b\u0439 \u043b\u0443\u0447\u0448\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440). \u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b 0.8.<br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043b\u0438\u043d\u0443 \u0441\u0435\u0440\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0438 \u043e\u043a\u043d\u043e.<\/p>\n<p>  \u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u0441\u0435\u0440\u0438\u0438 \u0438 \u043e\u043a\u043d\u0443 (\u0432 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0440\u0430\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0434\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0434\u043b\u0438\u043d\u0443 \u0441\u0435\u0440\u0438\u0438 \u0438 \u043e\u043a\u043d\u043e):<\/p>\n<pre><code class=\"python\"># gradient boosting import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import KFold, cross_val_score from sklearn.ensemble import GradientBoostingClassifier from PatternsCollector import get_patterns_for_window_and_num, get_x_y_for_patterns import seaborn  nums = [2,5,10] i = 0 wrange = [1,5,10] lrange = [5,10] values = list() legends = list()  for wnd in wrange:     for l in lrange:         scores = []         patterns = get_patterns_for_window_and_num(wnd, l)         X, y = get_x_y_for_patterns(patterns, 'buy')          for n in nums:             i = i+1             kf = KFold(n_splits=5, shuffle=True, random_state=100)             model = GradientBoostingClassifier(n_estimators=n, random_state=100)             ms = cross_val_score(model, X, y, cv=kf, scoring='roc_auc')             scores.append(np.mean(ms))             print 'Calculated {0}-{1}, num={2}, {3:.3f}%'.format(wnd, l, n, 100 * i\/float((len(nums)*len(wrange)*len(lrange))))         values.append(scores)         legends.append('{0}-{1}'.format(wnd, l))  plt.xlabel('estimators count') plt.ylabel('accuracy') for v in values:     plt.plot(nums, v) plt.legend(legends) plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/15b\/6d8\/551\/15b6d85517b14f98899f448ed2faada5.png\"\/><\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"python\"># logistic regression from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler from PatternsCollector import get_patterns_for_window_and_num, get_x_y_for_patterns from sklearn.model_selection import KFold, cross_val_score import numpy as np import matplotlib.pyplot as plt import seaborn  cr = [10.0 ** i for i in range(-3, 1)] i = 0 wrange = [1,5,10] lrange = [5, 10] values = list() legends = list()  for wnd in wrange:     for l in lrange:         scores = []         patterns = get_patterns_for_window_and_num(wnd, l)         X, y = get_x_y_for_patterns(patterns, 'buy')         sc = StandardScaler()         X_sc = sc.fit_transform(X)          for c in cr:             i = i+1             kf = KFold(n_splits=5, shuffle=True, random_state=100)             model = LogisticRegression(C=c, random_state=100)             ms = cross_val_score(model, X_sc, y, cv=kf, scoring='roc_auc')             scores.append(np.mean(ms))             print 'Calculated {0}-{1}, C={2}, {3:.3f}%'.format(wnd, l, c, 100 * i\/float((len(cr)*len(wrange)*len(lrange))))         values.append(scores)         legends.append('{0}-{1}'.format(wnd, l))  plt.xlabel('C value') plt.ylabel('accuracy') for v in values:     plt.plot(cr, v) plt.legend(legends) plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/747\/2b5\/0bc\/7472b50bcace4bc2bcd9a4d43b732f34.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e 0.52. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435, \u0442\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043b\u0443\u0447\u0448\u0435. \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u2014 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438, random forest \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. \u041d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u043c \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0435.<br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435: \u0435\u0441\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0411\u0414 \u0432\u0437\u044f\u0442\u044c \u043e\u0442 \u043d\u0438\u0445 sin(), \u0442\u043e \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 AUC_ROC \u043d\u0430 \u043a\u0440\u043e\u0441\u0441\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 0.96. <\/p>\n<h3>\u0422\u043e\u0440\u0433\u043e\u0432\u044b\u0439 \u0440\u043e\u0431\u043e\u0442<\/h3>\n<p>  \u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043a\u043e\u0434 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u044f\u0432\u043a\u0438 \u043a\u0430\u043a \u043d\u0430 demo \u0441\u0447\u0435\u0442\u0435, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u0441\u0434\u0435\u043b\u043e\u043a \u043e\u043d \u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u0440\u043e\u0444\u0438\u0442\u043e\u0432 \u043f\u043e \u0441\u0434\u0435\u043b\u043a\u0435, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u0442 \u0431\u0440\u043e\u043a\u0435\u0440\u0430. \u0422\u043e \u0435\u0441\u0442\u044c, \u0432\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0430\u0448\u0430 \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f.  <\/p>\n<pre><code class=\"python\">import datetime from datetime import datetime from os import path  import matplotlib.pyplot as plt import oandapyV20 import oandapyV20.endpoints.orders as orders import oandapyV20.endpoints.positions as positions from oandapyV20.contrib.requests import MarketOrderRequest from oandapyV20.contrib.requests import TakeProfitDetails, StopLossDetails from oandapyV20.endpoints.accounts import AccountDetails from oandapyV20.endpoints.pricing import PricingInfo from Conf.Config import Config import seaborn  config = Config() oanda = oandapyV20.API(environment=config.env, access_token = config.token) pReq = PricingInfo(config.account_id, 'instruments='+config.insName)  asks = list() bids = list() long_time = datetime.now() short_time = datetime.now()  if config.write_back_log:     f_back_log = open(path.relpath(config.back_log_path + '\/' + config.insName + '_' + datetime.datetime.now().strftime(&quot;%Y%m%d-%H%M%S&quot;))+'.log', 'a'); time = 0 times = list() last_ask = 0 last_bid = 0  if config.write_back_log:     print 'Backlog file name:', f_back_log.name     f_back_log.write('DateTime,Instrument,ASK,BID,Price change,Status, Spread, Result \\n')  def process_data(ask, bid, status):     global last_result     global last_ask     global last_bid     global  long_time     global short_time     if status != 'tradeable':         print config.insName, 'is halted.'         return     asks.append(ask)     bids.append(bid)     times.append(time)      # --- begin strategy here ---        # --- end strategy here ---      if len(asks) &gt; config.maxLength:         asks.pop(0)     if len(bids) &gt; config.maxLength:         bids.pop(0)     if len(times) &gt; config.maxLength:         times.pop(0)      if config.write_back_log:         f_back_log.write('%s,%s,%s,%s,%s,%s,%s \\n' % (datetime.datetime.now(), config.insName, pReq.response.get('prices')[0].get('asks')[1].get('price'), pReq.response.get('prices')[0].get('bids')[1].get('price'), pChange, ask-bid, result))  def do_long(ask):     if config.take_profit_value!=0 or config.stop_loss_value!=0:         order = MarketOrderRequest(instrument=config.insName,                                       units=config.lot_size,                                       takeProfitOnFill=TakeProfitDetails(price=ask+config.take_profit_value).data,                                       stopLossOnFill=StopLossDetails(price=ask-config.stop_loss_value).data)     else:         order = MarketOrderRequest(instrument=config.insName,                                       units=config.lot_size)     r = orders.OrderCreate(config.account_id, data=order.data)     resp = oanda.request(r)     print resp     price = resp.get('orderFillTransaction').get('price')     print time, 's: BUY price =', price     return float(price)  def do_short(bid):     if config.take_profit_value!=0 or config.stop_loss_value!=0:         order = MarketOrderRequest(instrument=config.insName,                                       units=-config.lot_size,                                       takeProfitOnFill=TakeProfitDetails(price=bid+config.take_profit_value).data,                                       stopLossOnFill=StopLossDetails(price=bid-config.stop_loss_value).data)     else:         order = MarketOrderRequest(instrument=config.insName,                                       units=-config.lot_size)     r = orders.OrderCreate(config.account_id, data=order.data)     resp = oanda.request(r)     print resp     price = resp.get('orderFillTransaction').get('price')     print time, 's: SELL price =', price     return float(price)  def do_close_long():     try:         r = positions.PositionClose(config.account_id, 'EUR_USD', {&quot;longUnits&quot;: &quot;ALL&quot;})         resp = oanda.request(r)         print resp         pl = resp.get('longOrderFillTransaction').get('pl')         real_profits.append(float(pl))         print time, 's: Closed. Profit = ', pl, ' price = ', resp.get('longOrderFillTransaction').get('price')     except:         print 'No long units to close'  def do_close_short():     try:         r = positions.PositionClose(config.account_id, 'EUR_USD', {&quot;shortUnits&quot;: &quot;ALL&quot;})         resp = oanda.request(r)         print resp         pl = resp.get('shortOrderFillTransaction').get('tradesClosed')[0].get('realizedPL')         real_profits.append(float(pl))         print time, 's: Closed. Profit = ', pl, ' price = ', resp.get('shortOrderFillTransaction').get('price')     except:         print 'No short units to close'  def get_bal():     r = AccountDetails(config.account_id)     return oanda.request(r).get('account').get('balance')  plt.ion() plt.grid(True) do_close_long() do_close_short() real_profits = list()  while True:     try:         oanda.request(pReq)         ask = float(pReq.response.get('prices')[0].get('asks')[0].get('price'))         bid = float(pReq.response.get('prices')[0].get('bids')[0].get('price'))         status = pReq.response.get('prices')[0].get('status')         process_data(ask, bid, status)         plt.clf()         plt.subplot(1,2,1)         plt.plot(times, asks, color='red', label='ASK')         plt.plot(times, bids, color='blue', label='BID')         if last_ask!=0:             plt.axhline(last_ask, linestyle=':', color='red', label='curr ASK')         if last_bid!=0:             plt.axhline(last_bid, linestyle=':', color='blue', label='curr BID')         plt.xlabel('Time, s')         plt.ylabel('Price change')         plt.legend(loc='upper left')         plt.subplot(1, 2, 2)         plt.hist(real_profits, label='Profits')         plt.legend(loc='upper left')         plt.xlabel('Profits')         plt.ylabel('Counts')         plt.tight_layout()      except Exception as e:         print e     plt.pause(config.period)     time = time + config.period <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/antonkorbalev\/StockDataProcessing\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043b \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u043c, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0430\u043b\u0433\u043e\u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433. \u0412\u0435\u0434\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0412\u0430\u0448\u0438\u0445 \u0438\u0434\u0435\u0439 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u043e\u0431\u043e\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0412\u0430\u0448\u0438\u043c \u0441\u0434\u0435\u043b\u043a\u0430\u043c \u043e\u0442 \u0431\u0440\u043e\u043a\u0435\u0440\u0430. \u0418 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u044b\u0435 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0430\u043c \u043a\u0443\u0440\u0441\u0430 \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043d\u0430 Coursera. \u0410 \u0442\u0430\u043a \u0436\u0435 Andrew Ng \u0437\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u0436\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0435.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/324244\/\"> https:\/\/habrahabr.ru\/post\/324244\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0432 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u0430\u043a \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438. <br \/>  \u0411\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 Forex \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u0432, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<br \/>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u2014 \u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 (\u043f\u043e\u0447\u0442\u0438) \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432), \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0442\u043e\u0440\u0433\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e.<br \/>  \u0412\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283487","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283487"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283487\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}