Lyapunov_HP

Download script
Author: Copyright 2018, MetaQuotes Software Corp.
Price Data Components
Indicators Used
Moving average indicator
8 Views
0 Downloads
0 Favorites
Lyapunov_HP
ÿþ/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�/�/�|� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �L�y�a�p�u�n�o�v�_�H�P�.�m�q�5� �|�
�
�/�/�|� � � � � � � � � � � � � � � � � � � � � � � � �C�o�p�y�r�i�g�h�t� �2�0�1�8�,� �M�e�t�a�Q�u�o�t�e�s� �S�o�f�t�w�a�r�e� �C�o�r�p�.� �|�
�
�/�/�|� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �h�t�t�p�s�:�/�/�m�q�l�5�.�c�o�m� �|�
�
�/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�#�p�r�o�p�e�r�t�y� �c�o�p�y�r�i�g�h�t� �"�C�o�p�y�r�i�g�h�t� �2�0�1�8�,� �M�e�t�a�Q�u�o�t�e�s� �S�o�f�t�w�a�r�e� �C�o�r�p�.�"�
�
�#�p�r�o�p�e�r�t�y� �l�i�n�k� � � � � � �"�h�t�t�p�s�:�/�/�m�q�l�5�.�c�o�m�"�
�
�#�p�r�o�p�e�r�t�y� �v�e�r�s�i�o�n� � � �"�1�.�0�0�"�
�
�#�p�r�o�p�e�r�t�y� �d�e�s�c�r�i�p�t�i�o�n� �"�L�y�a�p�u�n�o�v� �H�P� �o�s�c�i�l�l�a�t�o�r�"�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�s�e�p�a�r�a�t�e�_�w�i�n�d�o�w�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�b�u�f�f�e�r�s� �6�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�p�l�o�t�s� � � �1�
�
�/�/�-�-�-� �p�l�o�t� �H�P�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�l�a�b�e�l�1� � �"�H�P�"�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�t�y�p�e�1� � � �D�R�A�W�_�L�I�N�E�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�c�o�l�o�r�1� � �c�l�r�C�r�i�m�s�o�n�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�s�t�y�l�e�1� � �S�T�Y�L�E�_�S�O�L�I�D�
�
�#�p�r�o�p�e�r�t�y� �i�n�d�i�c�a�t�o�r�_�w�i�d�t�h�1� � �1�
�
�/�/�-�-�-� �i�n�p�u�t� �p�a�r�a�m�e�t�e�r�s�
�
�i�n�p�u�t� �u�i�n�t� � � � � � � � � � � � � � � � � �I�n�p�F�i�l�t�e�r� � � � � � � � � �=� � �7�;� � � � � � � � � � � � � �/�/� �F�i�l�t�e�r�
�
�i�n�p�u�t� �E�N�U�M�_�A�P�P�L�I�E�D�_�P�R�I�C�E� � � �I�n�p�A�p�p�l�i�e�d�P�r�i�c�e� � � �=� � �P�R�I�C�E�_�C�L�O�S�E�;� � � �/�/� �A�p�p�l�i�e�d� �p�r�i�c�e�
�
�/�/�-�-�-� �i�n�d�i�c�a�t�o�r� �b�u�f�f�e�r�s�
�
�d�o�u�b�l�e� � � � � � � � � �B�u�f�f�e�r�H�P�[�]�;�
�
�d�o�u�b�l�e� � � � � � � � � �B�u�f�f�e�r�H�[�]�;�
�
�d�o�u�b�l�e� � � � � � � � � �B�u�f�f�e�r�A�[�]�;�
�
�d�o�u�b�l�e� � � � � � � � � �B�u�f�f�e�r�B�[�]�;�
�
�d�o�u�b�l�e� � � � � � � � � �B�u�f�f�e�r�C�[�]�;�
�
�d�o�u�b�l�e� � � � � � � � � �B�u�f�f�e�r�M�A�[�]�;�
�
�/�/�-�-�-� �g�l�o�b�a�l� �v�a�r�i�a�b�l�e�s�
�
�i�n�t� � � � � � � � � � � � �f�i�l�t�e�r�;�
�
�i�n�t� � � � � � � � � � � � �h�a�n�d�l�e�_�m�a�;�
�
�d�o�u�b�l�e� � � � � � � � � �l�a�m�b�d�a�;�
�
�/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�/�/�|� �C�u�s�t�o�m� �i�n�d�i�c�a�t�o�r� �i�n�i�t�i�a�l�i�z�a�t�i�o�n� �f�u�n�c�t�i�o�n� � � � � � � � � � � � � � � � � � � � � � � � � �|�
�
�/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�i�n�t� �O�n�I�n�i�t�(�)�
�
� � �{�
�
�/�/�-�-�-� �s�e�t� �g�l�o�b�a�l� �v�a�r�i�a�b�l�e�s�
�
� � � �f�i�l�t�e�r�=�i�n�t�(�I�n�p�F�i�l�t�e�r�<�2� �?� �2� �:� �I�n�p�F�i�l�t�e�r�)�;�
�
� � � �l�a�m�b�d�a�=�0�.�0�6�2�5�/�p�o�w�(�s�i�n�(�M�_�P�I�/�f�i�l�t�e�r�)�,�4�)�;�
�
�/�/�-�-�-� �i�n�d�i�c�a�t�o�r� �b�u�f�f�e�r�s� �m�a�p�p�i�n�g�
�
� � � �S�e�t�I�n�d�e�x�B�u�f�f�e�r�(�0�,�B�u�f�f�e�r�H�P�,�I�N�D�I�C�A�T�O�R�_�D�A�T�A�)�;�
�
� � � �S�e�t�I�n�d�e�x�B�u�f�f�e�r�(�1�,�B�u�f�f�e�r�H�,�I�N�D�I�C�A�T�O�R�_�C�A�L�C�U�L�A�T�I�O�N�S�)�;�
�
� � � �S�e�t�I�n�d�e�x�B�u�f�f�e�r�(�2�,�B�u�f�f�e�r�A�,�I�N�D�I�C�A�T�O�R�_�C�A�L�C�U�L�A�T�I�O�N�S�)�;�
�
� � � �S�e�t�I�n�d�e�x�B�u�f�f�e�r�(�3�,�B�u�f�f�e�r�B�,�I�N�D�I�C�A�T�O�R�_�C�A�L�C�U�L�A�T�I�O�N�S�)�;�
�
� � � �S�e�t�I�n�d�e�x�B�u�f�f�e�r�(�4�,�B�u�f�f�e�r�C�,�I�N�D�I�C�A�T�O�R�_�C�A�L�C�U�L�A�T�I�O�N�S�)�;�
�
� � � �S�e�t�I�n�d�e�x�B�u�f�f�e�r�(�5�,�B�u�f�f�e�r�M�A�,�I�N�D�I�C�A�T�O�R�_�C�A�L�C�U�L�A�T�I�O�N�S�)�;�
�
�/�/�-�-�-� �s�e�t�t�i�n�g� �i�n�d�i�c�a�t�o�r� �p�a�r�a�m�e�t�e�r�s�
�
� � � �I�n�d�i�c�a�t�o�r�S�e�t�S�t�r�i�n�g�(�I�N�D�I�C�A�T�O�R�_�S�H�O�R�T�N�A�M�E�,�"�L�H�P�o�s�c�(�"�+�(�s�t�r�i�n�g�)�f�i�l�t�e�r�+�"�)�"�)�;�
�
� � � �I�n�d�i�c�a�t�o�r�S�e�t�I�n�t�e�g�e�r�(�I�N�D�I�C�A�T�O�R�_�D�I�G�I�T�S�,�D�i�g�i�t�s�(�)�)�;�
�
�/�/�-�-�-� �s�e�t�t�i�n�g� �b�u�f�f�e�r� �a�r�r�a�y�s� �a�s� �t�i�m�e�s�e�r�i�e�s�
�
� � � �A�r�r�a�y�S�e�t�A�s�S�e�r�i�e�s�(�B�u�f�f�e�r�H�P�,�t�r�u�e�)�;�
�
� � � �A�r�r�a�y�S�e�t�A�s�S�e�r�i�e�s�(�B�u�f�f�e�r�H�,�t�r�u�e�)�;�
�
� � � �A�r�r�a�y�S�e�t�A�s�S�e�r�i�e�s�(�B�u�f�f�e�r�A�,�t�r�u�e�)�;�
�
� � � �A�r�r�a�y�S�e�t�A�s�S�e�r�i�e�s�(�B�u�f�f�e�r�B�,�t�r�u�e�)�;�
�
� � � �A�r�r�a�y�S�e�t�A�s�S�e�r�i�e�s�(�B�u�f�f�e�r�C�,�t�r�u�e�)�;�
�
� � � �A�r�r�a�y�S�e�t�A�s�S�e�r�i�e�s�(�B�u�f�f�e�r�M�A�,�t�r�u�e�)�;�
�
�/�/�-�-�-� �c�r�e�a�t�e� �M�A� �h�a�n�d�l�e�
�
� � � �R�e�s�e�t�L�a�s�t�E�r�r�o�r�(�)�;�
�
� � � �h�a�n�d�l�e�_�m�a�=�i�M�A�(�N�U�L�L�,�P�E�R�I�O�D�_�C�U�R�R�E�N�T�,�1�,�0�,�M�O�D�E�_�S�M�A�,�I�n�p�A�p�p�l�i�e�d�P�r�i�c�e�)�;�
�
� � � �i�f�(�h�a�n�d�l�e�_�m�a�=�=�I�N�V�A�L�I�D�_�H�A�N�D�L�E�)�
�
� � � � � �{�
�
� � � � � � �P�r�i�n�t�(�"�T�h�e� �i�M�A�(�1�)� �o�b�j�e�c�t� �w�a�s� �n�o�t� �c�r�e�a�t�e�d�:� �E�r�r�o�r� �"�,�G�e�t�L�a�s�t�E�r�r�o�r�(�)�)�;�
�
� � � � � � �r�e�t�u�r�n� �I�N�I�T�_�F�A�I�L�E�D�;�
�
� � � � � �}�
�
�/�/�-�-�-�
�
� � � �r�e�t�u�r�n�(�I�N�I�T�_�S�U�C�C�E�E�D�E�D�)�;�
�
� � �}�
�
�/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�/�/�|� �C�u�s�t�o�m� �i�n�d�i�c�a�t�o�r� �i�t�e�r�a�t�i�o�n� �f�u�n�c�t�i�o�n� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �|�
�
�/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�i�n�t� �O�n�C�a�l�c�u�l�a�t�e�(�c�o�n�s�t� �i�n�t� �r�a�t�e�s�_�t�o�t�a�l�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �i�n�t� �p�r�e�v�_�c�a�l�c�u�l�a�t�e�d�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �d�a�t�e�t�i�m�e� �&�t�i�m�e�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �d�o�u�b�l�e� �&�o�p�e�n�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �d�o�u�b�l�e� �&�h�i�g�h�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �d�o�u�b�l�e� �&�l�o�w�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �d�o�u�b�l�e� �&�c�l�o�s�e�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �l�o�n�g� �&�t�i�c�k�_�v�o�l�u�m�e�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �l�o�n�g� �&�v�o�l�u�m�e�[�]�,�
�
� � � � � � � � � � � � � � � � �c�o�n�s�t� �i�n�t� �&�s�p�r�e�a�d�[�]�)�
�
� � �{�
�
�/�/�-�-�-� �@>25@:0 �=0 �<8=8<0;L=>5 �:>;85AB2> �10@>2 �4;O �@0AGQB0
�
� � � �i�f�(�r�a�t�e�s�_�t�o�t�a�l�<�3�)� �r�e�t�u�r�n� �0�;�
�
�/�/�-�-�-� �@>25@:0 �8 �@0AGQB �:>;8G5AB20 �?@>AG8BK205<KE �10@>2
�
� � � �i�n�t� �l�i�m�i�t�=�r�a�t�e�s�_�t�o�t�a�l�-�p�r�e�v�_�c�a�l�c�u�l�a�t�e�d�;�
�
� � � �i�n�t� �l�i�m�i�t�1�=�r�a�t�e�s�_�t�o�t�a�l�-�2�;�
�
� � � �i�f�(�l�i�m�i�t�>�1�)�
�
� � � � � �{�
�
� � � � � � �l�i�m�i�t�=�r�a�t�e�s�_�t�o�t�a�l�-�1�;�
�
� � � � � � �A�r�r�a�y�I�n�i�t�i�a�l�i�z�e�(�B�u�f�f�e�r�H�P�,�E�M�P�T�Y�_�V�A�L�U�E�)�;�
�
� � � � � � �A�r�r�a�y�I�n�i�t�i�a�l�i�z�e�(�B�u�f�f�e�r�H�,�0�)�;�
�
� � � � � � �A�r�r�a�y�I�n�i�t�i�a�l�i�z�e�(�B�u�f�f�e�r�A�,�6�*�l�a�m�b�d�a�+�1�)�;�
�
� � � � � � �A�r�r�a�y�I�n�i�t�i�a�l�i�z�e�(�B�u�f�f�e�r�B�,�-�4�*�l�a�m�b�d�a�)�;�
�
� � � � � � �A�r�r�a�y�I�n�i�t�i�a�l�i�z�e�(�B�u�f�f�e�r�C�,�l�a�m�b�d�a�)�;�
�
� � � � � � �A�r�r�a�y�I�n�i�t�i�a�l�i�z�e�(�B�u�f�f�e�r�M�A�,�0�)�;�
�
� � � � � �}�
�
�/�/�-�-�-� �>43>B>2:0 �40==KE
�
� � � �i�n�t� �c�o�p�i�e�d�=�0�,�c�o�u�n�t�=�(�l�i�m�i�t�=�=�0� �?� �1� �:� �r�a�t�e�s�_�t�o�t�a�l�)�;�
�
� � � �c�o�p�i�e�d�=�C�o�p�y�B�u�f�f�e�r�(�h�a�n�d�l�e�_�m�a�,�0�,�0�,�c�o�u�n�t�,�B�u�f�f�e�r�M�A�)�;�
�
� � � �i�f�(�c�o�p�i�e�d�!�=�c�o�u�n�t�)� �r�e�t�u�r�n� �0�;�
�
�
�
� � � �B�u�f�f�e�r�A�[�0�]�=�1�+�l�a�m�b�d�a�;�
�
� � � �B�u�f�f�e�r�B�[�0�]�=�-�2�*�l�a�m�b�d�a�;�
�
� � � �B�u�f�f�e�r�C�[�0�]�=�l�a�m�b�d�a�;�
�
� � � �f�o�r�(�i�n�t� �i�=�l�i�m�i�t�1�;� �i�>�0�;� �i�-�-�)�
�
� � � � � �{�
�
� � � � � � �B�u�f�f�e�r�A�[�i�]�=�6�*�l�a�m�b�d�a�+�1�;�
�
� � � � � � �B�u�f�f�e�r�B�[�i�]�=�-�4�*�l�a�m�b�d�a�;�
�
� � � � � � �B�u�f�f�e�r�C�[�i�]�=�l�a�m�b�d�a�;�
�
� � � � � �}�
�
� � � �B�u�f�f�e�r�A�[�1�]�=�5�*�l�a�m�b�d�a�+�1�;�
�
� � � �B�u�f�f�e�r�A�[�l�i�m�i�t�1�]�=�1�+�l�a�m�b�d�a�;�
�
� � � �B�u�f�f�e�r�A�[�l�i�m�i�t�1�-�1�]�=�5�*�l�a�m�b�d�a�+�1�;�
�
� � � �B�u�f�f�e�r�B�[�l�i�m�i�t�1�-�1�]�=�-�2�*�l�a�m�b�d�a�;�
�
� � � �B�u�f�f�e�r�B�[�l�i�m�i�t�1�]�=�0�;�
�
� � � �B�u�f�f�e�r�C�[�l�i�m�i�t�1�-�1�]�=�0�;�
�
� � � �B�u�f�f�e�r�C�[�l�i�m�i�t�1�]�=�0�;�
�
�
�
� � � �d�o�u�b�l�e� �H�1�=�0�;�
�
� � � �d�o�u�b�l�e� �H�2�=�0�;�
�
� � � �d�o�u�b�l�e� �H�3�=�0�;�
�
� � � �d�o�u�b�l�e� �H�4�=�0�;�
�
� � � �d�o�u�b�l�e� �H�5�=�0�;�
�
� � � �d�o�u�b�l�e� �H�H�1�=�0�;�
�
� � � �d�o�u�b�l�e� �H�H�2�=�0�;�
�
� � � �d�o�u�b�l�e� �H�H�3�=�0�;�
�
� � � �d�o�u�b�l�e� �H�H�4�=�0�;�
�
� � � �d�o�u�b�l�e� �H�H�5�=�0�;�
�
� � � �d�o�u�b�l�e� �H�B�=�0�;�
�
� � � �d�o�u�b�l�e� �H�C�=�0�;�
�
� � � �d�o�u�b�l�e� �Z�=�0�;�
�
�
�
� � � �f�o�r�(�i�n�t� �i�=�0�;� �i�<�=�l�i�m�i�t�1�;� �i�+�+�)�
�
� � � � � �{�
�
� � � � � � �Z�=�B�u�f�f�e�r�A�[�i�]�-�H�4�*�H�1�-�H�H�5�*�H�H�2�;�
�
� � � � � � �H�B�=�B�u�f�f�e�r�B�[�i�]�;�
�
� � � � � � �H�H�1�=�H�1�;�
�
� � � � � � �H�1�=�(�H�B�-�H�4�*�H�2�)�/�(�Z�!�=�0� �?� �Z� �:� �D�B�L�_�M�I�N�)�;�
�
� � � � � � �B�u�f�f�e�r�B�[�i�]�=�H�1�;�
�
� � � � � � �H�C�=�B�u�f�f�e�r�C�[�i�]�;�
�
� � � � � � �H�H�2�=�H�2�;�
�
� � � � � � �H�2�=�H�C�/�(�Z�!�=�0� �?� �Z� �:� �D�B�L�_�M�I�N�)�;�
�
� � � � � � �B�u�f�f�e�r�C�[�i�]�=�H�2�;�
�
� � � � � � �B�u�f�f�e�r�A�[�i�]�=�(�B�u�f�f�e�r�M�A�[�i�]�-�H�H�3�*�H�H�5�-�H�3�*�H�4�)�/�(�Z�!�=�0� �?� �Z� �:� �D�B�L�_�M�I�N�)�;�
�
� � � � � � �H�H�3�=�H�3�;�
�
� � � � � � �H�3�=�B�u�f�f�e�r�A�[�i�]�;�
�
� � � � � � �H�4�=�H�B�-�H�5�*�H�H�1�;�
�
� � � � � � �H�H�5�=�H�5�;�
�
� � � � � � �H�5�=�H�C�;�
�
� � � � � �}�
�
� � � �H�2�=�0�;�
�
� � � �H�1�=�B�u�f�f�e�r�A�[�l�i�m�i�t�1�-�1�]�;�
�
� � � �B�u�f�f�e�r�H�[�l�i�m�i�t�1�-�1�]�=�H�1�;�
�
�
�
� � � �f�o�r�(�i�n�t� �i�=�l�i�m�i�t�1�-�2�;� �i�>�=�0�;� �i�-�-�)�
�
� � � � � �{�
�
� � � � � � �B�u�f�f�e�r�H�[�i�]�=�B�u�f�f�e�r�A�[�i�]�-�B�u�f�f�e�r�B�[�i�]�*�H�1�-�B�u�f�f�e�r�C�[�i�]�*�H�2�;�
�
� � � � � � �H�2�=�H�1�;�
�
� � � � � � �H�1�=�B�u�f�f�e�r�H�[�i�]�;�
�
� � � � � �}�
�
�
�
�/�/�-�-�-� � 0AGQB �8=48:0B>@0
�
� � � �f�o�r�(�i�n�t� �i�=�0�;� �i�<�l�i�m�i�t�1�-�2�;� �i�+�+�)�
�
� � � � � �{�
�
� � � � � � �d�o�u�b�l�e� �v�=�B�u�f�f�e�r�H�[�i�+�1�]�;�
�
� � � � � � �B�u�f�f�e�r�H�P�[�i�]�=�M�a�t�h�L�o�g�(�M�a�t�h�A�b�s�(�B�u�f�f�e�r�H�[�i�]�/�(�v�!�=�0� �?� �v� �:� �D�B�L�_�M�I�N�)�)�)�*�1�0�0�0�0�0�;�
�
� � � � � �}�
�
�/�/�-�-�-� �r�e�t�u�r�n� �v�a�l�u�e� �o�f� �p�r�e�v�_�c�a�l�c�u�l�a�t�e�d� �f�o�r� �n�e�x�t� �c�a�l�l�
�
� � � �r�e�t�u�r�n�(�r�a�t�e�s�_�t�o�t�a�l�)�;�
�
� � �}�
�
�/�/�+�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�+�
�
�

Comments