is there a code or a function that returns the account open lots (long or short) for a specific symbol???
Loop through all open positions, filter by symbol, sum up lots.
Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.