I have some trading data that I would like to process from a csv file.
What I am trying to do is find trading zones that move 1% or more in price. So if the price moves more than 1% to find the peak (or trough) which the next movement must be a 1% or more reversal in the opposite direction.
For example: the data would start processing and find a 1.5% upward movement. This would be the first trading zone with the final price being the peak. After that it finds a 1.2% downward movement which would be the next trading zone with the final price being the trough.
Even though it is very easy to find price movements over 1% but it's harder to find the peak of that movement because of the 1% or greater reversal stipulation. Let's say the price moves up 1.2% but then goes down 0.5% before moving back up to 1.5% This is proving much harder for me because the peak is 1.5% not 1.2%
How would I approach such a task?
What I am trying to do is find trading zones that move 1% or more in price. So if the price moves more than 1% to find the peak (or trough) which the next movement must be a 1% or more reversal in the opposite direction.
For example: the data would start processing and find a 1.5% upward movement. This would be the first trading zone with the final price being the peak. After that it finds a 1.2% downward movement which would be the next trading zone with the final price being the trough.
Even though it is very easy to find price movements over 1% but it's harder to find the peak of that movement because of the 1% or greater reversal stipulation. Let's say the price moves up 1.2% but then goes down 0.5% before moving back up to 1.5% This is proving much harder for me because the peak is 1.5% not 1.2%
How would I approach such a task?