Hello, I am trying to get the at the money calls and puts on futures with python. I am finding a lot of difficulty in making functions to return the selected call and put so I can do stuff with them in OnData. My strikes are always off I am not sure why, I'm sure there is a simple way to do this, some help would be appreciated.

To recap I want two functions to return the atm call and put on the future in the program with the furthest expiration. Thanks!