piprange/pipvalue/getpositionsize, that is where I would start to look for the error (or replace the functions). but it seems there are more bugs (no 2stage ordersend e.g.) - when copy&pasting it is not possible to compile the code, it looks like ...