Need help with a code for how long the position will be in the market. Sometimes my positions is in the market to long.