Rather than creating separate arrays for openf, close, high, low and date, you could create a class that has these properties:
class Row:
def __init__(self, openf, close, high, low, date):
self.openf = openf
self.close = close
self.high = high
self.low = low
self.date = date
Create an array of this class:
rows = []
Fill it:
while(i<x[0]):
if(data[i][j] == data[1][0]):
rows.append(Row(data[i][2], data[i][5], data[i][3], data[i][4], data[i][10]))
print("Analysed ",data[i][j])
print("Analysed ",data[i][10])
i = i + 1
And sort it:
rows.sort(key=lambda x: x.date)
If your plotting code requires separate arrays and you want to keep it that way, you can then create the arrays like so:
date = []
openf = []
for row in rows:
date.append(row.date)
openf.append(row.openf)