[PYTHON] I want to find a stock that will rise 5 minutes after the Nikkei Stock Average rises


Synopsis
** Nikkei Stock Average **: The average stock price of 225 stocks selected from the Tokyo Stock Exchange, which boasts the third largest scale in the world, and the companies listed on the first section.

If it is a stock index that represents the Japanese stock market, isn't it okay to have ** stocks that go up (fall) together with the price movements **? I have verified the question before. "I want to find a stock that will rise the day after the Nikkei Stock Average rises" This verification is a sequel to the above and compares price movements in minutes.

[Question] ・ Is it possible to observe the effect of the Nikkei Stock Average on individual stocks in minutes?

[Conclusion] ・ The Nikkei Stock Average does not affect individual stocks ・ It is easier to observe the tendency on a daily basis than on a minute basis.

Trigger

To summarize the contents of the previous verification "I want to find a stock that will rise the day after the Nikkei Stock Average rises"

  1. Question (1): Are there any stocks that go up with the Nikkei Stock Average?
  2. Verification (1): Investigate whether individual stocks have risen ** the day before/the next day ** when the Nikkei Stock Average rose
  3. Result (1): The probability that the individual stock will rise the day before and the Nikkei average will rise the next day is higher than the probability that the individual stock will be included in the price movement of the Nikkei average.
  4. Question (2): The majority of 225 stocks have risen, is there a high probability that the Nikkei Stock Average will rise the next day?
  5. Verification (2): Investigate the relationship between the number of individual stocks that have risen and the Nikkei Stock Average the next day
  6. Result (2): The day after the day when there are many individual stocks that have risen in the short term, the Nikkei Stock Average will rise, but if the verification period is lengthened, it will converge to 50%.
  7. ** Conclusion: The price movement of individual stocks on the previous day does not affect the price movement of the Nikkei Stock Average on the next day **

In the above verification, in order to know whether the Nikkei Stock Average affects individual stocks, we verified with daily data. However, "In the world of investment, the period of one day is very long, and it may not be possible to read the impact on individual stocks." I wondered, "Is it a smaller stock that is affected by the price movement of the Nikkei Stock Average?" (maybe not received in the first place ...)

So, this time, I would like to investigate whether the Nikkei Stock Average affects individual stocks on a minute-by-minute basis **.

Method of verification

The verification method is the same as last time, but the target issue and period will be changed.
Verification items
Check if a stock has risen (falled) when the Nikkei Stock Average has risen (falls) in the following three patterns.

  1. Did the Nikkei Stock Average rise at the same time **?
  2. Will the Nikkei Stock Average rise to ** 1 minute later **?
  3. Did the Nikkei Stock Average rise ** 1 minute ago **?

If it moves in the same direction, it will be ** 1 point **, and the total points for a certain period will be calculated for each brand. After that, the match rate [%] = total points/period x 100 to calculate the ** match rate of price movements **.

In addition to the 1-minute unit, the verification is performed in 5-minute units.


Target brand
・ All 225 stocks that make up the Nikkei Stock Average ・ All 333 stocks listed on TSE Mothers


Period
・ December 7, 2020-December 11, 2020 ・ December 14, 2020-December 18, 2020, 10 days in total

[Example] ▼ For pattern 1 (match rate: 50.0%) example1.png

▼ Pattern 2/Pattern 3 (Match rate: 33.3% for both) example2.png

result

[Parameter] Verification period: December 7th to December 11th, 2020, December 14th to December 18th, 2020 Verification interval: 1 minute, 5 minutes Comparison stocks: Nikkei 225 stocks, TSE Mothers 333 stocks

Pattern 1. Did the Nikkei Stock Average rise at the same time **? Pattern 2. The Nikkei Stock Average has risen, will it rise ** 1 minute later **? Pattern 3. Did the Nikkei Stock Average rise ** 1 minute ago **?

【result】 The table of verification results is shown below, but it can be summarized briefly. ・ Since Mothers has a smaller trading volume than the Nikkei Stock Average, the match rate is low in minutes (there is no price movement in the first place). ⇒ Even if there is no price movement, the match rate is low because it was set to 0 points, but it can be said that this is ** not linked to the price movement of the Nikkei Stock Average **. ・ If the comparison time is shifted as in patterns 2 and 3 regardless of the 1-minute interval/5-minute interval, the maximum match rate is about 55% for all periods and all brands **. ・ At the same time in pattern 1, the coincidence rate of price movements is less than 50% in most cases. ⇒ In the previous verification conducted at 1-day intervals, there was a 70% match on the same day, but in the case of ** minutes, it moves in different directions ** ・ Comparing pattern 1 and patterns 2 and 3, the match rate decreases by about 6% at 1-minute intervals and about 13% at 5-minute intervals for both 2 and 3 (about 20% decrease at the previous 1-day interval). ⇒ When comparing the same time and the case of shifting, the longer the verification interval, the greater the decrease in the match rate.

▼ Median match rate ** when the verification interval is ** 1 minute ** result_1m.png

