Jacky is a beginner trader, he wants to make a profit in trading cryptocurrency. But since he is a beginner, he plans to buy once and sell once.
Before he jumps into the real market, he want to analyze previous historical prices to know how much he can profit based on historical prices.
Example 1:
Price of bitcoin each hour
Hour 1: $5
Hour 2: $4
Hour 3: $3
Hour 4: $2
Hour 5: $1
In this scenario, the maximum profit Jacky can make is: 0
Example 2:
Price of bitcoin each hour
Hour 1: $3
Hour 2: $2
Hour 3: $1
Hour 4: $5
Hour 5: $6
Hour 6: $2
In this scenario, the maximum profit Jacky can make is: $5, he will buy at 3rd hour and sell at 5th hour.