I've been working on a backtest simulator using the python platform, when I came across the same problem I have seen solved numerous ways-- in different texts and even trading platforms! As odd as it may sound, there is only one correct answer. Let's see which trading system developers are doing it right. Given the following closing stock prices, calculate the corresponding equity curve and final balance; starting with a principle of $50. That means, what is the corresponding value of the equity curve for each value of the stock price on the close of that day. 100.00 S 102.30 S 95.00 S 87.00 S 82.10 S 82.00 NA 82.00 L 80.00 L 84.20 L 86.00 S S=Enter/Continue Short L= Enter/Continue Long NA = No new position Positions are closed at the price following the last day of a run. A string of same positions is only entered and closed 'ONCE' Answers in 2 digits. Bonus: what is sharpe ratio? Assume RFR = 0%. It's a simple looking problem and something that has to be evaluated at one point by any system/backtest developer. Feel free to post answers from your favorite backtesting platform as well. I'd be interested to see if they are aligned (I hope they are!).