your code is difficult to read, seems that you are hardcoding all scenarios instead of creating a flexible structure. But I dont know your language so maybe Im wrong. Said this, selling naked puts and legging in the long after so many days (without any other edge) is no better than selling naked period. when you open the long leg, the profit or loss from the short are locked in.
