×
The graph on the left demonstrates all of the bucket 'leaders' for both resistance and support values. This is created after running a bucket finding algorithm. The graph on the right demonstrates what all of the local minima and maxima would have looked like before running a bucket finding algorithm
The algorithm to find all of the resistance and support points was done by running a peak/valley climbing double for loop. This picks up on all local/global maxima and minima.
The algorithm for finding resistance and support buckets is as follows. We start with an extracted dataset from YahooFinance.
We run a double for loop and find all resistance values, and all support values. Then on each set of resistance and support values we run a for-loop for length of the data set, and a second inner for loop that starts from 0 till the index of the outer forloop. Using these forloops we check if any previous values have a x% difference with our current value. If our current value can be found to have a x% difference with a previous value then it classifies as being in a bucket. And so we append the current value to the correct bucket, and move on to the next value.