Hi Pascal,
Great you like it and really appreciate your words, thank you very much.
Yes, I am also familiar with ib_insync and do like it as well, in my opinion the best option for connecting python to IB (for example, not sure how much processing of IB data you need to do for tax purposes, but in case it can be helpful I did a quite useful 'portfolio module' in python pulling in fills and keeping track of positions).
To your questions:
1) Correct
2) All prices used for calculation, are the mid of the closing bid and offer of each respective day. Chartaffair currently is based on EOD prices.
3) Again, all is based on day end prices, so any DD does not take into account any intra-day movements
4) Again correct (self speaking, this straddle is not necessarily ATM anymore at T-5)
5) Depending on whether the announcement is before the open or after the close, I determine the actual last trading session on which the announcement is not known yet by the market. This is T=0
Let me add a word of caution as my personal perspective:
I know those heatmaps are liked very much by the community, the reason I did them in the first place. In my humble opinion you need to be careful when drawing inference from them. Each stock has a beta component, i.e., it does move with the market. And since you keep the straddle strikes fixed, any movements caused by the market will show up as returns in the heatmap for a particular cycle (this fixing of strikes is the difference to RV charts).
Now, since you only have a couple of datapoints for each heatmap cell, chances are high that significant average returns in reality are driven by market movements which have amassed on that particular T-x just by chance. There might neither be good reasons logically nor fundamentally to expect the same market movements at the same T-x in future cycles. So concluding, those heatmap returns might be but are not necessarily connected with sustainable systematic patterns associated with that particular stock. I also need to add that over the years I have not come across convincing fundamental or market structure reasons so far why a particular T-x should consistently experience significant movements in either stock price or IV apart from the general IV increase before EAs - what SO strategies are taking advantage of. But I am willing to learn if you know one. My point is: Exercise some good amount of discretion when dealing with them.
Have fun with chartaffair!