{"id":465810,"date":"2025-07-03T09:23:16","date_gmt":"2025-07-03T09:23:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=465810"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=465810","title":{"rendered":"<span>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 okama<\/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<p>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u043c. \u041f\u043e \u043c\u0435\u0440\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043d \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432\u0430\u0448 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>okama<\/code> \u0434\u043b\u044f Python.<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430?<\/h3>\n<p>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u0441\u0435 \u0430\u043a\u0442\u0438\u0432\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u0441\u0432\u043e\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c (\u0446\u0435\u043b\u0435\u0432\u044b\u043c) \u0432\u0435\u0441\u0430\u043c.<\/p>\n<p><code>okama<\/code> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f. \u042d\u0442\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0442\u0438\u043f\u0430:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430<\/h4>\n<p>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e, \u0435\u0436\u0435\u043a\u0432\u0430\u0440\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p>\u0412 \u043e\u043a\u0430\u043c\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>&#8216;month&#8217; (\u043c\u0435\u0441\u044f\u0446)<\/p>\n<\/li>\n<li>\n<p>&#8216;quarter&#8217; (\u043a\u0432\u0430\u0440\u0442\u0430\u043b)<\/p>\n<\/li>\n<li>\n<p>&#8216;half-year&#8217; (\u043f\u043e\u043b\u0433\u043e\u0434\u0430)<\/p>\n<\/li>\n<li>\n<p>&#8216;year&#8217; (\u0433\u043e\u0434)<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e (rebalancing bands)<\/h4>\n<p>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h3>1. \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 (\u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u0430\u0445) \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>\u0424\u043e\u0440\u043c\u0443\u043b\u0430<\/strong>:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"\\texttt{\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435} = \\texttt{\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441} - \\texttt{\u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0441}\" alt=\"\\texttt{\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435} = \\texttt{\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441} - \\texttt{\u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0441}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/ec\/ec1\/ec181615e1d141bdb0049e58f022aa9c.svg\" width=\"auto\" height=\"auto\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/ec\/ec1\/ec181615e1d141bdb0049e58f022aa9c.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/ec\/ec1\/ec181615e1d141bdb0049e58f022aa9c.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u0426\u0435\u043b\u044c: 40% \u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441: 45% \u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/strong>: +5% (45% &#8212; 40%)<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>\u2714 \u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u0435\u0441\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 60\/40 \u0430\u043a\u0446\u0438\u0438\/\u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u0438)<\/p>\n<hr\/>\n<h3>2. \u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 <strong>\u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445 \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0432\u0435\u0441\u0430<\/strong>.<\/p>\n<p><strong>\u0424\u043e\u0440\u043c\u0443\u043b\u0430<\/strong>:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"\\texttt{\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435} = \\frac{\\texttt{\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441 - \u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0441}}{\\texttt{\u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0441}} \\times 100\\%\" alt=\"\\texttt{\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435} = \\frac{\\texttt{\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441 - \u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0441}}{\\texttt{\u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0441}} \\times 100\\%\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/87\/87d\/87db6a954455225d71c98180e9ede2b3.svg\" width=\"auto\" height=\"auto\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/87\/87d\/87db6a954455225d71c98180e9ede2b3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/87\/87d\/87db6a954455225d71c98180e9ede2b3.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u0426\u0435\u043b\u044c: 10% \u0437\u043e\u043b\u043e\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441: 12% \u0437\u043e\u043b\u043e\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/strong>: +20% ( 12%-10% \/ 10% )<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>\u2714 \u041b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f <strong>\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u043e\u043b\u0435\u0439<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 2% \u043f\u0440\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u0432\u0435\u0441\u0435 10% = 20% \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f)<\/p>\n<hr\/>\n<h3>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0426\u0435\u043b\u044c 50%, \u0422\u0435\u043a\u0443\u0449\u0438\u0439 55%<\/p>\n<\/td>\n<td>\n<p align=\"left\">+5%<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>+10%<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0426\u0435\u043b\u044c 10%, \u0422\u0435\u043a\u0443\u0449\u0438\u0439 12%<\/p>\n<\/td>\n<td>\n<p align=\"left\">+2%<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>+20%<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0411\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 (&#171;\u041a\u0443\u043f\u0438 \u0438 \u0434\u0435\u0440\u0436\u0438&#187;)<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443, \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Okama?<\/h3>\n<p>Okama \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438<\/p>\n<ul>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 (\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435, \u043b\u043e\u0433\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435, \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u0438 \u0442.\u043f.)<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0413\u0440\u0430\u043d\u0438\u0446\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0432\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c CFA<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0440\u0436 \u043c\u0438\u0440\u0430, \u0432\u0430\u043b\u044e\u0442, \u043c\u0430\u043a\u0440\u043e\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Okama \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/okama\/articles\/798007\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<hr\/>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435&#8230;<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Okama \u0447\u0435\u0440\u0435\u0437 pip:<\/p>\n<pre><code class=\"python\">pip install okama <\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">import warnings  warnings.filterwarnings(\"ignore\")  import matplotlib.pyplot as plt  import okama as ok <\/code><\/pre>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/h3>\n<p>\u041a\u043b\u0430\u0441\u0441 <code>Rebalance<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<br \/> \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f (\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">#  \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c 1 \u0433\u043e\u0434 reb_calendar = ok.Rebalance(period=\"year\")   <\/code><\/pre>\n<p>Okama \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u043c\u0438 \u0440\u044f\u0434\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0438\u043e\u0434 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0440\u0430\u0432\u0435\u043d \u043c\u0435\u0441\u044f\u0446\u0443, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u041c\u0430\u0440\u043a\u043e\u0432\u0438\u0446\u0430 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0441\u0430 \u043d\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"python\">reb_calendar_month = ok.Rebalance(     period=\"month\",      abs_deviation=None,     rel_deviation=None     ) <\/code><\/pre>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c 5%:<\/p>\n<pre><code class=\"python\">reb_bands_abs = ok.Rebalance(abs_deviation=0.05)   <\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0441 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c 10%:<\/p>\n<pre><code class=\"python\">reb_bands_rel = ok.Rebalance(rel_deviation=0.10)   <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"python\">reb = ok.Rebalance(period=\"half-year\", abs_deviation=0.15, rel_deviation=0.10) reb <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>period           half-year abs_deviation      0.15000 rel_deviation      0.10000 dtype: object <\/code><\/pre>\n<p>\u0412 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437 \u0432 \u0433\u043e\u0434). \u041d\u043e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0432 \u0432\u0435\u0441\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"python\">no_reb = ok.Rebalance(period=\"none\") no_reb <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>period           none abs_deviation    None rel_deviation    None dtype: object <\/code><\/pre>\n<h3>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 Portfolio<\/h3>\n<p>\u0412\u0441\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>Portfolio<\/code> okama \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 okama \u0432\u0441\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u0430 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043c\u0435\u0441\u044f\u0446\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u0435\u0441\u044f\u0446 \u0433\u043e\u0434\u0430 \u0438 \u0442. \u0434.).<\/p>\n<h4>\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c 60\/40<\/h4>\n<p>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 &#171;\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c&#187;? \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0440\u0438\u0441\u043a\u043e\u0432, \u0432 &#171;\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u043c&#187; \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c 60\/40 \u0441 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 ETF-\u0444\u043e\u043d\u0434\u0430\u043c\u0438 \u0430\u043a\u0446\u0438\u0439 \u0438 \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 (\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0432\u0435\u0441\u0430).<\/p>\n<pre><code class=\"python\">target_weights = [0.60, 0.40] pf2 = ok.Portfolio(     [\"AGG.US\", \"SPY.US\"],     weights=target_weights,     last_date=\"2025-06\",     ccy=\"USD\",     rebalancing_strategy=reb_calendar_month,  # \u0432\u0435\u0441\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b      inflation=False,)  pf2 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                        portfolio_8100.PF assets                         [AGG.US, SPY.US] weights                              [0.6, 0.4] rebalancing_period                         month rebalancing_abs_deviation                  None rebalancing_rel_deviation                  None currency                                    USD inflation                                  None first_date                              2003-10 last_date                               2025-06 period_length                21 years, 9 months dtype: object <\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Portfolio.weights_ts<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u0432\u0435\u0441\u0430 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0433\u043b\u0443\u0431\u0438\u043d\u043e\u0439 21 \u0433\u043e\u0434.<\/p>\n<pre><code class=\"python\">weights_no_rebalancing = pf2.weights_ts weights_no_rebalancing.plot(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/575\/058\/af8\/575058af8a90753d489a856716c99d6d.png\" alt=\"\u0412\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/575\/058\/af8\/575058af8a90753d489a856716c99d6d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/575\/058\/af8\/575058af8a90753d489a856716c99d6d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f (Modern Portfolio Theory) \u041c\u0430\u0440\u043a\u043e\u0432\u0438\u0446\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u2014 \u043a\u043e\u0433\u0434\u0430 \u0432\u0435\u0441\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 (\u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438).<\/p>\n<pre><code class=\"python\"># \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 pf2.rebalancing_strategy = no_reb # \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432\u0435\u0441\u043e\u0432 pf2.weights_ts.plot(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/72e\/70d\/73a\/72e70d73a478463f9b61c06e3eb02b0d.png\" alt=\"\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u044f\u0434 \u0432\u0435\u0441\u043e\u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f 60\/40 \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/72e\/70d\/73a\/72e70d73a478463f9b61c06e3eb02b0d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/72e\/70d\/73a\/72e70d73a478463f9b61c06e3eb02b0d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u044f\u0434 \u0432\u0435\u0441\u043e\u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f 60\/40 \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043a\u043e\u043d\u0441\u0435\u0440\u0432\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0441\u0442\u0430\u043b \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u044b\u043c \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u0434\u043e\u043b\u0438 \u0430\u043a\u0446\u0438\u0439.<\/p>\n<pre><code class=\"python\">abs(pf2.weights_ts - target_weights)[\"SPY.US\"].max() <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>np.float64(0.36386072210732423) <\/code><\/pre>\n<p>\u0412\u0435\u0441\u0430 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 36%. \u0422\u0430\u043a\u043e\u0435 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u0438\u0437 \u0438\u043d\u0432\u0435\u0441\u0442\u043e\u0440\u043e\u0432. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u044d\u0442\u043e &#171;\u0432\u044b\u043b\u0435\u0447\u0438\u0442\u044c&#187; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u043d\u0430 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0443\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 1 \u0433\u043e\u0434.<\/p>\n<pre><code class=\"python\">pf2.rebalancing_strategy = reb_calendar pf2 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                        portfolio_8100.PF assets                         [AGG.US, SPY.US] weights                              [0.6, 0.4] rebalancing_period                         year rebalancing_abs_deviation                  None rebalancing_rel_deviation                  None currency                                    USD inflation                                  None first_date                              2003-10 last_date                               2025-06 period_length                21 years, 9 months dtype: object <\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Portfolio.rebalancing_events<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">ev = pf2.rebalancing_events ev <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2003-12    calendar 2004-12    calendar 2005-12    calendar 2006-12    calendar 2007-12    calendar 2008-12    calendar 2009-12    calendar 2010-12    calendar 2011-12    calendar 2012-12    calendar 2013-12    calendar 2014-12    calendar 2015-12    calendar 2016-12    calendar 2017-12    calendar 2018-12    calendar 2019-12    calendar 2020-12    calendar 2021-12    calendar 2022-12    calendar 2023-12    calendar 2024-12    calendar Freq: M, dtype: object <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u044b\u043b\u043e 22 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"python\">ev.shape  <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>(22,) <\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432\u0441\u0435\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430:<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(12, 6)) ax = plt.gca() pf2.weights_ts.plot(ax=ax) ax.vlines(x=ev[ev == \"calendar\"].index, ymin=0, ymax=1, colors=\"blue\", ls=\"--\", lw=1, label=\"\u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438\") ax.set_ylim([0, 1]) ax.legend(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/980\/c4b\/0ef\/980c4b0ef21a0f24c6a9e8b4d61fc440.png\" alt=\"60\/40 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043f\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/980\/c4b\/0ef\/980c4b0ef21a0f24c6a9e8b4d61fc440.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/980\/c4b\/0ef\/980c4b0ef21a0f24c6a9e8b4d61fc440.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>60\/40 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043f\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 5 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439 \u0432\u0435\u0441\u043e\u0432:<\/p>\n<pre><code class=\"python\">abs(pf2.weights_ts - target_weights)[\"SPY.US\"].nlargest(n=5) <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2008-12   0.11913 2008-11   0.10794 2008-10   0.08644 2013-12   0.07366 2021-12   0.06630 Freq: M, Name: SPY.US, dtype: float64 <\/code><\/pre>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 2008 \u0433\u043e\u0434\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0438\u0437\u0438\u0441\u0430 \u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e \u043f\u043e\u0447\u0442\u0438 12%. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c 5%:<\/p>\n<pre><code class=\"python\">pf2.rebalancing_strategy = reb_bands_abs pf2 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                        portfolio_8100.PF assets                         [AGG.US, SPY.US] weights                              [0.6, 0.4] rebalancing_period                         none rebalancing_abs_deviation               0.05000 rebalancing_rel_deviation                  None currency                                    USD inflation                                  None first_date                              2003-10 last_date                               2025-06 period_length                21 years, 9 months dtype: object <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 13.<\/p>\n<pre><code>ev = pf2.rebalancing_events ev <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2005-11    abs 2008-10    abs 2009-01    abs 2009-09    abs 2011-04    abs 2011-09    abs 2012-03    abs 2013-10    abs 2016-11    abs 2018-01    abs 2021-02    abs 2021-12    abs 2024-03    abs Freq: M, dtype: object <\/code><\/pre>\n<pre><code class=\"python\">ev.shape <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>(13,) <\/code><\/pre>\n<p>\u0417\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e 13 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043e\u043a \u2014 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c 22, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043f\u0440\u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0441\u0445\u043e\u0434\u044b (\u0431\u0440\u043e\u043a\u0435\u0440\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438, \u043d\u0430\u043b\u043e\u0433\u0438). \u0421\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044e&#8230;<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(12, 6)) ax = plt.gca() pf2.weights_ts.plot(ax=ax) ax.vlines(x=ev[ev == \"abs\"].index, ymin=0, ymax=1, colors=\"blue\", ls=\"--\", lw=1, label=\"Rebalancing events\") ax.set_ylim([0, 1]) ax.legend(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c08\/bb7\/05f\/c08bb705f214d81a223877a627b0ed3d.png\" alt=\"60\/40 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0438 5% abs\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/c08\/bb7\/05f\/c08bb705f214d81a223877a627b0ed3d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c08\/bb7\/05f\/c08bb705f214d81a223877a627b0ed3d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>60\/40 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0438 5% abs<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"python\">abs(pf2.weights_ts - target_weights)[\"SPY.US\"].nlargest(n=5) <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2008-10   0.06851 2018-01   0.06004 2021-12   0.05638 2013-10   0.05638 2024-03   0.05448 Freq: M, Name: SPY.US, dtype: float64 <\/code><\/pre>\n<p>\u041e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u043e\u0432 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0441\u043d\u0438\u0437\u0438\u043b\u043e\u0441\u044c \u0434\u043e 6,9% \u2014 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u0440\u0438 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0435.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 5-\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e okama \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435). \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u044f\u0446\u0430 \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u043b\u0438\u043c\u0438\u0442\u043e\u0432.<\/p>\n<h4>\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c<\/h4>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443 \u0436\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u0430 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d \u0430\u043a\u0442\u0438\u0432 (\u0437\u043e\u043b\u043e\u0442\u043e) \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0435\u0433\u043e 5% \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\"># \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u0432\u0435\u0441\u0430 \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u043e\u0432 target_weights3 = [0.60, 0.35, 0.05] # \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 rs3 = ok.Rebalance(     period=\"none\",      abs_deviation=0.10,      rel_deviation=None     )  # \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0441 3 \u0430\u043a\u0442\u0438\u0432\u0430\u043c\u0438 pf3 = ok.Portfolio(     [\"SP500TR.INDX\", \"VBMFX.US\", \"GC.COMM\"],     weights=target_weights3,     ccy=\"USD\",     rebalancing_strategy=rs3,     inflation=False,)  pf3 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                                       portfolio_1335.PF assets                       [SP500TR.INDX, VBMFX.US, GC.COMM] weights                                      [0.6, 0.35, 0.05] rebalancing_period                                        none rebalancing_abs_deviation                              0.10000 rebalancing_rel_deviation                                 None currency                                                   USD inflation                                                 None first_date                                             1988-02 last_date                                              2025-06 period_length                               37 years, 5 months dtype: object <\/code><\/pre>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u043e 8 \u0440\u0430\u0437.<\/p>\n<pre><code class=\"python\">ev3 = pf3.rebalancing_events ev3 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>1995-07    abs 1997-07    abs 2002-09    abs 2007-01    abs 2008-10    abs 2013-12    abs 2018-08    abs 2023-06    abs Freq: M, dtype: object <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435.<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(12, 6)) ax = plt.gca() pf3.weights_ts.plot(ax=ax) ax.vlines(x=ev3.index, ymin=0, ymax=1, colors=\"blue\", ls=\"--\", lw=1, label=\"Rebalancing by abs\") ax.set_ylim([0, 1]) ax.legend(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/805\/1a5\/66a\/8051a566a9e3be5b46a35449000deb21.png\" alt=\"\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c\u0443 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044e\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/805\/1a5\/66a\/8051a566a9e3be5b46a35449000deb21.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/805\/1a5\/66a\/8051a566a9e3be5b46a35449000deb21.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c\u0443 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044e<\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u044b\u043b\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u043e\u043b\u043e\u0442\u0430 \u0431\u044b\u043b\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 4,3%, \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0434\u0432\u043e\u0435 (!) \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0432\u0435\u0441\u0430 \u0434\u043b\u044f \u0437\u043e\u043b\u043e\u0442\u0430.<\/p>\n<pre><code class=\"python\">abs(pf3.weights_ts - target_weights3).max() <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>Symbols SP500TR.INDX   0.10438 VBMFX.US       0.10640 GC.COMM        0.04257 dtype: float64 <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u043e\u043b\u043e\u0442\u0430.<\/p>\n<pre><code class=\"python\">pf3.rebalancing_strategy = ok.Rebalance(     period=\"none\",      abs_deviation=0.10,      rel_deviation=0.30  # \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 30% )    <\/code><\/pre>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043e\u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e 14.<\/p>\n<pre><code class=\"python\">ev3 = pf3.rebalancing_events ev3.shape <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>(14,) <\/code><\/pre>\n<pre><code class=\"python\">ev3 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>1989-05    rel 1992-04    rel 1996-06    rel 1997-07    rel 1999-01    rel 2002-07    abs 2006-01    rel 2008-01    rel 2008-12    abs 2011-07    rel 2013-06    rel 2017-10    abs 2021-08    abs 2025-03    rel Freq: M, dtype: object <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 10 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043e\u043a \u043f\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u0438 \u0442\u043e\u043b\u044c\u043a\u043e 4 \u043f\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c\u0443.<\/p>\n<p>\u041d\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0437\u0435\u043b\u0435\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c.<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(12, 6)) ax = plt.gca() pf3.weights_ts.plot(ax=ax) ax.vlines(x=ev3[ev3 == \"abs\"].index, ymin=0, ymax=1, colors=\"blue\", ls=\"--\", lw=1, label=\"Rebalancing by abs\") ax.vlines(x=ev3[ev3 == \"rel\"].index, ymin=0, ymax=1, colors=\"green\", ls=\"--\", lw=1, label=\"Rebalancing by rel\") ax.set_ylim([0, 1]) ax.legend(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/163\/293\/8cf\/1632938cfad3946f5399b003f8b3d6c1.png\" alt=\"\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c\u0443 \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044e\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/163\/293\/8cf\/1632938cfad3946f5399b003f8b3d6c1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/163\/293\/8cf\/1632938cfad3946f5399b003f8b3d6c1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c\u0443 \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044e<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0437\u043e\u043b\u043e\u0442\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 2,2%. \u0418 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0443\u0447\u0448\u0435.<\/p>\n<pre><code class=\"python\">abs(pf3.weights_ts - target_weights3).max() <\/code><\/pre>\n<pre><code>Symbols SP500TR.INDX   0.11944 VBMFX.US       0.11290 GC.COMM        0.02217 dtype: float64 <\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0443\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0435\u0441\u043e\u0432. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0432\u0435\u0441\u0442\u043e\u0440\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442 \u0441\u0432\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437 \u0432 \u0433\u043e\u0434 (\u0438\u043b\u0438 \u0440\u0430\u0437 \u0432 \u043f\u043e\u043b\u0433\u043e\u0434\u0430).<\/p>\n<pre><code class=\"python\">pf3.rebalancing_strategy = ok.Rebalance(     period=\"year\",      abs_deviation=0.10,      rel_deviation=0.20 ) <\/code><\/pre>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0430 2.<\/p>\n<pre><code class=\"python\">ev3 = pf3.rebalancing_events ev3.shape <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>(16,) <\/code><\/pre>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0435\u043a\u0430\u0431\u0440\u0435.<\/p>\n<pre><code class=\"python\">ev3 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>1989-12    rel 1991-12    rel 1995-12    rel 1997-12    rel 1999-12    rel 2001-12    rel 2002-12    rel 2006-12    rel 2007-12    rel 2008-12    abs 2011-12    rel 2013-12    abs 2015-12    rel 2019-12    rel 2021-12    rel 2024-12    rel Freq: M, dtype: object <\/code><\/pre>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435 \u0441\u0435\u0431\u044f \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f\u0445, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f <code>rel_deviation<\/code>.<\/p>\n<pre><code class=\"python\">ev3[ev3 == \"rel\"].count() <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<p>np.int64(14)<\/p>\n<pre><code class=\"python\">ev3[ev3 == \"abs\"].count() <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>np.int64(2) <\/code><\/pre>\n<pre><code class=\"python\">fig = plt.figure(figsize=(12, 6)) ax = plt.gca() pf3.weights_ts.plot(ax=ax) ax.vlines(x=ev3[ev3 == \"abs\"].index, ymin=0, ymax=1, colors=\"blue\", ls=\"--\", lw=1, label=\"Rebalancing by abs\") ax.vlines(x=ev3[ev3 == \"rel\"].index, ymin=0, ymax=1, colors=\"green\", ls=\"--\", lw=1, label=\"Rebalancing by rel\") ax.set_ylim([0, 1]) ax.legend(); <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c76\/00f\/993\/c7600f9931180f10914e566e4233657c.png\" alt=\"\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/c76\/00f\/993\/c7600f9931180f10914e566e4233657c.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c76\/00f\/993\/c7600f9931180f10914e566e4233657c.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0438\u0437 3 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0441 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u0432 \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0418 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c.<\/p>\n<pre><code class=\"python\">abs(pf3.weights_ts - target_weights3).max() <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>Symbols SP500TR.INDX   0.12670 VBMFX.US       0.11787 GC.COMM        0.02512 dtype: float64 <\/code><\/pre>\n<hr\/>\n<p>\u0414\u043b\u044f \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f &#171;\u0440\u0443\u043a\u0430\u043c\u0438&#187; \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u043c\u0438 (\u0433\u043e\u0434 \u0438\u043b\u0438 \u043f\u043e\u043b\u0433\u043e\u0434\u0430) \u0443\u0434\u043e\u0431\u0435\u043d, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439 \u0432\u0435\u0441\u043e\u0432. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438.<\/p>\n<p>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u0430, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043e\u043d\u0443\u0441 \u043e\u0442 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 <strong>\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u0438<\/strong>.<\/p>\n<h3>\u0411\u043e\u043d\u0443\u0441 \u0437\u0430 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443: \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430\u044f \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/rostsber.ru\/publish\/stocks\/rebalancing.html\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u0423\u0438\u043b\u044c\u044f\u043c\u0430 \u0411\u0435\u0440\u043d\u0441\u0442\u0430\u0439\u043d\u0430<\/a>, \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0438\u0441\u043a, \u043d\u043e \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u044c. \u042d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u043a\u0442\u0438\u0432\u044b \u0441 \u043d\u0438\u0437\u043a\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0435\u0439. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 okama \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u044c \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0430\u043a\u0442\u0438\u0432\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430, \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445&#8230; \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/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\/922384\/\"> https:\/\/habr.com\/ru\/articles\/922384\/<\/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<p>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u043c. \u041f\u043e \u043c\u0435\u0440\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043d \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432\u0430\u0448 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>okama<\/code> \u0434\u043b\u044f Python.<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430?<\/h3>\n<p>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u0441\u0435 \u0430\u043a\u0442\u0438\u0432\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u0441\u0432\u043e\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c (\u0446\u0435\u043b\u0435\u0432\u044b\u043c) \u0432\u0435\u0441\u0430\u043c.<\/p>\n<p><code>okama<\/code> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f. \u042d\u0442\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0442\u0438\u043f\u0430:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430<\/h4>\n<p>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0430\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e, \u0435\u0436\u0435\u043a\u0432\u0430\u0440\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p>\u0412 \u043e\u043a\u0430\u043c\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>&#8216;month&#8217; (\u043c\u0435\u0441\u044f\u0446)<\/p>\n<\/li>\n<li>\n<p>&#8216;quarter&#8217; (\u043a\u0432\u0430\u0440\u0442\u0430\u043b)<\/p>\n<\/li>\n<li>\n<p>&#8216;half-year&#8217; (\u043f\u043e\u043b\u0433\u043e\u0434\u0430)<\/p>\n<\/li>\n<li>\n<p>&#8216;year&#8217; (\u0433\u043e\u0434)<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e (rebalancing bands)<\/h4>\n<p>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h3>1. \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 (\u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u0430\u0445) \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>\u0424\u043e\u0440\u043c\u0443\u043b\u0430<\/strong>:<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u0426\u0435\u043b\u044c: 40% \u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441: 45% \u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/strong>: +5% (45% &#8212; 40%)<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>\u2714 \u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u0435\u0441\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 60\/40 \u0430\u043a\u0446\u0438\u0438\/\u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u0438)<\/p>\n<hr\/>\n<h3>2. \u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 <strong>\u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445 \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0432\u0435\u0441\u0430<\/strong>.<\/p>\n<p><strong>\u0424\u043e\u0440\u043c\u0443\u043b\u0430<\/strong>:<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u0426\u0435\u043b\u044c: 10% \u0437\u043e\u043b\u043e\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0435\u0441: 12% \u0437\u043e\u043b\u043e\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/strong>: +20% ( 12%-10% \/ 10% )<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>\u2714 \u041b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f <strong>\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u043e\u043b\u0435\u0439<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 2% \u043f\u0440\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u0432\u0435\u0441\u0435 10% = 20% \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f)<\/p>\n<hr\/>\n<h3>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0426\u0435\u043b\u044c 50%, \u0422\u0435\u043a\u0443\u0449\u0438\u0439 55%<\/p>\n<\/td>\n<td>\n<p align=\"left\">+5%<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>+10%<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0426\u0435\u043b\u044c 10%, \u0422\u0435\u043a\u0443\u0449\u0438\u0439 12%<\/p>\n<\/td>\n<td>\n<p align=\"left\">+2%<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>+20%<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0411\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 (&#171;\u041a\u0443\u043f\u0438 \u0438 \u0434\u0435\u0440\u0436\u0438&#187;)<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443, \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Okama?<\/h3>\n<p>Okama \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438<\/p>\n<ul>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 (\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435, \u043b\u043e\u0433\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435, \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u0438 \u0442.\u043f.)<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0413\u0440\u0430\u043d\u0438\u0446\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0432\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c CFA<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0440\u0436 \u043c\u0438\u0440\u0430, \u0432\u0430\u043b\u044e\u0442, \u043c\u0430\u043a\u0440\u043e\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Okama \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/okama\/articles\/798007\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<hr\/>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435&#8230;<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Okama \u0447\u0435\u0440\u0435\u0437 pip:<\/p>\n<pre><code class=\"python\">pip install okama <\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">import warnings  warnings.filterwarnings(\"ignore\")  import matplotlib.pyplot as plt  import okama as ok <\/code><\/pre>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/h3>\n<p>\u041a\u043b\u0430\u0441\u0441 <code>Rebalance<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<br \/> \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f (\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">#  \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c 1 \u0433\u043e\u0434 reb_calendar = ok.Rebalance(period=\"year\")   <\/code><\/pre>\n<p>Okama \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u043c\u0438 \u0440\u044f\u0434\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0438\u043e\u0434 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0440\u0430\u0432\u0435\u043d \u043c\u0435\u0441\u044f\u0446\u0443, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u041c\u0430\u0440\u043a\u043e\u0432\u0438\u0446\u0430 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0441\u0430 \u043d\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"python\">reb_calendar_month = ok.Rebalance(     period=\"month\",      abs_deviation=None,     rel_deviation=None     ) <\/code><\/pre>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c 5%:<\/p>\n<pre><code class=\"python\">reb_bands_abs = ok.Rebalance(abs_deviation=0.05)   <\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0441 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c 10%:<\/p>\n<pre><code class=\"python\">reb_bands_rel = ok.Rebalance(rel_deviation=0.10)   <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"python\">reb = ok.Rebalance(period=\"half-year\", abs_deviation=0.15, rel_deviation=0.10) reb <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>period           half-year abs_deviation      0.15000 rel_deviation      0.10000 dtype: object <\/code><\/pre>\n<p>\u0412 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437 \u0432 \u0433\u043e\u0434). \u041d\u043e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0432 \u0432\u0435\u0441\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"python\">no_reb = ok.Rebalance(period=\"none\") no_reb <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>period           none abs_deviation    None rel_deviation    None dtype: object <\/code><\/pre>\n<h3>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 Portfolio<\/h3>\n<p>\u0412\u0441\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>Portfolio<\/code> okama \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 okama \u0432\u0441\u0435 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u0430 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043c\u0435\u0441\u044f\u0446\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u0435\u0441\u044f\u0446 \u0433\u043e\u0434\u0430 \u0438 \u0442. \u0434.).<\/p>\n<h4>\u041f\u043e\u0440\u0442\u0444\u0435\u043b\u044c 60\/40<\/h4>\n<p>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 &#171;\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c&#187;? \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0440\u0438\u0441\u043a\u043e\u0432, \u0432 &#171;\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u043c&#187; \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c 60\/40 \u0441 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u043e\u0431\u043b\u0438\u0433\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 ETF-\u0444\u043e\u043d\u0434\u0430\u043c\u0438 \u0430\u043a\u0446\u0438\u0439 \u0438 \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 (\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0432\u0435\u0441\u0430).<\/p>\n<pre><code class=\"python\">target_weights = [0.60, 0.40] pf2 = ok.Portfolio(     [\"AGG.US\", \"SPY.US\"],     weights=target_weights,     last_date=\"2025-06\",     ccy=\"USD\",     rebalancing_strategy=reb_calendar_month,  # \u0432\u0435\u0441\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b      inflation=False,)  pf2 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                        portfolio_8100.PF assets                         [AGG.US, SPY.US] weights                              [0.6, 0.4] rebalancing_period                         month rebalancing_abs_deviation                  None rebalancing_rel_deviation                  None currency                                    USD inflation                                  None first_date                              2003-10 last_date                               2025-06 period_length                21 years, 9 months dtype: object <\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Portfolio.weights_ts<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u0432\u0435\u0441\u0430 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0433\u043b\u0443\u0431\u0438\u043d\u043e\u0439 21 \u0433\u043e\u0434.<\/p>\n<pre><code class=\"python\">weights_no_rebalancing = pf2.weights_ts weights_no_rebalancing.plot(); <\/code><\/pre>\n<figure class=\"\">\n<div><figcaption>\u0412\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f (Modern Portfolio Theory) \u041c\u0430\u0440\u043a\u043e\u0432\u0438\u0446\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u2014 \u043a\u043e\u0433\u0434\u0430 \u0432\u0435\u0441\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 (\u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438).<\/p>\n<pre><code class=\"python\"># \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 pf2.rebalancing_strategy = no_reb # \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432\u0435\u0441\u043e\u0432 pf2.weights_ts.plot(); <\/code><\/pre>\n<figure class=\"\">\n<div><figcaption>\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u044f\u0434 \u0432\u0435\u0441\u043e\u0432 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f 60\/40 \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043a\u043e\u043d\u0441\u0435\u0440\u0432\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044c \u0441\u0442\u0430\u043b \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u044b\u043c \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u0434\u043e\u043b\u0438 \u0430\u043a\u0446\u0438\u0439.<\/p>\n<pre><code class=\"python\">abs(pf2.weights_ts - target_weights)[\"SPY.US\"].max() <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>np.float64(0.36386072210732423) <\/code><\/pre>\n<p>\u0412\u0435\u0441\u0430 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 36%. \u0422\u0430\u043a\u043e\u0435 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u0438\u0437 \u0438\u043d\u0432\u0435\u0441\u0442\u043e\u0440\u043e\u0432. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u044d\u0442\u043e &#171;\u0432\u044b\u043b\u0435\u0447\u0438\u0442\u044c&#187; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u0435 \u043d\u0430 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u0443\u044e \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 1 \u0433\u043e\u0434.<\/p>\n<pre><code class=\"python\">pf2.rebalancing_strategy = reb_calendar pf2 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                        portfolio_8100.PF assets                         [AGG.US, SPY.US] weights                              [0.6, 0.4] rebalancing_period                         year rebalancing_abs_deviation                  None rebalancing_rel_deviation                  None currency                                    USD inflation                                  None first_date                              2003-10 last_date                               2025-06 period_length                21 years, 9 months dtype: object <\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Portfolio.rebalancing_events<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">ev = pf2.rebalancing_events ev <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2003-12    calendar 2004-12    calendar 2005-12    calendar 2006-12    calendar 2007-12    calendar 2008-12    calendar 2009-12    calendar 2010-12    calendar 2011-12    calendar 2012-12    calendar 2013-12    calendar 2014-12    calendar 2015-12    calendar 2016-12    calendar 2017-12    calendar 2018-12    calendar 2019-12    calendar 2020-12    calendar 2021-12    calendar 2022-12    calendar 2023-12    calendar 2024-12    calendar Freq: M, dtype: object <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u044b\u043b\u043e 22 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"python\">ev.shape  <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>(22,) <\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432\u0441\u0435\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430:<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(12, 6)) ax = plt.gca() pf2.weights_ts.plot(ax=ax) ax.vlines(x=ev[ev == \"calendar\"].index, ymin=0, ymax=1, colors=\"blue\", ls=\"--\", lw=1, label=\"\u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438\") ax.set_ylim([0, 1]) ax.legend(); <\/code><\/pre>\n<figure class=\"\">\n<div><figcaption>60\/40 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f \u043f\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 5 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439 \u0432\u0435\u0441\u043e\u0432:<\/p>\n<pre><code class=\"python\">abs(pf2.weights_ts - target_weights)[\"SPY.US\"].nlargest(n=5) <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2008-12   0.11913 2008-11   0.10794 2008-10   0.08644 2013-12   0.07366 2021-12   0.06630 Freq: M, Name: SPY.US, dtype: float64 <\/code><\/pre>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 2008 \u0433\u043e\u0434\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0438\u0437\u0438\u0441\u0430 \u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e \u043f\u043e\u0447\u0442\u0438 12%. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0431\u0435\u0437 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c 5%:<\/p>\n<pre><code class=\"python\">pf2.rebalancing_strategy = reb_bands_abs pf2 <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>symbol                        portfolio_8100.PF assets                         [AGG.US, SPY.US] weights                              [0.6, 0.4] rebalancing_period                         none rebalancing_abs_deviation               0.05000 rebalancing_rel_deviation                  None currency                                    USD inflation                                  None first_date                              2003-10 last_date                               2025-06 period_length                21 years, 9 months dtype: object <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 13.<\/p>\n<pre><code>ev = pf2.rebalancing_events ev <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>2005-11    abs 2008-10    abs 2009-01    abs 2009-09    abs 2011-04    abs 2011-09    abs 2012-03    abs 2013-10    abs 2016-11    abs 2018-01    abs 2021-02    abs 2021-12  <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-465810","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/465810","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=465810"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/465810\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=465810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=465810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=465810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}