{"id":316378,"date":"2021-01-14T15:02:08","date_gmt":"2021-01-14T15:02:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316378"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316378","title":{"rendered":"\u041f\u043e\u0438\u0441\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043d\u0430 Forex \u0441 Python"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0438\u0431\u044b\u043b\u044c. \u0423\u0432\u0438\u0434\u0435\u043b\u0438 \u0434\u0432\u0435 \u0447\u0435\u0440\u043d\u044b\u0435 \u0441\u0432\u0435\u0447\u043a\u0438 \u0438 \u0442\u0440\u0438 \u0431\u0435\u043b\u044b\u0435 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 &#8212; \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0434\u0435\u043d\u044c\u0433\u0438. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0438\u043b\u0438 \u043e\u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0432\u0441\u0435) \u0438\u043c\u0435\u043d\u043d\u043e \u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0438 \u043a\u0430\u043a \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0447\u0435\u0433\u043e \u043e\u043d\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u044b\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u0422.\u0435. \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u041e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0442\u043e \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0438\u0441\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u0442\u043e\u043d\u043d\u0435\u043b\u0438, \u0433\u043e\u043b\u043e\u0432\u0430 \u0441 \u043f\u043b\u0435\u0447\u0430\u043c\u0438 \u0438 \u0442.\u0434. \u041a\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u043a\u043e\u043f\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0437\u0430 \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0440\u0436\u0438 \u043a\u043e\u0442\u0438\u0440\u043e\u0432\u043a\u0430\u0445  \u0438\u0445 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u043d\u043e\u0441\u0442\u044c? \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0434\u0432\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u0438\u043d\u0438\u0438 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043f\u0438\u043f\u0435\u0434 \u0438\u043b\u0438 \u043a\u0440\u0443\u0436\u043e\u043a \u0441 \u043e\u0432\u0430\u043b\u043e\u043c? \u041e\u0431 \u044d\u0442\u043e\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u043c\u044b \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442.\u0435. \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 python \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443  \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u0437 \u0440\u0443\u043c\u0443\u0441\u0430. <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 &#8212; \u0433\u043e\u043b\u043e\u0432\u0430 \u0438 \u043f\u043b\u0435\u0447\u0438 \u043d\u0430 6-\u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043f\u043e 10 \u0432\u0430\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b38\/3ed\/395\/b383ed39587356188b4b7ecdbb560891.png\" width=\"1366\" height=\"768\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043a \u0432\u0438\u0434\u0443 DataFrame \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u044d\u0442\u043e \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0441 \u043a\u043e\u043d\u0446\u0430, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e 10 \u0432\u0430\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c \u043d\u0430 6 \u0447\u0430\u0441\u0430\u0445 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441 2005 \u0433\u043e\u0434\u0430 \u0437\u0430\u0439\u043c\u0443\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 160 \u0442\u044b\u0441. \u0441\u0442\u0440\u043e\u043a)<\/p>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p><strong>TIME<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>OPEN<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>HIGH<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>LOW<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>CLOSE<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>TITLE<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p>16\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3213<\/p>\n<\/td>\n<td>\n<p>1.3234<\/p>\n<\/td>\n<td>\n<p>1.3211<\/p>\n<\/td>\n<td>\n<p>1.3232<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>16\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3230<\/p>\n<\/td>\n<td>\n<p>1.3265<\/p>\n<\/td>\n<td>\n<p>1.3228<\/p>\n<\/td>\n<td>\n<p>1.3257<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>16\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3255<\/p>\n<\/td>\n<td>\n<p>1.3270<\/p>\n<\/td>\n<td>\n<p>1.3231<\/p>\n<\/td>\n<td>\n<p>1.3247<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3248<\/p>\n<\/td>\n<td>\n<p>1.3249<\/p>\n<\/td>\n<td>\n<p>1.3232<\/p>\n<\/td>\n<td>\n<p>1.3239<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3253<\/p>\n<\/td>\n<td>\n<p>1.3237<\/p>\n<\/td>\n<td>\n<p>1.3247<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3249<\/p>\n<\/td>\n<td>\n<p>1.3259<\/p>\n<\/td>\n<td>\n<p>1.3240<\/p>\n<\/td>\n<td>\n<p>1.3255<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3256<\/p>\n<\/td>\n<td>\n<p>1.3298<\/p>\n<\/td>\n<td>\n<p>1.3231<\/p>\n<\/td>\n<td>\n<p>1.3247<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3245<\/p>\n<\/td>\n<td>\n<p>1.3252<\/p>\n<\/td>\n<td>\n<p>1.3237<\/p>\n<\/td>\n<td>\n<p>1.3239<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3240<\/p>\n<\/td>\n<td>\n<p>1.3258<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3254<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3252<\/p>\n<\/td>\n<td>\n<p>1.3270<\/p>\n<\/td>\n<td>\n<p>1.3249<\/p>\n<\/td>\n<td>\n<p>1.3250<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3252<\/p>\n<\/td>\n<td>\n<p>1.3285<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3273<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3277<\/p>\n<\/td>\n<td>\n<p>1.3308<\/p>\n<\/td>\n<td>\n<p>1.3267<\/p>\n<\/td>\n<td>\n<p>1.3295<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3297<\/p>\n<\/td>\n<td>\n<p>1.3305<\/p>\n<\/td>\n<td>\n<p>1.3279<\/p>\n<\/td>\n<td>\n<p>1.3282<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3281<\/p>\n<\/td>\n<td>\n<p>1.3292<\/p>\n<\/td>\n<td>\n<p>1.3272<\/p>\n<\/td>\n<td>\n<p>1.3273<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3274<\/p>\n<\/td>\n<td>\n<p>1.3279<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3243<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3244<\/p>\n<\/td>\n<td>\n<p>1.3268<\/p>\n<\/td>\n<td>\n<p>1.3242<\/p>\n<\/td>\n<td>\n<p>1.3257<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3259<\/p>\n<\/td>\n<td>\n<p>1.3271<\/p>\n<\/td>\n<td>\n<p>1.3256<\/p>\n<\/td>\n<td>\n<p>1.3266<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3265<\/p>\n<\/td>\n<td>\n<p>1.3275<\/p>\n<\/td>\n<td>\n<p>1.3256<\/p>\n<\/td>\n<td>\n<p>1.3264<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3262<\/p>\n<\/td>\n<td>\n<p>1.3299<\/p>\n<\/td>\n<td>\n<p>1.3254<\/p>\n<\/td>\n<td>\n<p>1.3255<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>21\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3253<\/p>\n<\/td>\n<td>\n<p>1.3278<\/p>\n<\/td>\n<td>\n<p>1.3251<\/p>\n<\/td>\n<td>\n<p>1.3261<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 \u043f\u043e\u0438\u0441\u043a\u0430. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043c \u043b\u0435\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e, \u0442.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043a\u0438\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0437\u0430\u0442\u0435\u043c \u0433\u043e\u043b\u043e\u0432\u0443, \u0442.\u0435. \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430, \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u043d\u043e\u043c,  \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e, \u043e\u043d\u043e \u0436\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u0430, \u0438 \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e, \u0442.\u0435. \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430, \u043d\u043e \u043d\u0438\u0436\u0435 \u0433\u043e\u043b\u043e\u0432\u044b. \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0447\u0442\u043e \u0433\u043e\u043b\u043e\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430, \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u0430, \u0447\u0442\u043e \u0431 \u0444\u0438\u0433\u0443\u0440\u0430 \u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0433\u043e\u043b\u043e\u0432\u0430 \u0438 \u043f\u043b\u0435\u0447\u0438, \u0430 \u043d\u0435 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u0438\u0437 \u0430\u043d\u0430\u0442\u043e\u043c\u0438\u0438 \u0438 \u2026 \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0432\u0435\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e &#171;\u043f\u0440\u043e\u0431\u044c\u0435\u0442&#187; \u0434\u043d\u043e, \u0442.\u0435. \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0438\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043d\u0430. \u041f\u0440\u043e\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0441\u0432\u0435\u0447\u043a\u043e\u0439. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0442 \u0433\u043e\u043b\u043e\u0432\u044b \u0434\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043d\u0430 \u043e\u0442 \u0443\u0440\u043e\u0432\u043d\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0441\u0432\u0435\u0447\u043a\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043f\u043e\u0434\u043d\u044f\u0432\u0448\u0438\u0441\u044c \u0432\u044b\u0448\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430 (\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0441\u0442\u043e\u043f \u043b\u043e\u0441\u0441\u0430).  \u041f\u0440\u043e\u0448\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u043e\u043b\u043e\u0432\u044b \u0432 \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0448\u0430\u0433, \u0442.\u0435. \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0432\u0435\u0447\u0430, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u0434\u0430, \u0445\u043e\u0442\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0438 H&amp;S \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 (\u0430\u0432\u0442\u043e\u0440 \u044d\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442).<\/p>\n<pre><code>#\u043b\u0438\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b list_H_AND_S=[] #\u043b\u0438\u0441\u0442 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 (\u0444\u0438\u0433\u0443\u0440\u0430 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430, \u0434\u0435\u043d\u0435\u0433 \u043d\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u0430, \u0430  \u0443\u043d\u0435\u0441\u043b\u0430) list_NOT_H_AND_S=[]                                                 for i in range(600,len(df_ALL['CLOSE'])-600):          # \u043d\u0430\u0439\u0434\u0435\u043c \u043b\u0435\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e, \u0442.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c      if  max(df_ALL['HIGH'][i-30:i+15])==df_ALL['HIGH'][i]:                  #\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u043e\u043b\u043e\u0432\u044b \u0441 \u0448\u0430\u0433\u043e\u043c \u0432 15, \u0447\u0442\u043e \u0431 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u0430         for z in range (15,200,15):               left_shoulder=max(df_ALL['HIGH'][i-30:i+15])                          # \u0438\u043d\u0434\u0435\u043a\u0441 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430             left_shoulder_index=df_ALL['HIGH'][i-30:i+15].idxmax()                          # \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0439\u0434\u0435\u043c \u0433\u043e\u043b\u043e\u0432\u0443, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0436 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430             if max(df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1])&gt;left_shoulder and\\             (left_shoulder-min(df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1]))\/((max(df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1])-min(df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1])))&gt;=0.6:                      head=max(df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1])                                  # \u0438\u043d\u0434\u0435\u043a\u0441 \u0433\u043e\u043b\u043e\u0432\u044b                 head_index=df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1].idxmax()                 for b in range (15,200,15):                      # \u043f\u0435\u0440\u0432\u043e\u0435 \u0434\u043d\u043e, \u0442.\u0435. \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0436\u0434\u0443 \u043b\u0435\u0432\u044b\u043c \u043f\u043b\u0435\u0447\u043e\u043c \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u0439                     first_bottom= min(df_ALL['LOW'][left_shoulder_index:head_index+1])                      # \u0438\u043d\u0434\u0435\u043a\u0441 1-\u043e\u0433\u043e \u0434\u043d\u044f                     first_bottom_index=df_ALL['LOW'][left_shoulder_index:head_index+1].idxmin()                                          # \u043d\u0430\u0439\u0434\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e                     if min(df_ALL['LOW'][head_index:head_index+b])&lt;first_bottom and \\                     (head-first_bottom)\/(head-min(df_ALL['LOW'][head_index:head_index+b]))&gt;=0.5:                         second_bottom= min(df_ALL['LOW'][head_index:head_index+b])                          # \u0438\u043d\u0434\u0435\u043a\u0441 2-\u043e\u0433\u043e \u0434\u043d\u0430                         second_bottom_index=df_ALL['LOW'][head_index:head_index+b].idxmin()                                         for o in range(2,300):                             # max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1]) - \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e                             if max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1])&gt;=left_shoulder and \\                             max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1])&lt;head and \\                             second_bottom_index+o-df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax()&gt;0 and \\                             (second_bottom_index+o+1)-df_ALL['LOW'][df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax()]&gt;2 and \\                             min(df_ALL['LOW'][df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax():second_bottom_index+o+1])==df_ALL['LOW'][second_bottom_index+o] and \\                             min(df_ALL['LOW'][df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax():second_bottom_index+o])&gt;second_bottom and \\                             df_ALL['CLOSE'][second_bottom_index+o]&lt;second_bottom and \\                             min(df_ALL['LOW'][second_bottom_index:df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax()+1])==second_bottom and \\                             min(df_ALL['LOW'][left_shoulder_index:head_index])==first_bottom and \\                             max(df_ALL['HIGH'][first_bottom_index:second_bottom_index+1])==head and \\                             df_ALL['CLOSE'][second_bottom_index+o]-df_ALL['OPEN'][second_bottom_index+o]&lt;=0:                                                                  # \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0446\u0438\u043a\u043b \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430\u043c, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e H$S \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u043d\u043e\u0439                                 for x in range (2,300):                                     # \u0447\u0442\u043e \u0431 \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u0431\u044b\u043b\u044c, \u0433\u0440\u0430\u0444\u0438\u043a \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u044b\u0448\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u043d\u0438\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043d\u0430                                     # \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 (\u0433\u043e\u043b\u043e\u0432\u0430-\u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e)*2. \u042d\u0442\u0430 \u0442\u043e\u0447\u043a\u0430 \u043f\u043e \u0438\u0434\u0435\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u0437\u044f\u0442\u0438\u044f \u043f\u0440\u0438\u0431\u044b\u043b\u0438, \u0430                                     # \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e - \u0441\u0442\u043e\u043f \u043b\u043e\u0441\u0441\u043e\u043c                                     if max(df_ALL['HIGH'][second_bottom_index+o:second_bottom_index+o+x+1])&lt;=max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1]) and \\                                     min(df_ALL['LOW'][second_bottom_index+o:second_bottom_index+o+x+1])&lt;=second_bottom-(head-second_bottom)*2:                                         if (df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) not in list_H_AND_S:                                             list_H_AND_S.append(df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index]))                                                                                                                      elif max(df_ALL['HIGH'][second_bottom_index+o:second_bottom_index+o+x+1])&gt;max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1]) and \\                                     min(df_ALL['LOW'][second_bottom_index+o:second_bottom_index+o+x+1])&gt;first_bottom-(head-second_bottom):                                          if (df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) not in list_NOT_H_AND_S and \\                                         (df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) not in list_H_AND_S:                                             list_NOT_H_AND_S.append(df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) len(list_H_AND_S),len(list_NOT_H_AND_S)<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043f\u043b\u044e\u0441 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0439\u0442\u0438 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 1\/6 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 (\u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0430\u043c\u0438), \u0447\u0442\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u043c\u0443 (\u0434\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e) \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0441\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u044f. \u041c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e \u043d\u0438\u0436\u0435 \u043b\u0435\u0432\u043e\u0433\u043e, \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e \u0432\u044b\u0448\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u043d\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442  &#8212; \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d H&amp;S \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043d\u0435\u0433 \u043e\u043d \u043d\u0435 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442\u2026<\/p>\n<p>\u0412\u044b\u043c\u043f\u0435\u043b (\u0444\u043b\u0430\u043d\/\u0444\u043b\u0430\u0433)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/573\/34a\/023\/57334a0234548b435bac19893cecd9ce.png\" width=\"996\" height=\"409\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0439\u0442\u0438 \u0432\u044b\u043c\u043f\u0435\u043b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0433\u0447\u0435, \u0434\u0430 \u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0441\u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435\u043d. \u0412 \u043f\u043b\u044e\u0441 \u0432\u044b \u0432\u044b\u0439\u0434\u0435\u0442\u0435 \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 1 \u0440\u0430\u0437 \u0438\u0437 10, \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u041a \u0441\u043b\u043e\u0432\u0443, \u043f\u0440\u043e\u0440\u044b\u0432 \u0432\u044b\u043c\u043f\u0435\u043b\u0430 \u0442\u043e\u0436\u0435 \u043d\u0438 \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u043b\u044e\u0441\u0443 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0447\u0435\u0442\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442<\/p>\n<pre><code># \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u0430 \u0434\u0435\u043d\u044c\u0433\u0438 list_vimpel=[] # \u0444\u0438\u0433\u0443\u0440\u0430 \u0434\u0435\u043d\u044c\u0433\u0438 \u043d\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u0430 list_NOT_vimpel=[]  for i in range(600,len(df_ALL['CLOSE'])-1000):              if  max(df_ALL['HIGH'][i-15:i+15])==df_ALL['HIGH'][i]:         for z in range (15,300,15):              # \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c             first_max=max(df_ALL['HIGH'][i-15:i+15])                          # \u0438\u043d\u0434\u0435\u043a\u0441 1-\u043e\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430             first_max_index=df_ALL['HIGH'][i-15:i+15].idxmax()                          if (first_max-min(df_ALL['LOW'][first_max_index:first_max_index+z+1]))&gt;0 and \\             max(df_ALL['HIGH'][df_ALL['LOW'][first_max_index:first_max_index+z+1].idxmin():first_max_index+z+1])&gt;first_max and \\             (max(df_ALL['HIGH'][df_ALL['LOW'][first_max_index:first_max_index+z+1].idxmin():first_max_index+z+1])-min(df_ALL['LOW'][first_max_index:first_max_index+z+1]))\/(first_max-min(df_ALL['LOW'][first_max_index:first_max_index+z+1]))&lt;=2.2 and \\             (max(df_ALL['HIGH'][df_ALL['LOW'][first_max_index:first_max_index+z+1].idxmin():first_max_index+z+1])-min(df_ALL['LOW'][first_max_index:first_max_index+z+1]))\/(first_max-min(df_ALL['LOW'][first_max_index:first_max_index+z+1]))&gt;=1.3:                 second_max=max(df_ALL['HIGH'][df_ALL['LOW'][first_max_index:first_max_index+z+1].idxmin():first_max_index+z+1])                 second_max_index=df_ALL['HIGH'][df_ALL['LOW'][first_max_index:first_max_index+z+1].idxmin():first_max_index+z+1].idxmax()                  # \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0432\u044b\u043c \u0438 \u0432\u0442\u043e\u0440\u044b\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u043e\u043c                 first_min= min(df_ALL['LOW'][first_max_index:second_max_index+1])                  # \u0438\u043d\u0434\u0435\u043a\u0441 1-\u043e\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430                 first_min_index=df_ALL['LOW'][first_max_index:second_max_index+1].idxmin()                                          for o in range(2,300):                     if (second_max_index-first_min_index)&gt;=25 and \\                     min(df_ALL['LOW'][second_max_index:second_max_index+o+1])==df_ALL['LOW'][o+second_max_index] and \\                     df_ALL['LOW'][o+second_max_index]&gt;first_min and \\                     df_ALL['HIGH'][o+second_max_index]&lt;second_max and \\                     (second_max_index-first_min_index)&gt;=25 and \\                     max(df_ALL['HIGH'][first_min_index:o+second_max_index+1])==second_max and \\                     min(df_ALL['LOW'][first_min_index:second_max_index+1])==df_ALL['LOW'][first_min_index] and \\                     max(df_ALL['HIGH'][first_max_index:first_min_index+1])==first_max and \\                     (o+second_max_index)-second_max_index&gt;=16 and \\                     df_ALL['LOW'][o+second_max_index]&lt;=(first_min+((second_max-first_max)*(((o+second_max_index)-first_min_index)\/(second_max_index-first_max_index)))) and \\                     df_ALL['CLOSE'][o+second_max_index]&gt;=(first_min+((second_max-first_max)*(((o+second_max_index)-first_min_index)\/(second_max_index-first_max_index)))):                          for x in range (2,300):                             if min(df_ALL['LOW'][o+second_max_index:o+second_max_index+x+1])==df_ALL['LOW'][o+second_max_index] and \\                             max(df_ALL['HIGH'][o+second_max_index:o+second_max_index+x+1])&gt;=second_max:                                 if (df_ALL['TIME'][first_max_index]+' '+ df_ALL['TIME'][second_max_index]+' '+df_ALL['TIME'][second_max_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_max_index+o]+' '+str(df_ALL['CLOSE'][o+second_max_index]-df_ALL['OPEN'][o+second_max_index])+' '+str((second_max-first_min)\/(first_max-first_min))+' '+str((second_max_index-first_min_index)\/(first_min_index-first_max_index))+' '+str(((second_max-first_min)\/(first_max-first_min))\/((second_max-df_ALL['LOW'][o+second_max_index])\/(second_max-first_min)))+' '+str(df_ALL['WeekDay'][o+second_max_index])+' '+str((second_max_index-first_max_index)\/((o+second_max_index)-second_max_index)))  not in list_vimpel:                                     list_vimpel.append(df_ALL['TIME'][first_max_index]+' '+ df_ALL['TIME'][second_max_index]+' '+df_ALL['TIME'][second_max_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_max_index+o]+' '+str(df_ALL['CLOSE'][o+second_max_index]-df_ALL['OPEN'][o+second_max_index])+' '+str((second_max-first_min)\/(first_max-first_min))+' '+str((second_max_index-first_min_index)\/(first_min_index-first_max_index))+' '+str(((second_max-first_min)\/(first_max-first_min))\/((second_max-df_ALL['LOW'][o+second_max_index])\/(second_max-first_min)))+' '+str(df_ALL['WeekDay'][o+second_max_index])+' '+str((second_max_index-first_max_index)\/((o+second_max_index)-second_max_index)))                                                                                                              elif min(df_ALL['LOW'][o+second_max_index:o+second_max_index+x+1])&lt;df_ALL['LOW'][o+second_max_index] and \\                             max(df_ALL['HIGH'][o+second_max_index:o+second_max_index+x+1])&lt;second_max:                                  if (df_ALL['TIME'][first_max_index]+' '+ df_ALL['TIME'][second_max_index]+' '+df_ALL['TIME'][second_max_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_max_index+o]+' '+str(df_ALL['CLOSE'][o+second_max_index]-df_ALL['OPEN'][o+second_max_index])+' '+str((second_max-first_min)\/(first_max-first_min))+' '+str((second_max_index-first_min_index)\/(first_min_index-first_max_index))+' '+str(((second_max-first_min)\/(first_max-first_min))\/((second_max-df_ALL['LOW'][o+second_max_index])\/(second_max-first_min)))+' '+str(df_ALL['WeekDay'][o+second_max_index])+' '+str((second_max_index-first_max_index)\/((o+second_max_index)-second_max_index))) not in list_NOT_vimpel and \\                                 (df_ALL['TIME'][first_max_index]+' '+ df_ALL['TIME'][second_max_index]+' '+df_ALL['TIME'][second_max_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_max_index+o]+' '+str(df_ALL['CLOSE'][o+second_max_index]-df_ALL['OPEN'][o+second_max_index])+' '+str((second_max-first_min)\/(first_max-first_min))+' '+str((second_max_index-first_min_index)\/(first_min_index-first_max_index))+' '+str(((second_max-first_min)\/(first_max-first_min))\/((second_max-df_ALL['LOW'][o+second_max_index])\/(second_max-first_min)))+' '+str(df_ALL['WeekDay'][o+second_max_index])+' '+str((second_max_index-first_max_index)\/((o+second_max_index)-second_max_index)))  not in list_vimpel:                                     list_NOT_vimpel.append(df_ALL['TIME'][first_max_index]+' '+ df_ALL['TIME'][second_max_index]+' '+df_ALL['TIME'][second_max_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_max_index+o]+' '+str(df_ALL['CLOSE'][o+second_max_index]-df_ALL['OPEN'][o+second_max_index])+' '+str((second_max-first_min)\/(first_max-first_min))+' '+str((second_max_index-first_min_index)\/(first_min_index-first_max_index))+' '+str(((second_max-first_min)\/(first_max-first_min))\/((second_max-df_ALL['LOW'][o+second_max_index])\/(second_max-first_min)))+' '+str(df_ALL['WeekDay'][o+second_max_index])+' '+str((second_max_index-first_max_index)\/((o+second_max_index)-second_max_index)))                                               len(list_vimpel),len(list_NOT_vimpel)<\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u0441\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a \u043f\u0441\u0435\u0432\u0434\u043e\u0442\u0435\u043e\u0440\u0438\u044f\u043c, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043d\u0430\u0443\u0447\u043d\u043e\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u043e\u0432, \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0445 \u043e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0441\u0432\u0435\u0447\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u041e\u0442\u043a\u0443\u0434\u0430 \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432\u0437\u044f\u0442\u0430? \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430, \u043a\u0430\u043a \u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0430 \u0432 \u0442\u0432\u043e\u0440\u0446\u0430 \u0432 \u0441\u0430\u0435\u043d\u0442\u043e\u043b\u043e\u0433\u0438\u0438 \u0443\u0436\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0443\u043a\u0438? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0442\u043e-\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u043b (\u043d\u0435 \u0431\u0435\u0437 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e) \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u043f\u0440\u0438\u043d\u043e\u0441\u044f\u0449\u0438\u0439 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u0443\u044e -\u0442\u043e \u043f\u0440\u0438\u0431\u044b\u043b\u044c, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u0435\u0439 \u0431\u0438\u0440\u0436\u0435\u0432\u043e\u0439 \u0441\u0444\u0435\u0440\u044b. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<p>P.S. \u0410\u0432\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u043d\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u0442.\u0434.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/post\/537298\/\"> https:\/\/habr.com\/ru\/post\/537298\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0438\u0431\u044b\u043b\u044c. \u0423\u0432\u0438\u0434\u0435\u043b\u0438 \u0434\u0432\u0435 \u0447\u0435\u0440\u043d\u044b\u0435 \u0441\u0432\u0435\u0447\u043a\u0438 \u0438 \u0442\u0440\u0438 \u0431\u0435\u043b\u044b\u0435 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 &#8212; \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0434\u0435\u043d\u044c\u0433\u0438. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0438\u043b\u0438 \u043e\u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0432\u0441\u0435) \u0438\u043c\u0435\u043d\u043d\u043e \u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0438 \u043a\u0430\u043a \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0447\u0435\u0433\u043e \u043e\u043d\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u044b\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u0422.\u0435. \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u041e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0442\u043e \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0438\u0441\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u0442\u043e\u043d\u043d\u0435\u043b\u0438, \u0433\u043e\u043b\u043e\u0432\u0430 \u0441 \u043f\u043b\u0435\u0447\u0430\u043c\u0438 \u0438 \u0442.\u0434. \u041a\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u043a\u043e\u043f\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0437\u0430 \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0440\u0436\u0438 \u043a\u043e\u0442\u0438\u0440\u043e\u0432\u043a\u0430\u0445  \u0438\u0445 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u043d\u043e\u0441\u0442\u044c? \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0434\u0432\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u0438\u043d\u0438\u0438 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043f\u0438\u043f\u0435\u0434 \u0438\u043b\u0438 \u043a\u0440\u0443\u0436\u043e\u043a \u0441 \u043e\u0432\u0430\u043b\u043e\u043c? \u041e\u0431 \u044d\u0442\u043e\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u043c\u044b \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442.\u0435. \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 python \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443  \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u0437 \u0440\u0443\u043c\u0443\u0441\u0430. <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 &#8212; \u0433\u043e\u043b\u043e\u0432\u0430 \u0438 \u043f\u043b\u0435\u0447\u0438 \u043d\u0430 6-\u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043f\u043e 10 \u0432\u0430\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043a \u0432\u0438\u0434\u0443 DataFrame \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u044d\u0442\u043e \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0441 \u043a\u043e\u043d\u0446\u0430, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e 10 \u0432\u0430\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c \u043d\u0430 6 \u0447\u0430\u0441\u0430\u0445 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441 2005 \u0433\u043e\u0434\u0430 \u0437\u0430\u0439\u043c\u0443\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 160 \u0442\u044b\u0441. \u0441\u0442\u0440\u043e\u043a)<\/p>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p><strong>TIME<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>OPEN<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>HIGH<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>LOW<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>CLOSE<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>TITLE<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p>16\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3213<\/p>\n<\/td>\n<td>\n<p>1.3234<\/p>\n<\/td>\n<td>\n<p>1.3211<\/p>\n<\/td>\n<td>\n<p>1.3232<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>16\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3230<\/p>\n<\/td>\n<td>\n<p>1.3265<\/p>\n<\/td>\n<td>\n<p>1.3228<\/p>\n<\/td>\n<td>\n<p>1.3257<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>16\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3255<\/p>\n<\/td>\n<td>\n<p>1.3270<\/p>\n<\/td>\n<td>\n<p>1.3231<\/p>\n<\/td>\n<td>\n<p>1.3247<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3248<\/p>\n<\/td>\n<td>\n<p>1.3249<\/p>\n<\/td>\n<td>\n<p>1.3232<\/p>\n<\/td>\n<td>\n<p>1.3239<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3253<\/p>\n<\/td>\n<td>\n<p>1.3237<\/p>\n<\/td>\n<td>\n<p>1.3247<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3249<\/p>\n<\/td>\n<td>\n<p>1.3259<\/p>\n<\/td>\n<td>\n<p>1.3240<\/p>\n<\/td>\n<td>\n<p>1.3255<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>17\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3256<\/p>\n<\/td>\n<td>\n<p>1.3298<\/p>\n<\/td>\n<td>\n<p>1.3231<\/p>\n<\/td>\n<td>\n<p>1.3247<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3245<\/p>\n<\/td>\n<td>\n<p>1.3252<\/p>\n<\/td>\n<td>\n<p>1.3237<\/p>\n<\/td>\n<td>\n<p>1.3239<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3240<\/p>\n<\/td>\n<td>\n<p>1.3258<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3254<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3252<\/p>\n<\/td>\n<td>\n<p>1.3270<\/p>\n<\/td>\n<td>\n<p>1.3249<\/p>\n<\/td>\n<td>\n<p>1.3250<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>18\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3252<\/p>\n<\/td>\n<td>\n<p>1.3285<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3273<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3277<\/p>\n<\/td>\n<td>\n<p>1.3308<\/p>\n<\/td>\n<td>\n<p>1.3267<\/p>\n<\/td>\n<td>\n<p>1.3295<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3297<\/p>\n<\/td>\n<td>\n<p>1.3305<\/p>\n<\/td>\n<td>\n<p>1.3279<\/p>\n<\/td>\n<td>\n<p>1.3282<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3281<\/p>\n<\/td>\n<td>\n<p>1.3292<\/p>\n<\/td>\n<td>\n<p>1.3272<\/p>\n<\/td>\n<td>\n<p>1.3273<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>19\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3274<\/p>\n<\/td>\n<td>\n<p>1.3279<\/p>\n<\/td>\n<td>\n<p>1.3238<\/p>\n<\/td>\n<td>\n<p>1.3243<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3244<\/p>\n<\/td>\n<td>\n<p>1.3268<\/p>\n<\/td>\n<td>\n<p>1.3242<\/p>\n<\/td>\n<td>\n<p>1.3257<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 06:00:00<\/p>\n<\/td>\n<td>\n<p>1.3259<\/p>\n<\/td>\n<td>\n<p>1.3271<\/p>\n<\/td>\n<td>\n<p>1.3256<\/p>\n<\/td>\n<td>\n<p>1.3266<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 12:00:00<\/p>\n<\/td>\n<td>\n<p>1.3265<\/p>\n<\/td>\n<td>\n<p>1.3275<\/p>\n<\/td>\n<td>\n<p>1.3256<\/p>\n<\/td>\n<td>\n<p>1.3264<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>20\/09\/19 18:00:00<\/p>\n<\/td>\n<td>\n<p>1.3262<\/p>\n<\/td>\n<td>\n<p>1.3299<\/p>\n<\/td>\n<td>\n<p>1.3254<\/p>\n<\/td>\n<td>\n<p>1.3255<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>21\/09\/19 00:00:00<\/p>\n<\/td>\n<td>\n<p>1.3253<\/p>\n<\/td>\n<td>\n<p>1.3278<\/p>\n<\/td>\n<td>\n<p>1.3251<\/p>\n<\/td>\n<td>\n<p>1.3261<\/p>\n<\/td>\n<td>\n<p>USD_CAD_6H<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 \u043f\u043e\u0438\u0441\u043a\u0430. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043c \u043b\u0435\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e, \u0442.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043a\u0438\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0437\u0430\u0442\u0435\u043c \u0433\u043e\u043b\u043e\u0432\u0443, \u0442.\u0435. \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430, \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u043d\u043e\u043c,  \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e, \u043e\u043d\u043e \u0436\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u0430, \u0438 \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e, \u0442.\u0435. \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430, \u043d\u043e \u043d\u0438\u0436\u0435 \u0433\u043e\u043b\u043e\u0432\u044b. \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0447\u0442\u043e \u0433\u043e\u043b\u043e\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430, \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u0430, \u0447\u0442\u043e \u0431 \u0444\u0438\u0433\u0443\u0440\u0430 \u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0433\u043e\u043b\u043e\u0432\u0430 \u0438 \u043f\u043b\u0435\u0447\u0438, \u0430 \u043d\u0435 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u0438\u0437 \u0430\u043d\u0430\u0442\u043e\u043c\u0438\u0438 \u0438 \u2026 \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0432\u0435\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e &#171;\u043f\u0440\u043e\u0431\u044c\u0435\u0442&#187; \u0434\u043d\u043e, \u0442.\u0435. \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0438\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043d\u0430. \u041f\u0440\u043e\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0441\u0432\u0435\u0447\u043a\u043e\u0439. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0442 \u0433\u043e\u043b\u043e\u0432\u044b \u0434\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043d\u0430 \u043e\u0442 \u0443\u0440\u043e\u0432\u043d\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0441\u0432\u0435\u0447\u043a\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043f\u043e\u0434\u043d\u044f\u0432\u0448\u0438\u0441\u044c \u0432\u044b\u0448\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430 (\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0441\u0442\u043e\u043f \u043b\u043e\u0441\u0441\u0430).  \u041f\u0440\u043e\u0448\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u043e\u043b\u043e\u0432\u044b \u0432 \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0448\u0430\u0433, \u0442.\u0435. \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0432\u0435\u0447\u0430, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u0434\u0430, \u0445\u043e\u0442\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0438 H&amp;S \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 (\u0430\u0432\u0442\u043e\u0440 \u044d\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442).<\/p>\n<pre><code>#\u043b\u0438\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b list_H_AND_S=[] #\u043b\u0438\u0441\u0442 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 (\u0444\u0438\u0433\u0443\u0440\u0430 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430, \u0434\u0435\u043d\u0435\u0433 \u043d\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u0430, \u0430  \u0443\u043d\u0435\u0441\u043b\u0430) list_NOT_H_AND_S=[]                                                 for i in range(600,len(df_ALL['CLOSE'])-600):          # \u043d\u0430\u0439\u0434\u0435\u043c \u043b\u0435\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e, \u0442.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c      if  max(df_ALL['HIGH'][i-30:i+15])==df_ALL['HIGH'][i]:                  #\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u043e\u043b\u043e\u0432\u044b \u0441 \u0448\u0430\u0433\u043e\u043c \u0432 15, \u0447\u0442\u043e \u0431 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u0430         for z in range (15,200,15):               left_shoulder=max(df_ALL['HIGH'][i-30:i+15])                          # \u0438\u043d\u0434\u0435\u043a\u0441 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430             left_shoulder_index=df_ALL['HIGH'][i-30:i+15].idxmax()                          # \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0439\u0434\u0435\u043c \u0433\u043e\u043b\u043e\u0432\u0443, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0436 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0448\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430             if max(df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1])&gt;left_shoulder and\\             (left_shoulder-min(df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1]))\/((max(df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1])-min(df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1])))&gt;=0.6:                      head=max(df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1])                                  # \u0438\u043d\u0434\u0435\u043a\u0441 \u0433\u043e\u043b\u043e\u0432\u044b                 head_index=df_ALL['HIGH'][df_ALL['LOW'][left_shoulder_index:left_shoulder_index+z+1].idxmin():left_shoulder_index+z+1].idxmax()                 for b in range (15,200,15):                      # \u043f\u0435\u0440\u0432\u043e\u0435 \u0434\u043d\u043e, \u0442.\u0435. \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0436\u0434\u0443 \u043b\u0435\u0432\u044b\u043c \u043f\u043b\u0435\u0447\u043e\u043c \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u0439                     first_bottom= min(df_ALL['LOW'][left_shoulder_index:head_index+1])                      # \u0438\u043d\u0434\u0435\u043a\u0441 1-\u043e\u0433\u043e \u0434\u043d\u044f                     first_bottom_index=df_ALL['LOW'][left_shoulder_index:head_index+1].idxmin()                                          # \u043d\u0430\u0439\u0434\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e                     if min(df_ALL['LOW'][head_index:head_index+b])&lt;first_bottom and \\                     (head-first_bottom)\/(head-min(df_ALL['LOW'][head_index:head_index+b]))&gt;=0.5:                         second_bottom= min(df_ALL['LOW'][head_index:head_index+b])                          # \u0438\u043d\u0434\u0435\u043a\u0441 2-\u043e\u0433\u043e \u0434\u043d\u0430                         second_bottom_index=df_ALL['LOW'][head_index:head_index+b].idxmin()                                         for o in range(2,300):                             # max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1]) - \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e                             if max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1])&gt;=left_shoulder and \\                             max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1])&lt;head and \\                             second_bottom_index+o-df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax()&gt;0 and \\                             (second_bottom_index+o+1)-df_ALL['LOW'][df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax()]&gt;2 and \\                             min(df_ALL['LOW'][df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax():second_bottom_index+o+1])==df_ALL['LOW'][second_bottom_index+o] and \\                             min(df_ALL['LOW'][df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax():second_bottom_index+o])&gt;second_bottom and \\                             df_ALL['CLOSE'][second_bottom_index+o]&lt;second_bottom and \\                             min(df_ALL['LOW'][second_bottom_index:df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1].idxmax()+1])==second_bottom and \\                             min(df_ALL['LOW'][left_shoulder_index:head_index])==first_bottom and \\                             max(df_ALL['HIGH'][first_bottom_index:second_bottom_index+1])==head and \\                             df_ALL['CLOSE'][second_bottom_index+o]-df_ALL['OPEN'][second_bottom_index+o]&lt;=0:                                                                  # \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0446\u0438\u043a\u043b \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430\u043c, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e H$S \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u043d\u043e\u0439                                 for x in range (2,300):                                     # \u0447\u0442\u043e \u0431 \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u0431\u044b\u043b\u044c, \u0433\u0440\u0430\u0444\u0438\u043a \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u044b\u0448\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0447\u0430 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u043d\u0438\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043d\u0430                                     # \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 (\u0433\u043e\u043b\u043e\u0432\u0430-\u0432\u0442\u043e\u0440\u043e\u0435 \u0434\u043d\u043e)*2. \u042d\u0442\u0430 \u0442\u043e\u0447\u043a\u0430 \u043f\u043e \u0438\u0434\u0435\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u0437\u044f\u0442\u0438\u044f \u043f\u0440\u0438\u0431\u044b\u043b\u0438, \u0430                                     # \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043b\u0435\u0447\u043e - \u0441\u0442\u043e\u043f \u043b\u043e\u0441\u0441\u043e\u043c                                     if max(df_ALL['HIGH'][second_bottom_index+o:second_bottom_index+o+x+1])&lt;=max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1]) and \\                                     min(df_ALL['LOW'][second_bottom_index+o:second_bottom_index+o+x+1])&lt;=second_bottom-(head-second_bottom)*2:                                         if (df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) not in list_H_AND_S:                                             list_H_AND_S.append(df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index]))                                                                                                                      elif max(df_ALL['HIGH'][second_bottom_index+o:second_bottom_index+o+x+1])&gt;max(df_ALL['HIGH'][second_bottom_index:second_bottom_index+o+1]) and \\                                     min(df_ALL['LOW'][second_bottom_index+o:second_bottom_index+o+x+1])&gt;first_bottom-(head-second_bottom):                                          if (df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) not in list_NOT_H_AND_S and \\                                         (df_ALL['TIME'][left_shoulder_index]+' '+ df_ALL['TIME'][head_index]+' '+df_ALL['TIME'][second_bottom_index]+' '+df_ALL['TIME'][second_bottom_index+o]+' '+df_ALL['TITLE'][i]+' '+df_ALL['TITLE'][second_bottom_index+o]+' '+str(df_ALL['CLOSE'][o+second_bottom_index]-df_ALL['OPEN'][o+second_bottom_index])) not in list_H_AND_S:<\/code><\/pre>\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-316378","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316378","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=316378"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316378\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}