Skip to content

Commit 785b751

Browse files
committed
- Added Notifications for changes in value of OI Upper and Lower Boundary Strike Prices
1 parent 922a9dd commit 785b751

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

NSE_Option_Chain_Analyzer.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,11 @@ def set_values(self) -> None:
790790
if self.first_run:
791791
self.root.title(f"NSE-Option-Chain-Analyzer - {self.underlying_stock} - {self.expiry_date} - {self.sp}")
792792

793+
self.old_max_call_oi_sp: numpy.float64
794+
self.old_max_call_oi_sp_2: numpy.float64
795+
self.old_max_put_oi_sp: numpy.float64
796+
self.old_max_put_oi_sp_2: numpy.float64
797+
793798
self.max_call_oi_val.config(text=self.max_call_oi)
794799
self.max_call_oi_sp_val.config(text=self.max_call_oi_sp)
795800
self.max_call_oi_2_val.config(text=self.max_call_oi_2)
@@ -799,6 +804,42 @@ def set_values(self) -> None:
799804
self.max_put_oi_2_val.config(text=self.max_put_oi_2)
800805
self.max_put_oi_sp_2_val.config(text=self.max_put_oi_sp_2)
801806

807+
if self.first_run or self.old_max_call_oi_sp == self.max_call_oi_sp:
808+
self.old_max_call_oi_sp = self.max_call_oi_sp
809+
else:
810+
if self.notifications:
811+
self.toaster.show_toast("Upper Boundary Strike Price changed",
812+
f"Changed from {self.old_max_call_oi_sp} to {self.max_call_oi_sp}",
813+
duration=4, threaded=True, icon_path=self.icon_path)
814+
self.old_max_call_oi_sp = self.max_call_oi_sp
815+
816+
if self.first_run or self.old_max_call_oi_sp_2 == self.max_call_oi_sp_2:
817+
self.old_max_call_oi_sp_2 = self.max_call_oi_sp_2
818+
else:
819+
if self.notifications:
820+
self.toaster.show_toast("Upper Boundary Strike Price 2 changed",
821+
f"Changed from {self.old_max_call_oi_sp_2} to {self.max_call_oi_sp_2}",
822+
duration=4, threaded=True, icon_path=self.icon_path)
823+
self.old_max_call_oi_sp_2 = self.max_call_oi_sp_2
824+
825+
if self.first_run or self.old_max_put_oi_sp == self.max_put_oi_sp:
826+
self.old_max_put_oi_sp = self.max_put_oi_sp
827+
else:
828+
if self.notifications:
829+
self.toaster.show_toast("Lower Boundary Strike Price changed",
830+
f"Changed from {self.old_max_put_oi_sp} to {self.max_put_oi_sp}",
831+
duration=4, threaded=True, icon_path=self.icon_path)
832+
self.old_max_put_oi_sp = self.max_put_oi_sp
833+
834+
if self.first_run or self.old_max_put_oi_sp_2 == self.max_put_oi_sp_2:
835+
self.old_max_put_oi_sp_2 = self.max_put_oi_sp_2
836+
else:
837+
if self.notifications:
838+
self.toaster.show_toast("Lower Boundary Strike Price 2 changed",
839+
f"Changed from {self.old_max_put_oi_sp_2} to {self.max_put_oi_sp_2}",
840+
duration=4, threaded=True, icon_path=self.icon_path)
841+
self.old_max_put_oi_sp_2 = self.max_put_oi_sp_2
842+
802843
red: str = "#e53935"
803844
green: str = "#00e676"
804845
default: str = "SystemButtonFace"

0 commit comments

Comments
 (0)