▼ Median match rate ** when the verification interval is ** 5 minutes ** result_5m.png

▼ ** Match rate histogram ** when the verification interval is ** 1 minute ** result_hist_1m.png

▼ ** Match rate histogram ** when the verification interval is ** 5 minutes ** result_hist_5m.png

Summary

Continuing from the previous verification, we verified "** Does the Nikkei Stock Average affect individual stocks **?" ・ In the world of investment, the period of one day is very long, and it may not be possible to read the impact on individual stocks. ・ Is it a smaller stock that is affected by the price movement of the Nikkei Stock Average? From the question, we divided the verification data into minutes and added Mothers listed stocks to the verification stocks for verification. However, the result was ** the agreement rate with the price movement of the Nikkei Stock Average was about 55% at the maximum **. (In the previous verification conducted at daily intervals, there were some stocks with a maximum match rate of over 80%.) ** You can see that there are stocks that move in different directions in minutes, but in the same direction in daily prices **. Therefore, I think it is easier to observe the tendency of each stock on a daily basis than on a minute basis.

I felt that the relationship between the Nikkei Stock Average and individual stocks was examined twice, but this time I conclude that the Nikkei Stock Average does not affect individual stocks. The lesson learned is that "** Verify the correlation of stock price movements on a daily basis **".


Conclusion
Question: ** Does the Nikkei Stock Average affect individual stocks? ** ** Answer: ** Do not give! ** ** Lesson: Daily is more likely than minutes

next

Since this verification does not consider the range of price movements of the Nikkei Stock Average, it may be interesting to focus on the verification when there is a large movement (0% or more). (This time, there was little data and it was only close to me that it moved a lot, so I could not verify it) Also, when examining the impact on the price movements of individual stocks in the future, I would like to consider the events that will have a slightly more indirect impact and may cause a time lag.
Example
・ Manufacturer and material cost ・ Agricultural stocks and weather forecast ・ Medical/tourism brands and the number of people infected with corona

Future plans ・ How many days should I set for a funded investment? ・ How much will it actually go up after the Golden Cross?

Recommended Posts

I want to find a stock that will rise 5 minutes after the Nikkei Stock Average rises
I want to identify the alert email. --Is that x a wildcard? ---
I want to easily find a delicious restaurant
The story of IPv6 address that I want to keep at a minimum
I wrote a script to revive the gulp watch that will die soon
I want to find a popular package on PyPi
The story of Linux that I want to teach myself half a year ago
I tried to find the average of the sequence with TensorFlow
I want to find the intersection of a Bezier curve and a straight line (Bezier Clipping method)
I want to create a Dockerfile for the time being.
Stock price plummeted with "new corona"? I tried to get the Nikkei Stock Average by web scraping
I want to record the execution time and keep a log.
I want to automatically find high-quality parts from the videos I shot
I want to use a wildcard that I want to shell with Python remove
MacBookPro Setup After all I want to do a clean installation
Qiskit: I want to create a circuit that creates arbitrary states! !!
I want to find the shortest route to travel through all points
I want to create a system to prevent forgetting to tighten the key 1
Scraping and tabelog ~ I want to find a good restaurant! ~ (Work)
[For beginners] I want to get the index of an element that satisfies a certain conditional expression
I tried to verify the best way to find a good marriage partner
I want to send a signal only from the sub thread to the main thread
I want to sort a list in the order of other lists
I made a library konoha that switches the tokenizer to a nice feeling
I tried to make a skill that Alexa will return as cold
Python: I want to measure the processing time of a function neatly
I want to pin Spyder to the taskbar
I want to output to the console coolly
I want to create an API that returns a model with a recursive relationship in the Django REST Framework
I want to print in a comprehension
I want to handle the rhyme part1
I want to handle the rhyme part3
I want to build a Python environment
I want to display the progress bar
I want to handle the rhyme part2
I want to handle the rhyme part5
I want to handle the rhyme part4
I used gawk to find out the maximum value that goes into NF.
I want to create a priority queue that can be updated in Python (2.7)
I want to make a music player and file music at the same time
I tried to predict the horses that will be in the top 3 with LightGBM
I want to set a life cycle in the task definition of ECS
I want to add silence to the beginning of a wav file for 1 second
I want to exe and distribute a program that resizes images Python3 + pyinstaller
I want to see a list of WebDAV files in the Requests module
I want to create a web application that uses League of Legends data ①
Find the ideal property by scraping! A few minutes walk from the property to the destination
I want to make matplotlib a dark theme
I want to easily create a Noise Model
I want to INSERT a DataFrame into MSSQL
I want to create a window in Python
I want to make a game with Python
I want to handle the rhyme part7 (BOW)
I don't want to take a coding test
I want to create a plug-in type implementation
[Python] I will upload the FTP to the FTP server.
I want to customize the appearance of zabbix
I want to write to a file with Python
I want to use the activation function Mish
I want to display the progress in Python!
I want to upload a Django app to heroku