Thanks for that Ph1l -
I am not sure about that formula. Shouldn't it be : today_open_price/ prev_close_price - 1 ??
Horrible value for Sharpe, but then again this is a "stupid" system that always goes long....so no surprise there.
The system badly needs a proxy for detecting a bull / bear market so it can sell the latter....and buy the former.
If the price pairs (prev_close_price, today_open_price) were
(100, 50) (50, 60) (60, 75)
and you started with $100, the result would be -$50 + $10 + $15 == -$25 for an average of -$8.33
If the test used
(today_open_price / prev_close_price - 1) * 100
the daily results would be -50, 20, and 25, and the average would be -1.6667
Using
((today_open_price - prev_close_price) / min(today_open_price, prev_close_price)) * 100
the daily results would be -100, 20 and 25, and the average would be -18.3333
Neither of these are perfect. An alternative would be the geometric mean of today_open_price/prev_close_price to get the compound growth rate == ( ((50 / 100) * (60 / 50) * (75 / 60)) ** (1/3) == 0.90856029641607
Then it would be possible to get the final result as $100 * 0.90856029641607 * 0.90856029641607 * 0.90856029641607 - $100 == -$25
For the previous data, using (today_open_price / prev_close_price - 1) * 100, the mean per-trade result would be 0.0354375702680139 percent (not much different)
And the geometric mean of today_open_price/prev_close_price == 1.00030503962027 which is a compounded, per-trade growth rate of 0.030503962027 percent (also not much different).
So as you and others have noticed, always buying at the close and selling at the open would likely lose money after transaction costs.