Possibly Incorrect Line of Code

Course Name: Options Trading Strategies In Python: Advanced, Section No: 6, Unit No: 9, Unit type: Notebook

Below line:
Nifty_Fut[‘quantity’] = -Nifty_delta // 5 * 5

I think should be replaced by following , otherwise it will incorrectly apply negation

Fut[‘quantity’] = - (Nifty_delta // 5 * 5)

Profit with this strategy should come out to be 3722.50 instead of 1000. Can you please check

Hi Rohan,

You are correct. The negation should be applied to the entire rounded quantity rather than just Nifty_delta before the division. Thanks for pointing this out! We have updated the code.

Thanks for update Akshay. Does downloadable code (which is in last section of any module) also get updated ?

Hi Rohan,

Yes. The code in the ZIP file is also updated.

1 Like