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.
FYI: it's not a program code; it's just the output of the code, with a table result. I initially thought the same, and have also created a flexible program for all cases. But it got too complicated and hard to maintain or to extend. Then I decided to limit myself to just the Put Spread case as in reality I'm interested only in this case. For the time being I'll stick to this solution, and maybe later create a new general one based on this as this one is IMO much clearer than my older attempt. Does your program handle also the shown problem case? What result does it give for DayOffset=30 ? Mine uses BSM as the basis. I know. The example was given just to test this scenario of the program, and to be verifed by others as I was not sure about the result. That's discussions are for, aren't they?
@earth_imperator 1. Use a local volatility model to estimate a likely IV at price S and time T for both assets 2. Plug those values into the call and put functions that take the BSM inputs 3. Repeat for all spot values within the expected range no guarantees that this is the correct approach, this is just how I would do it if I traded this kind of structure.
You are just another hollow BS talker, nothing but Hot Air. Always taking, never giving back except such trash answers. Fully idiotic answer that has nothing related to the original question. Just a BS answer! You yourself prove that you have not even grasped the problem, but in your previous posting are judging my work... Lol! What an idiocy! Bye, man!