Skip to content

Commit 4912f41

Browse files
committed
- Fixed Call and Put OI for 2nd Strike Price not being displayed in K when the strike prices were consecutive
1 parent 46249c8 commit 4912f41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

NSE_Option_Chain_Analyzer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,9 +1130,11 @@ def main(self) -> None:
11301130
self.max_put_oi_2 = self.max_put_oi
11311131
self.max_put_oi_sp_2 = self.max_put_oi_sp
11321132
elif len(sp_range_list) == 2:
1133-
self.max_call_oi_2 = entire_oc[entire_oc['Strike Price'] == self.max_put_oi_sp].iloc[0, 0]
1133+
self.max_call_oi_2 = round((entire_oc[entire_oc['Strike Price'] == self.max_put_oi_sp].iloc[0, 0]) / 1000,
1134+
1)
11341135
self.max_call_oi_sp_2 = self.max_put_oi_sp
1135-
self.max_put_oi_2 = entire_oc[entire_oc['Strike Price'] == self.max_call_oi_sp].iloc[0, 20]
1136+
self.max_put_oi_2 = round((entire_oc[entire_oc['Strike Price'] == self.max_call_oi_sp].iloc[0, 20]) / 1000,
1137+
1)
11361138
self.max_put_oi_sp_2 = self.max_call_oi_sp
11371139
else:
11381140
call_oi_list_2: List[int] = []

0 commit comments

Comments
 (0)