{"id":405411,"date":"2024-06-29T18:18:29","date_gmt":"2024-06-29T18:18:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=405411"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=405411","title":{"rendered":"<span>Open source \u0431\u043e\u0442 \u0434\u043b\u044f \u0442\u043e\u0440\u0433\u043e\u0432 \u043d\u0430 Binance. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/27c\/2dd\/d1f\/27c2ddd1f4726acbefefd8f6ea9dd962.png\" width=\"744\" height=\"349\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/27c\/2dd\/d1f\/27c2ddd1f4726acbefefd8f6ea9dd962.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u043e\u0442\u0430: \u0411\u043e\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f, \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0446\u0435\u043d\u0443 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0430\u043a\u0442\u0438\u0432 \u043f\u0443\u0442\u0451\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0440\u0434\u0435\u0440\u0430. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0434\u0435\u043b\u043a\u0438 \u0431\u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0444\u0438\u0442\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 \u043f\u0430\u0434\u0430\u0435\u0442, \u0431\u043e\u0442 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443, \u0434\u043e\u043a\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043d\u0435\u0442\u044b \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u044f\u0432\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u043f\u043e \u043d\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0446\u0435\u043d\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0441 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u044e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0431\u043e\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u044b\u043d\u043e\u0447\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0438 \u0441\u043d\u0438\u0436\u0430\u044f \u0446\u0435\u043d\u0443 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0440\u044b\u043d\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0430\u043a\u0442\u0438\u0432\u0430.  <\/p>\n<p><strong>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430 \u0434\u043b\u044f api binance, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/strong><\/p>\n<p>1. Binance API &#8212; \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0442\u0432\u043e\u0435\u043c\u0443 \u0431\u043e\u0442\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445, \u043e\u0440\u0434\u0435\u0440\u0430\u0445, \u0441\u0434\u0435\u043b\u043a\u0430\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0441 \u0431\u0438\u0440\u0436\u0438.<\/p>\n<p>2. Python &#8212; \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u043b\u0430\u0434\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043c\u043e\u043b\u043e\u0447\u043d\u044b\u0445 (\u0438 \u044f \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435)  \u0444\u0440\u0438\u043b\u0430\u043d\u0441\u0435\u0440\u043e\u0432 \u043c\u044b \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Binance API.<\/p>\n<p>3. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Python &#8212; \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u044e\u0437\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Python, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a ccxt, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Binance API.<\/p>\n<p>4. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f &#8212; \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c , \u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043d\u044b \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043c\u043e\u043d\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u043e\u043a\u0443\u043f\u0438\u0442\u044c.<\/p>\n<p>5. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430\u043c\u0438 &#8212; \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0440\u0434\u0435\u0440\u0430\u043c\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044f, \u043e\u0442\u043c\u0435\u043d\u044f\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044f \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439.<\/p>\n<p><strong>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430:<\/strong><\/p>\n<p>1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 <a href=\"http:\/\/binance.com\/\" rel=\"noopener noreferrer nofollow\">binance.com<\/a>\u00a0\u0438 \u043f\u043e\u043b\u0443\u0447\u0438 API \u043a\u043b\u044e\u0447 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447. \u0415\u0441\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0440\u0438\u0441\u043a\u0438 \u0447\u0442\u043e \u0434\u043b\u044f \u0420\u0424 \u0431\u0438\u043d\u0430\u043d\u0441 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0435 \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0441\u0442\u0432\u043e \u0442\u043e \u0432 \u043f\u0443\u0442\u044c, \u0443 \u043c\u0435\u043d\u044f \u0435\u0433\u043e \u043d\u0435\u0442.<\/p>\n<p>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>ccxt<\/strong> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Binance API.<\/strong><\/p>\n<p>3. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445, \u043e\u0440\u0434\u0435\u0440\u0430\u0445 \u0438 \u0441\u0434\u0435\u043b\u043a\u0430\u0445 \u0441 \u0431\u0438\u0440\u0436\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0410\u043f\u0438<\/p>\n<p>4. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043f\u043a\u0438.<\/p>\n<p>5. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0440\u0434\u0435\u0440\u0430\u043c\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044f, \u043e\u0442\u043c\u0435\u043d\u044f\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044f \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439.<\/p>\n<p>6. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u044b &#8212; \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u043c\u044b \u0441\u0432\u0430\u0440\u0438\u043b\u0438 \u0441 \u0412\u0430\u043c\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b <strong>\u043d\u0435 \u043e\u0431\u0430\u043d\u043a\u0440\u043e\u0442\u0438\u0442\u0441\u044f.<\/strong><\/p>\n<p><strong>\u041f\u043e\u0435\u0445\u0430\u043b\u0438.<\/strong><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:  <\/p>\n<pre><code class=\"python\">import ccxt import time<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 Binance \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ccxt \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438 API:  <\/p>\n<pre><code class=\"python\">exchange = ccxt.binance({     'apiKey': '\u0412\u0430\u0448_API_KEY',     'secret': '\u0412\u0430\u0448_SECRET_KEY',     'enableRateLimit': True, })<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445, \u043e\u0440\u0434\u0435\u0440\u0430\u0445 \u0438 \u0441\u0434\u0435\u043b\u043a\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 ccxt:  <\/p>\n<pre><code class=\"python\">balance = exchange.fetch_balance() open_orders = exchange.fetch_open_orders() closed_orders = exchange.fetch_closed_orders()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043f\u043a\u0438. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430:  <\/p>\n<pre><code class=\"python\">def calculate_order(exchange, symbol, buy_price, profit_percent, amount):     ticker = exchange.fetch_ticker(symbol)     current_price = ticker['last']     if current_price >= buy_price * (1 + profit_percent \/ 100):         return None     else:         new_buy_price = (buy_price * amount + current_price * amount * 2) \/ (amount * 3)         new_amount = amount * 2         return {'symbol': symbol,                 'type': 'limit',                 'side': 'buy',                 'price': new_buy_price,                 'amount': new_amount}<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0446\u0435\u043d\u0443 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0434\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u044b \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0446\u0435\u043d\u0430 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0446\u0435\u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043d\u0430 (1 + \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u0438), \u0442\u043e \u043c\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043f\u043a\u0438. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0440\u0434\u0435\u0440\u0430 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443:  <\/p>\n<pre><code class=\"python\">symbol = 'BTC\/USDT'  # \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u043e\u0440\u0433\u043e\u0432\u0443\u044e \u043f\u0430\u0440\u0443 buy_price = 55000  # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 profit_percent = 1  # \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u0438 amount = 0.01  # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438  order = calculate_order(exchange, symbol, buy_price, profit_percent, amount)  if order:     exchange.create_order(**order) <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043c\u043e\u043d\u0435\u0442 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u043f\u0430\u0440\u0435, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0443 \u043f\u0440\u0438\u0431\u044b\u043b\u0438 \u0438 \u043e\u0431\u044a\u0435\u043c\u0443 \u043c\u043e\u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043f\u043a\u0438 \u043c\u043e\u043d\u0435\u0442, \u0442\u043e \u043c\u044b \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435:  <\/p>\n<pre><code class=\"python\">while True:     order = calculate_order(exchange, symbol, buy_price, profit_percent, amount)     if order:         exchange.create_order(**order)     time.sleep(60)  # \u0436\u0434\u0435\u043c 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0446\u0435\u043d\u044b<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0446\u0435\u043d\u0443 \u043a\u0430\u0436\u0434\u044b\u0435 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443, \u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e python \u0438 Binance API. \u041e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438.  <\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043e\u0442\u043e\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439:  <\/p>\n<pre><code class=\"json\">```json {     \"symbol\": \"BTC\/USDT\",     \"buy_price\": 55000,     \"profit_percent\": 1,     \"amount\": 0.01,     \"max_average_count\": 5,     \"telegram_token\": \"\u0422\u0412\u041e\u0419_TELEGRAM_TOKEN\",     \"telegram_chat_id\": \"\u0422\u0412\u041e\u0419 \u0427\u0410\u0422\u0418\u041a \u0418\u0414\" } ``` <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u043f\u0430\u0440\u044b, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u0438, \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u043e\u0442\u0430, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c  <\/p>\n<pre><code class=\"python\">```python import requests  def send_telegram_message(token, chat_id, message):     url = f\"https:\/\/api.telegram.org\/bot{token}\/sendMessage\"     data = {\"chat_id\": chat_id, \"text\": message}     response = requests.post(url, data=data)     return response.json() ```<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u043e\u0442\u0430 \u0438 \u0442\u043e\u043a\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e `calculate_order`, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u043b\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code class=\"python\">```python def calculate_order(exchange, symbol, buy_price, profit_percent, amount, max_average_count):     ticker = exchange.fetch_ticker(symbol)     current_price = ticker['last']     if current_price >= buy_price * (1 + profit_percent \/ 100):         return None     else:         orders = exchange.fetch_open_orders(symbol)         average_price = 0         total_amount = 0         for order in orders:             if order['side'] == 'buy':                 average_price += order['price'] * order['amount']                 total_amount += order['amount']         if total_amount >= amount * max_average_count:             return None         new_buy_price = (buy_price * total_amount + current_price * amount) \/ (total_amount + amount)         new_amount = amount         return {'symbol': symbol,                 'type': 'limit',                 'side': 'buy',                 'price': new_buy_price,                 'amount': new_amount} ```<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e \u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u043d\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e, \u0442\u043e \u043c\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0446\u0438\u043a\u043b while, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c:  <\/p>\n<pre><code class=\"python\">```python import json  with open('config.json', 'r') as f:     config = json.load(f)  symbol = config['symbol'] buy_price = config['buy_price'] profit_percent = config['profit_percent'] amount = config['amount'] max_average_count = config['max_average_count'] telegram_token = config['telegram_token'] telegram_chat_id = config['telegram_chat_id']  while True:     order = calculate_order(exchange, symbol, buy_price, profit_percent, amount, max_average_count)     if order:         exchange.create_order(**order)         message = f\"New order created:\\nSymbol: {symbol}\\nPrice: {order['price']}\\nAmount: {order['amount']}\"         send_telegram_message(telegram_token, telegram_chat_id, message)     time.sleep(60) ```<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0431\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u043d\u0435\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0440\u0434\u0435\u0440\u0430.  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043b\u044e\u0434\u0435\u0439 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044e, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u043b\u0438 \u043d\u0430 \u0431\u0438\u0440\u0436\u0430\u0445, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0438 \u0441 \u0447\u0435\u043c \u0435\u0434\u044f\u0442 \u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0435, \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0434\u043b\u044f \u0412\u0430\u0441, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0447\u0438\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u0434\u0430 \u0447\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u044b.<\/p>\n<p><strong><em>\u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0430 GitHub*\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c. \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c. \u0421\u041f\u0410\u0421\u0418\u0411\u041e!<\/em><\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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:\/\/habr.com\/ru\/articles\/737236\/\"> https:\/\/habr.com\/ru\/articles\/737236\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u043e\u0442\u0430: \u0411\u043e\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f, \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0446\u0435\u043d\u0443 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0430\u043a\u0442\u0438\u0432 \u043f\u0443\u0442\u0451\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0440\u0434\u0435\u0440\u0430. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0434\u0435\u043b\u043a\u0438 \u0431\u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0444\u0438\u0442\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 \u043f\u0430\u0434\u0430\u0435\u0442, \u0431\u043e\u0442 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443, \u0434\u043e\u043a\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043d\u0435\u0442\u044b \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u044f\u0432\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u043f\u043e \u043d\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0446\u0435\u043d\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0441 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u044e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0431\u043e\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u044b\u043d\u043e\u0447\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0438 \u0441\u043d\u0438\u0436\u0430\u044f \u0446\u0435\u043d\u0443 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0440\u044b\u043d\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0430\u043a\u0442\u0438\u0432\u0430.  <\/p>\n<p><strong>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430 \u0434\u043b\u044f api binance, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/strong><\/p>\n<p>1. Binance API &#8212; \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0442\u0432\u043e\u0435\u043c\u0443 \u0431\u043e\u0442\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445, \u043e\u0440\u0434\u0435\u0440\u0430\u0445, \u0441\u0434\u0435\u043b\u043a\u0430\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0441 \u0431\u0438\u0440\u0436\u0438.<\/p>\n<p>2. Python &#8212; \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u043b\u0430\u0434\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043c\u043e\u043b\u043e\u0447\u043d\u044b\u0445 (\u0438 \u044f \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435)  \u0444\u0440\u0438\u043b\u0430\u043d\u0441\u0435\u0440\u043e\u0432 \u043c\u044b \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Binance API.<\/p>\n<p>3. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Python &#8212; \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u044e\u0437\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Python, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a ccxt, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Binance API.<\/p>\n<p>4. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f &#8212; \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c , \u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043d\u044b \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043c\u043e\u043d\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u043e\u043a\u0443\u043f\u0438\u0442\u044c.<\/p>\n<p>5. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430\u043c\u0438 &#8212; \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0440\u0434\u0435\u0440\u0430\u043c\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044f, \u043e\u0442\u043c\u0435\u043d\u044f\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044f \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439.<\/p>\n<p><strong>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430:<\/strong><\/p>\n<p>1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 <a href=\"http:\/\/binance.com\/\" rel=\"noopener noreferrer nofollow\">binance.com<\/a>\u00a0\u0438 \u043f\u043e\u043b\u0443\u0447\u0438 API \u043a\u043b\u044e\u0447 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447. \u0415\u0441\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0440\u0438\u0441\u043a\u0438 \u0447\u0442\u043e \u0434\u043b\u044f \u0420\u0424 \u0431\u0438\u043d\u0430\u043d\u0441 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0435 \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0441\u0442\u0432\u043e \u0442\u043e \u0432 \u043f\u0443\u0442\u044c, \u0443 \u043c\u0435\u043d\u044f \u0435\u0433\u043e \u043d\u0435\u0442.<\/p>\n<p>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>ccxt<\/strong> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Binance API.<\/strong><\/p>\n<p>3. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445, \u043e\u0440\u0434\u0435\u0440\u0430\u0445 \u0438 \u0441\u0434\u0435\u043b\u043a\u0430\u0445 \u0441 \u0431\u0438\u0440\u0436\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0410\u043f\u0438<\/p>\n<p>4. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043f\u043a\u0438.<\/p>\n<p>5. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0440\u0434\u0435\u0440\u0430\u043c\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044f, \u043e\u0442\u043c\u0435\u043d\u044f\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044f \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439.<\/p>\n<p>6. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u044b &#8212; \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u043c\u044b \u0441\u0432\u0430\u0440\u0438\u043b\u0438 \u0441 \u0412\u0430\u043c\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b <strong>\u043d\u0435 \u043e\u0431\u0430\u043d\u043a\u0440\u043e\u0442\u0438\u0442\u0441\u044f.<\/strong><\/p>\n<p><strong>\u041f\u043e\u0435\u0445\u0430\u043b\u0438.<\/strong><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:  <\/p>\n<pre><code class=\"python\">import ccxt import time<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 Binance \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ccxt \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438 API:  <\/p>\n<pre><code class=\"python\">exchange = ccxt.binance({     'apiKey': '\u0412\u0430\u0448_API_KEY',     'secret': '\u0412\u0430\u0448_SECRET_KEY',     'enableRateLimit': True, })<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445, \u043e\u0440\u0434\u0435\u0440\u0430\u0445 \u0438 \u0441\u0434\u0435\u043b\u043a\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 ccxt:  <\/p>\n<pre><code class=\"python\">balance = exchange.fetch_balance() open_orders = exchange.fetch_open_orders() closed_orders = exchange.fetch_closed_orders()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043f\u043a\u0438. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430:  <\/p>\n<pre><code class=\"python\">def calculate_order(exchange, symbol, buy_price, profit_percent, amount):     ticker = exchange.fetch_ticker(symbol)     current_price = ticker['last']     if current_price >= buy_price * (1 + profit_percent \/ 100):         return None     else:         new_buy_price = (buy_price * amount + current_price * amount * 2) \/ (amount * 3)         new_amount = amount * 2         return {'symbol': symbol,                 'type': 'limit',                 'side': 'buy',                 'price': new_buy_price,                 'amount': new_amount}<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0446\u0435\u043d\u0443 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0434\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u044b \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0446\u0435\u043d\u0430 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0446\u0435\u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043d\u0430 (1 + \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u0438), \u0442\u043e \u043c\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043f\u043a\u0438. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0440\u0434\u0435\u0440\u0430 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443:  <\/p>\n<pre><code class=\"python\">symbol = 'BTC\/USDT'  # \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u043e\u0440\u0433\u043e\u0432\u0443\u044e \u043f\u0430\u0440\u0443 buy_price = 55000  # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 profit_percent = 1  # \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u0438 amount = 0.01  # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438  order = calculate_order(exchange, symbol, buy_price, profit_percent, amount)  if order:     exchange.create_order(**order) <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043c\u043e\u043d\u0435\u0442 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u043f\u0430\u0440\u0435, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0443 \u043f\u0440\u0438\u0431\u044b\u043b\u0438 \u0438 \u043e\u0431\u044a\u0435\u043c\u0443 \u043c\u043e\u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043f\u043a\u0438 \u043c\u043e\u043d\u0435\u0442, \u0442\u043e \u043c\u044b \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435:  <\/p>\n<pre><code class=\"python\">while True:     order = calculate_order(exchange, symbol, buy_price, profit_percent, amount)     if order:         exchange.create_order(**order)     time.sleep(60)  # \u0436\u0434\u0435\u043c 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0446\u0435\u043d\u044b<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0446\u0435\u043d\u0443 \u043a\u0430\u0436\u0434\u044b\u0435 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043e\u0440\u0434\u0435\u0440 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443, \u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e python \u0438 Binance API. \u041e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438.  <\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043e\u0442\u043e\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439:  <\/p>\n<pre><code class=\"json\">```json {     \"symbol\": \"BTC\/USDT\",     \"buy_price\": 55000,     \"profit_percent\": 1,     \"amount\": 0.01,     \"max_average_count\": 5,     \"telegram_token\": \"\u0422\u0412\u041e\u0419_TELEGRAM_TOKEN\",     \"telegram_chat_id\": \"\u0422\u0412\u041e\u0419 \u0427\u0410\u0422\u0418\u041a \u0418\u0414\" } ``` <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u043f\u0430\u0440\u044b, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u0438, \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u043e\u0442\u0430, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c  <\/p>\n<pre><code class=\"python\">```python import requests  def send_telegram_message(token, chat_id, message):     url = f\"https:\/\/api.telegram.org\/bot{token}\/sendMessage\"     data = {\"chat_id\": chat_id, \"text\": message}     response = requests.post(url, data=data)     return response.json() ```<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u043e\u0442\u0430 \u0438 \u0442\u043e\u043a\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e `calculate_order`, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u043b\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code class=\"python\">```python def calculate_order(exchange, symbol, buy_price, profit_percent, amount, max_average_count):     ticker = exchange.fetch_ticker(symbol)     current_price = ticker['last']     if current_price >= buy_price * (1 + profit_percent \/ 100):         return None     else:         orders = exchange.fetch_open_orders(symbol)         average_price = 0         total_amount = 0         for order in orders:             if order['side'] == 'buy':                 average_price += order['price'] * order['amount']                 total_amount += order['amount']         if total_amount >= amount * max_average_count:             return None         new_buy_price = (buy_price * total_amount + current_price * amount) \/ (total_amount + amount)         new_amount = amount         return {'symbol': symbol,                 'type': 'limit',                 'side': 'buy',                 'price': new_buy_price,                 'amount': new_amount} ```<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e \u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u043d\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e, \u0442\u043e \u043c\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043c \u043c\u043e\u043d\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0446\u0438\u043a\u043b while, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c:  <\/p>\n<pre><code class=\"python\">```python import json  with open('config.json', 'r') as f:     config = json.load(f)  symbol = config['symbol'] buy_price = config['buy_price'] profit_percent = config['profit_percent'] amount = config['amount'] max_average_count = config['max_average_count'] telegram_token = config['telegram_token'] telegram_chat_id = config['telegram_chat_id']  while True:     order = calculate_order(exchange, symbol, buy_price, profit_percent, amount, max_average_count)     if order:         exchange.create_order(**order)         message = f\"New order created:\\nSymbol: {symbol}\\nPrice: {order['price']}\\nAmount: {order['amount']}\"         send_telegram_message(telegram_token, telegram_chat_id, message)     time.sleep(60) ```<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0431\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u043d\u0435\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0440\u0434\u0435\u0440\u0430.  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043b\u044e\u0434\u0435\u0439 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044e, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u043b\u0438 \u043d\u0430 \u0431\u0438\u0440\u0436\u0430\u0445, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0438 \u0441 \u0447\u0435\u043c \u0435\u0434\u044f\u0442 \u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0435, \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0434\u043b\u044f \u0412\u0430\u0441, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0447\u0438\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u0434\u0430 \u0447\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u044b.<\/p>\n<p><strong><em>\u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0430 GitHub*\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c. \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c. \u0421\u041f\u0410\u0421\u0418\u0411\u041e!<\/em><\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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:\/\/habr.com\/ru\/articles\/737236\/\"> https:\/\/habr.com\/ru\/articles\/737236\/<\/a><br \/><\/br><\/br><\/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-405411","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/405411","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=405411"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/405411\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=405411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=405411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=405411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}