Citi Interview Question

Write an algorithm that will maximize profit over some historic stock data.