I have been trying to write a code that sells a put option daily based on some parameters and with that order also submits a linked stop loss and take profit order. I have tried to incorporate Haakon's method for using Bracket Orders to do this, see below 

https://www.quantconnect.com/forum/discussion/13928/let-us-create-functionality-for-bracket-orders-together-my-attempt-so-far/p1

But I am still running into some issues where it looks like no take-profit orders are submitted and fill, stop and limit are all the same price.

Apologies if this seems trivial I am still quite new to the platform. 

Any other feedback will be appreciated partially if there is a better way to structure the option chain checking and subscription, I am also running into the issue where it seems on each loop it doesn't re-check the nearest expiry available. 

Thanks