Python time series question

In chronological price list Takayasu 1 ● Date Time High Low Low 2 ● Date Time High Low Low 3 ● Date Time High Low Low 4 ● Date Time High Low Low 5

1 is the oldest, 2,3,4 ... is the high and low price data every minute, can you teach me the programming method when you want to do the following?

① First, the high and low prices of 1 are defined as high 1 and low 1.

(2) High low price <high 1 and low price <low 1 are defined as high 2 and low 2 in chronological order.

③-1) After ② appears If a high low price such as high 1> high> low 2, low 2> low appears, the high price is "ha", the low price is "ni", the high 1 is "i", and the low 2 is "ro". Define and extract the date and time (or line number of the original data) and value corresponding to "i", "ro", "ha", and "ni" on another sheet (★)

For example

"I" "ro" "ha" "ni" Date Time High 1 (Number) Year Month Day Time Low 2 (Number) Year Month Day Time High Price (Number) Year Month Day Time Low Price (Number)

③-2) After ② appears If a high low price appears where high price> high 1> low price 2> low price, define the high price as "i" and define it as "i". Extract the date and time and high price (number) of "I" to a sheet (■) different from the sheet created in (3) -1) above.

④ After ③-1) and ③-2) above, return to ①, this time Skip the line 1 and define the high low price of 2 as high 1 and low 1 first, follow the process of ② to ③, and go to the sheet (★) (■) created in ③-1) and ③-2). I will add

⑤ Loop the process from ① to ④

And as a future prospect, I would like to make verification materials by changing the conditions for ② to ③ based on the molds ① to ⑤.

Recommended Posts

Python time series question
[Python] Plot time series data
Python: Time Series Analysis: Preprocessing Time Series Data
Time series plot started ~ python edition ~
First time python
python time measurement
First time python
[Python] Accelerates loading of time series CSV
Python: Time Series Analysis: Building a SARIMA Model
Get time series data from k-db.com in Python
Function execution time (Python)
Python: Time Series Analysis: Stationarity, ARMA / ARIMA Model
RNN_LSTM1 Time series analysis
Time series analysis 1 Basics
Output python execution time
Time floor function (Python)
python get current time
Python Mathematics Series ① Transpose
Display TOPIX time series
Time series plot / Matplotlib
Python 3.4 Create Windows7-64bit environment (for financial time series analysis)
[Time series with plotly] Dynamic visualization with plotly [python, stock price]
Python Math Series ② Matrix Multiplication
Python application: Pandas Part 2: Series
Python 2 series and 3 series (Anaconda edition)
Python execution time measurement memo
Time series analysis related memo
Python Mathematics Series ③ Determinant (replacement)
Python 3 series installation for mac
Execution time measurement with Python With
Time series analysis part 4 VAR
Time series analysis Part 3 Forecast
Time series analysis Part 1 Autocorrelation
Time synchronization (Windows) with Python
Graph time series data in Python using pandas and matplotlib
Calculation of time series customer loyalty
About installing Pwntools and Python2 series
Python
[Python] How to use Pandas Series
Time series analysis practice sales forecast
Division of timedelta in Python 2.7 series
Measure function execution time in Python
python sql statement extracted by time
Difference between python2 series and python3 series dict.keys ()
Python (from first time to execution)
Python Math Series ⓪ Table of Contents
About time series data and overfitting
Question
See python for the first time
Differentiation of time series data (discrete)
Movement statistics for time series forecasting
Time series analysis 3 Preprocessing of time series data
Code tests around time in Python
LSTM (1) for time series forecasting (for beginners)
python> Processing time measurement> time.time () --start_time
Plot CSV of time series data with unixtime value in Python (matplotlib)
Forecasting time series data with Simplex Projection
Fourier series verification code written in Python
Time series analysis 2 Stationary, ARMA / ARIMA model
[Python] What is pandas Series and DataFrame?
Predict time series data with neural network