Given two integer arrays prices and strategy, where -1 indicates buying and 1 indicates selling, calculate the maximum possible profit.