{"id":261881,"date":"2015-07-20T16:28:02","date_gmt":"2015-07-20T12:28:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=261881"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=261881","title":{"rendered":"\u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433 \u043d\u0430 Python \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c. \u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"<p>       <a href=\"http:\/\/habrahabr.ru\/company\/itinvest\/blog\/263097\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/293\/6ac\/abf\/2936acabf56146e485b01c8b3327a688.jpg\"\/><\/a><\/p>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435<a href=\"http:\/\/habrahabr.ru\/company\/itinvest\/blog\/224353\/\"> \u044d\u0442\u0430\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/a> \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c (\u0435\u0441\u0442\u044c \u0438 <a href=\"http:\/\/www.itinvest.ru\/education\/schedule\/\">\u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u044b<\/a> \u043f\u043e \u0442\u0435\u043c\u0435), \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"http:\/\/habrahabr.ru\/company\/itinvest\/blog\/238839\/\">\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/a> (\u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433). \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u044d\u043a\u0442\u0435\u0441\u0442-\u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python.<a name=\"habracut\"><\/a><\/p>\n<h4>\u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u0444\u0442<\/h4>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u0430, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0435 \u0438\u0433\u0440\u044b. \u0412 \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0440\u0435\u0439\u0442\u043e\u043c. \u0421\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u00ab\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439\u00bb \u043f\u0435\u0442\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0435\u0449\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Event_loop\">\u043f\u0435\u0442\u043b\u0435\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Game_programming#Game_structure\">\u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0435\u0442\u043b\u0435\u0439<\/a>.<\/p>\n<p>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0438\u043a\u0435 \u043f\u0435\u0442\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b\u043b\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0432 \u0438\u0433\u0440\u0435. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u043b\u0438\u043a \u043c\u044b\u0448\u0438) \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0442\u043b\u044e, \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f. \u041f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"python\">while True:  # \u041f\u0435\u0442\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e     new_event = get_new_event()   # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435      # \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435     if new_event.type == &quot;LEFT_MOUSE_CLICK&quot;:         open_menu()     elif new_event.type == &quot;ESCAPE_KEY_PRESS&quot;:         quit_game()     elif new_event.type == &quot;UP_KEY_PRESS&quot;:         move_player_north()     # ... and many more events      redraw_screen()   # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u044d\u043a\u0440\u0430\u043d \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438     tick(50)   # \u0416\u0434\u0435\u043c 50 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043b\u043b\u044e\u0437\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041a\u0430\u043a \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0434\u0430\u043b\u0435\u0435, \u044d\u0442\u043e \u2014 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433\u0430.<\/p>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440<\/h4>\n<p>  \u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0440\u044f\u0434\u043e\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u043f\u0435\u0440\u0435\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c:<\/p>\n<ul>\n<li><b>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430<\/b>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043a\u0430\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u0438 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0435 \u043d\u0430 \u0431\u0438\u0440\u0436\u0435 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u0448\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u00ab\u0434\u043e\u0432\u043e\u0434\u043a\u0438\u00bb \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u043e\u0432 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0440\u0430\u0437\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/li>\n<li><b>\u041f\u0440\u0435\u0434\u0443\u0433\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u0439<\/b>. \u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u044b \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0440\u044b\u043d\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u00ab\u0441\u043e\u0431\u044b\u0442\u0438\u0439\u00bb, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u00ab\u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c\u00bb \u043c\u043e\u0434\u0443\u043b\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0440\u0435\u0430\u043a\u0446\u0438\u044f \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0435.<\/li>\n<li><b>\u0420\u0435\u0430\u043b\u0438\u0437\u043c<\/b>. \u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0440\u0434\u0435\u0440\u043e\u0432 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438. \u0412\u0430\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u043e\u0440\u0434\u0435\u0440\u043e\u0432 (market, limit) \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 (market-on-open, MOO \u0438 market-on-close, MOC) \u2014 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c\u0441\u044f \u00ab\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439\u00bb \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/li>\n<\/ul>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0431\u0435\u0437\u043e\u0431\u043b\u0430\u0447\u043d\u043e, \u0438 \u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0435\u0441\u044c \u0441\u0432\u043e\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0438\u0445 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u00ab\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439\u00bb, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u0430\u0433\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A0%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B0_%D1%87%D0%B5%D1%80%D0%B5%D0%B7_%D1%82%D0%B5%D1%81%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a>. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<h4>\u041e\u0431\u0437\u043e\u0440 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u0430<\/h4>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<ul>\n<li><b>\u0421\u043e\u0431\u044b\u0442\u0438\u0435 (<code>event<\/code><\/b>) \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0438\u043f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00abMARKET\u00bb, \u00abSIGNAL\u00bb, \u00abORDER\u00bb \u0438\u043b\u0438 \u00abFILL\u00bb), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0435\u0442\u043b\u0435.<\/li>\n<li><b>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (<code>event queue<\/code>)<\/b> \u2014 in-memory-\u043e\u0431\u044a\u0435\u043a\u0442 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u0432 <code>Event<\/code>, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/li>\n<li><b><code>DataHandler<\/code><\/b> \u2014 \u044d\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 (\u0410\u0411\u041a), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0440\u044b\u043d\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0438\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u00ab\u0436\u0438\u0432\u043e\u043c\u00bb \u0440\u044b\u043d\u043a\u0435. DataHandler \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>MarketEvent<\/code> \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u00ab\u0443\u0434\u0430\u0440\u0435 \u0441\u0435\u0440\u0434\u0446\u0430\u00bb (heartbeat) \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/li>\n<li><b>\u041c\u043e\u0434\u0443\u043b\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 (<code>Strategy<\/code>)<\/b> \u2014 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0410\u0411\u041a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0437\u0430\u0431\u043e\u0440\u0430 \u0440\u044b\u043d\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (<code>SignalEvent<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <code>Portfolio<\/code>. <code>SignalEvent<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0431\u0438\u0440\u0436\u0435\u0432\u043e\u0433\u043e \u0442\u0438\u043a\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430 (Long, Short) \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443.<\/li>\n<li><b><code>Portfolio<\/code><\/b> \u2014 \u0442\u0430\u043a\u0436\u0435 \u0410\u0411\u041a, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043a\u0430\u0437\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c\u0438, \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 (<code>Strategy<\/code>). \u0421\u044e\u0434\u0430 \u0436\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0440\u0438\u0441\u043a-\u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442 \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0438\u043e, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0440\u044b\u043d\u043a\u0430. \u0412 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0443 <code>RiskManagement<\/code>. <code>Portfolio<\/code> \u0431\u0435\u0440\u0435\u0442 <code>SignalEvent<\/code> \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0440\u0434\u0435\u0440\u043e\u0432 (<code>OrderEvent<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c.<\/li>\n<li><b><code>ExecutionHandler<\/code><\/b> \u2014 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0440\u043e\u043a\u0435\u0440\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f OrderEvent \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u0445 (\u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0440\u043e\u043a\u0435\u0440\u0443). \u041a\u043e\u0433\u0434\u0430 \u043e\u0440\u0434\u0435\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>FillEvent<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0438 \u0431\u0438\u0440\u0436\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u043a\u0430\u043b\u044c\u0437\u044b\u0432\u0430\u043d\u0438\u0435 (\u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u0438).<\/li>\n<li><b>\u041f\u0435\u0442\u043b\u044f (<code>Loop<\/code>)<\/b> \u2014 \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u043f\u0435\u0442\u043b\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0438\u0445 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/li>\n<\/ul>\n<p>  \u0412\u044b\u0448\u0435 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0432\u0436\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043f\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u044f <code>Portfolio<\/code>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0438\u0437\u0434\u0435\u0440\u0436\u0435\u043a \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043b\u0438\u0448\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043c\u0430.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u0430. \u0412 \u043a\u043e\u0434\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0434\u0432\u0435 \u043f\u0435\u0442\u043b\u0438. \u0412\u043d\u0435\u0448\u043d\u044f\u044f \u043f\u0435\u0442\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0434\u0430\u043d\u0438\u044f \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0435\u0440\u0443 \u0441\u0435\u0440\u0434\u0446\u0435\u0431\u0438\u0435\u043d\u0438\u044f (heartbeat). \u0412 \u043e\u043d\u043b\u0430\u0439\u043d-\u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433\u0435 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0440\u044b\u043d\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u044b\u043d\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c \u2014 \u0441\u043c. \u0441\u0442\u0440\u043e\u043a\u0443 <code>bars.update_bars()<\/code>.<\/p>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043f\u0435\u0442\u043b\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Queue. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041a\u043e\u0433\u0434\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0443\u0441\u0442\u0435\u0435\u043c \u043f\u0435\u0442\u043b\u044f \u0441\u0435\u0440\u0434\u0446\u0435\u0431\u0438\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0432\u0438\u0442\u043e\u043a:<\/p>\n<pre><code class=\"python\"># \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u0432 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 bars = DataHandler(..) strategy = Strategy(..) port = Portfolio(..) broker = ExecutionHandler(..)  while True:     # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0431\u0430\u0440\u044b (\u043a\u043e\u0434 \u0434\u043b\u044f \u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433\u0430, \u0430 \u043d\u0435 \u0436\u0438\u0432\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438)     if bars.continue_backtest == True:         bars.update_bars()     else:         break          # \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f     while True:         try:             event = events.get(False)         except Queue.Empty:             break         else:             if event is not None:                 if event.type == 'MARKET':                     strategy.calculate_signals(event)                     port.update_timeindex(event)                  elif event.type == 'SIGNAL':                     port.update_signal(event)                  elif event.type == 'ORDER':                     broker.execute_order(event)                  elif event.type == 'FILL':                     port.update_fill(event)      # \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0443\u0434\u0430\u0440 \u0441\u0435\u0440\u0434\u0446\u0430 \u0447\u0435\u0440\u0435\u0437 10 \u043c\u0438\u043d\u0443\u0442     time.sleep(10*60)  <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h4>\n<p>  \u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0438\u043f\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439:<\/p>\n<ul>\n<li><b><code>MarketEvent<\/code><\/b> \u2014 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u043f\u0435\u0442\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u00ab\u0443\u0434\u0430\u0440 \u0441\u0435\u0440\u0434\u0446\u0430\u00bb. \u041e\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 DataHandler \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u044b\u043d\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <code>Strategy<\/code>. \u041e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u044b\u043d\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/li>\n<li><b><code>SignalEvent<\/code><\/b> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 <code>Strategy<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u044b\u043d\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>SignalEvent<\/code>. \u042d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0442\u0438\u043a\u0435\u0440\u0430, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430 (long \u0438\u043b\u0438 short). \u0422\u0430\u043a\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <code>Portfolio<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u043d\u0430 \u0442\u0435\u043c\u0443 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u0442\u044c.<\/li>\n<li><b><code>OrderEvent<\/code><\/b> \u2014 \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 <code>Portfolio<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <code>SignalEvent<\/code>, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0438\u043e (\u0440\u0430\u0441\u0447\u0435\u0442 \u0440\u0438\u0441\u043a\u043e\u0432 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438). \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e <code>OrderEvent<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0432 <code>ExecutionHandler<\/code>.<\/li>\n<li><b><code>FillEvent<\/code><\/b> \u2014 \u043a\u043e\u0433\u0434\u0430 ExecutionHandler \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <code>OrderEvent<\/code>, \u043e\u043d \u043e\u0431\u044f\u0437\u0430\u043d \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>FillEvent<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0438 \u0442\u0440\u0430\u043d\u0430\u0437\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438 (\u043f\u0440\u043e\u0441\u043a\u0430\u043b\u044c\u0437\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438 \u0438 \u0442.\u043f.)<\/li>\n<\/ul>\n<p>  \u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>Event<\/code> \u2014 \u044d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043a\u043b\u0430\u0441\u0441 <code>Event<\/code> \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043e\u043b\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n<pre><code class=\"python\"># event.py  class Event(object):     &quot;&quot;&quot;     Event \u2014 \u044d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 (\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0445) \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435    \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.      &quot;&quot;&quot;     pass <\/code><\/pre>\n<p>  <code>MarketEvent<\/code> \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442 <code>Event<\/code> \u0438 \u043d\u0435\u0441\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0447\u0443\u0442\u043e\u0447\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0430\u043c\u043e\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u0430 \u2018MARKET\u2019:<\/p>\n<pre><code class=\"python\"># event.py  class MarketEvent(Event):     &quot;&quot;&quot;     \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u044b\u043d\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0449\u0438\u043c\u0438 \u0431\u0430\u0440\u0430\u043c\u0438.     &quot;&quot;&quot;      def __init__(self):         &quot;&quot;&quot;         \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 MarketEvent.         &quot;&quot;&quot;         self.type = 'MARKET' <\/code><\/pre>\n<p>  <code>SignalEvent<\/code> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0442\u0438\u043a\u0435\u0440\u0430, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043a\u0438 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0440\u0434\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0438\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u00ab\u0441\u043e\u0432\u0435\u0442\u0430\u00bb \u043f\u0440\u0438 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0435:<\/p>\n<pre><code class=\"python\"># event.py  class SignalEvent(Event):     &quot;&quot;&quot;     \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 Signal \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Strategy. \u0415\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 Portfolio, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.     &quot;&quot;&quot;          def __init__(self, symbol, datetime, signal_type):         &quot;&quot;&quot;         \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 SignalEvent.          \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:         symbol - \u0421\u0438\u043c\u0432\u043e\u043b \u0442\u0438\u043a\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Google \u2014 'GOOG'.         datetime - \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u0435\u0442\u043a\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430.         signal_type - 'LONG' \u0438\u043b\u0438 'SHORT'.         &quot;&quot;&quot;                  self.type = 'SIGNAL'         self.symbol = symbol         self.datetime = datetime         self.signal_type = signal_type <\/code><\/pre>\n<p>  <code>OrderEvent<\/code> \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c <code>SignalEvent<\/code>, \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0435\u0434\u0438\u043d\u0438\u0446 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u043e\u0440\u0434\u0435\u0440\u0435. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>Portfolio<\/code>. \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a <code>OrderEvent<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u0442\u043e\u0434 <code>print_order()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\"># event.py  class OrderEvent(Event):     &quot;&quot;&quot;     \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0438\u043a\u0430\u0437\u0430 Order \u0432 \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a. \u041f\u0440\u0438\u043a\u0430\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0438\u043a\u0435\u0440 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, GOOG), \u0442\u0438\u043f (market \u0438\u043b\u0438 limit), \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.     &quot;&quot;&quot;      def __init__(self, symbol, order_type, quantity, direction):         &quot;&quot;&quot;         \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0438\u043f \u043f\u0440\u0438\u043a\u0430\u0437\u0430 (\u043c\u0430\u0440\u043a\u0435\u0442 MKT \u0438\u043b\u0438 \u043b\u0438\u043c\u0438\u0442 LMT), \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0434\u0435\u0440\u0430 (BUY \u0438\u043b\u0438 SELL).          \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:         symbol - \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441\u0434\u0435\u043b\u043a\u0443 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c.         order_type - 'MKT' \u0438\u043b\u0438 'LMT' \u0434\u043b\u044f \u043f\u0440\u0438\u043a\u0430\u0437\u043e\u0432 Market \u0438\u043b\u0438 Limit.         quantity - \u041d\u0435-\u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 (integer) \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.          direction - 'BUY' \u0438\u043b\u0438 'SELL' \u0434\u043b\u044f \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438.         &quot;&quot;&quot;                  self.type = 'ORDER'         self.symbol = symbol         self.order_type = order_type         self.quantity = quantity         self.direction = direction      def print_order(self):         &quot;&quot;&quot;         \u0412\u044b\u0432\u043e\u0434\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0440\u0438\u043a\u0430\u0437\u0435 Order.         &quot;&quot;&quot;         print &quot;Order: Symbol=%s, Type=%s, Quantity=%s, Direction=%s&quot; % \\             (self.symbol, self.order_type, self.quantity, self.direction) <\/code><\/pre>\n<p>  <code>FillEvent<\/code> \u2014 \u044d\u0442\u043e <code>Event<\/code> \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u041e\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043a\u0430\u0437\u0430, \u0442\u0438\u043a\u0435\u0440 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0431 \u043e \u0431\u0438\u0440\u0436\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 (\u0430\u043a\u0446\u0438\u0439, \u0444\u044c\u044e\u0447\u0435\u0440\u0441\u043e\u0432 \u0438 \u0442.\u043f.), \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0446\u0435\u043d\u0443 \u0441\u0434\u0435\u043b\u043a\u0438 \u0438 \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438.<\/p>\n<p>  \u0421\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API \u0431\u0440\u043e\u043a\u0435\u0440\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u0443 <a href=\"http:\/\/www.itinvest.ru\/promo\/adv\/\">ITinvest<\/a> \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 <a href=\"http:\/\/www.itinvest.ru\/services\/robots\/\">API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/a>). \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043c\u0435\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u0431\u0440\u043e\u043a\u0435\u0440\u0430, \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c $1.30 \u0441 \u043e\u0440\u0434\u0435\u0440\u0430 \u0441 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0430\u0432\u043a\u043e\u0439 \u043e\u0442 $0,013 \u0438\u043b\u0438 $0,08 \u0437\u0430 \u0430\u043a\u0446\u0438\u044e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0446\u0438\u0439 500 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<pre><code class=\"python\"># event.py  class FillEvent(Event):     &quot;&quot;&quot;     \u0418\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0440\u0434\u0435\u0440\u0430 (Filled Order), \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u043c.      \u0425\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043a\u0443\u043f\u043b\u0435\u043d\u044b\/\u043f\u0440\u043e\u0434\u0430\u043d\u044b \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0446\u0435\u043d\u0435.      \u0422\u0430\u043a\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438 \u0441\u0434\u0435\u043b\u043a\u0438.     &quot;&quot;&quot;      def __init__(self, timeindex, symbol, exchange, quantity,                   direction, fill_cost, commission=None):         &quot;&quot;&quot;         \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a FillEvent.          \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0438\u043a\u0435\u0440, \u0431\u0438\u0440\u0436\u0435\u0432\u0443\u044e \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0443, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0446\u0435\u043d\u044b \u0438 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438.          \u0415\u0441\u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u044f\u0445 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u0442, \u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 Fill \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442 \u0438\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0431\u044a\u0435\u043c\u0430 \u0441\u0434\u0435\u043b\u043a\u0438         \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0430\u0440\u0438\u0444\u0430\u0445 \u0431\u0440\u043e\u043a\u0435\u0440\u0430\u0445 (\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 API)          \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:         timeindex - \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u0430\u0440\u043e\u0432 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0440\u0434\u0435\u0440\u0430.         symbol - \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0448\u043b\u0430 \u0441\u0434\u0435\u043b\u043a\u0430.         exchange - \u0411\u0438\u0440\u0436\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0430 \u0441\u0434\u0435\u043b\u043a\u0430.         quantity - \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u0434\u0435\u043b\u043a\u0435.         direction - \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f ('BUY' \u0438\u043b\u0438 'SELL')         fill_cost - \u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f.         commission - \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u044f, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u0431\u0440\u043a\u043e\u0435\u0440\u043e\u043c.         &quot;&quot;&quot;                  self.type = 'FILL'         self.timeindex = timeindex         self.symbol = symbol         self.exchange = exchange         self.quantity = quantity         self.direction = direction         self.fill_cost = fill_cost          # Calculate commission         if commission is None:             self.commission = self.calculate_ib_commission()         else:             self.commission = commission      def calculate_ib_commission(self):         &quot;&quot;&quot;         \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 API \u0431\u0440\u043e\u043a\u0435\u0440\u0430 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0430\u043c\u0435\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u043e\u0433\u043e, \u0442.\u0435. \u0446\u0435\u043d\u044b \u0432 \u0434\u043e\u043b\u043b\u0430\u0440\u0430\u0445).          \u041d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438 \u0431\u0438\u0440\u0436\u0438.         &quot;&quot;&quot;         full_cost = 1.3         if self.quantity &lt;= 500:             full_cost = max(1.3, 0.013 * self.quantity)         else: # Greater than 500             full_cost = max(1.3, 0.008 * self.quantity)         full_cost = min(full_cost, 0.5 \/ 100.0 * self.quantity * self.fill_cost)         return full_cost <\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u044b\u043d\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u043a\u043b\u0430\u0441\u0441 <code>DataHandler<\/code>) \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0435.<\/p>\n<p>  <i>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442\u2026<\/i>   \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/263097\/\"> http:\/\/habrahabr.ru\/post\/263097\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <a href=\"http:\/\/habrahabr.ru\/company\/itinvest\/blog\/263097\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/293\/6ac\/abf\/2936acabf56146e485b01c8b3327a688.jpg\"\/><\/a><\/p>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435<a href=\"http:\/\/habrahabr.ru\/company\/itinvest\/blog\/224353\/\"> \u044d\u0442\u0430\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/a> \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c (\u0435\u0441\u0442\u044c \u0438 <a href=\"http:\/\/www.itinvest.ru\/education\/schedule\/\">\u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u044b<\/a> \u043f\u043e \u0442\u0435\u043c\u0435), \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"http:\/\/habrahabr.ru\/company\/itinvest\/blog\/238839\/\">\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/a> (\u0431\u044d\u043a\u0442\u0435\u0441\u0442\u0438\u043d\u0433). \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u044d\u043a\u0442\u0435\u0441\u0442-\u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-261881","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/261881","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=261881"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/261881\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=261881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=261881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=261881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}