added safer way of determining the traders position when logging trade action