A thousand apologies but the definition of the carry rule for futures in Appendix B of my book "Systematic Trading" is incorrect.
On page 287 of the print edition (Heading: The carry trading rule )
For 'Futures: If not trading nearest contract'
Instead of Current contract price minus nearer contract price
It should read Nearer contract price minus current contract price
For 'Futures: If trading nearest contract'
Instead of Next contract price minus current contract price
It should read Current contract price minus next contract price
The spreadsheet here was also wrong and is now corrected.
My python code was already correct; which is a relief as I use this rule in my own trading :-).
The figures and explanations of the rule in chapter seven are fine, as are the calculations for other asset classes in Appendix B.
I'd like to thank the reader (Raphael C) who pointed this error out to me.