I did not understand the loss calculation - it's a bit more involved, you'll find the formula in the manual - but as to the first question, the time is the bar end and the price is the price at that time.