Bitcoin, Blockchain, Crytocurrency, Algorithmic Trading, Opinion.
y_data[0] # first data-point; increment = 0 x_positive = [] y_positive = [] x_negative = [] y_negative = [] for i, point in enumerate(y_data): # y_data contains BTCUSD prices increment += point-pre increment_perc = increment/pre pre = point if increment_perc > delta: x_positive.append(i)