Tools for automated statistical analysis

This is a tool for statistical analysis of price time series.

For a price time series that lasts for more than three years, it is difficult for the human brain to process it in a short period of time. If you enlarge the picture, you cannot see part of it and you cannot know the specific price. If you shrink the picture, it will easily obscure the view. How can you use the naked eye? It is difficult for ordinary people to distinguish between price situations in different years and so on.

So in order to quickly understand the basic situation of a time series, I wrote the relevant code to quickly count the time series information in a table. For detailed results and applications, you can read this article .

how to use

  1. Environment : There is a python-based programming environment (you can use anaconda), and use jupyter to open the ipynb file.
  2. Data file : Place the data file in the same directory as the .ipynb file. Please do not have redundant rows and columns in it. Please Date, Open, High, Low, Close, Volume, Market Caparrange it according to the order (although only Date and Close are used). It is case-sensitive. If you have your own needs, please rewrite it yourself.
  3. Modify symbol : Assign the value behind symbol to the name of the data file, and press the corresponding button to run it.

what can be done

  1. Basic statistical analysis (maximum daily rate of return, minimum daily rate of return, time and amplitude of daily one-way fluctuations greater than 10%, number of positive lines, number of negative lines, maximum number of consecutive increases, maximum number of consecutive declines)
  2. Consecutive profit and loss days bar chart
  3. Daily yield fluctuation chart, monthly yield fluctuation chart
  4. Yield distribution chart
  5. Large rate of return time distribution chart
  6. annual cycle chart
  7. Average monthly return and winning odds chart
  8. Monthly cumulative return chart
  9. Loop analysis of data of many varieties

What might be updated next?

  • The code that calculates the number of consecutive profit and loss days runs slowly, in order to optimize
  • Since it was originally written to count Bitcoin data, for commodity futures with a price limit system, some aspects were not considered in order to optimize
  • Generate more data ( please leave a message if you have other interesting data )
  • Made into html, convenient for people without programming foundation and environment to use

PS

When testing commodity futures data, it was found that rebar has significant monthly characteristics:

The relevant code has been put into github , please download it yourself.

おすすめ

転載: blog.csdn.net/food_for_thought/article/details/112964615