Regarding the error I found yesterday. It is about the "buffering" to avoid unnecessary trading related to signal errors. I found I had run the rounding operation BEFORE the buffering calculation, in calculating target number of contract. Through some exercise, I realized that the rounding needs to be done AFTER, to get the buffering to work effectively. I made this change accordingly yesterday.