Contribution: Have to check for both undefined and null to prevent exceptions from stopping the trading task.