using reactive function to calculate stock price by the last transaction