7
7
import operator
8
8
9
9
from collections import defaultdict
10
+ from collections import deque
10
11
from iqoptionapi .expiration import get_expiration_time ,get_remaning_time
11
12
from datetime import datetime ,timedelta
12
13
@@ -19,7 +20,7 @@ def nested_dict(n, type):
19
20
20
21
21
22
class IQ_Option :
22
- __version__ = "5.1 "
23
+ __version__ = "5.2 "
23
24
24
25
def __init__ (self , email , password ):
25
26
self .size = [1 , 5 , 10 , 15 , 30 , 60 , 120 , 300 , 600 , 900 , 1800 ,
@@ -563,6 +564,17 @@ def get_top_assets_updated(self,instrument_type):
563
564
return self .api .top_assets_updated_data [instrument_type ]
564
565
else :
565
566
return None
567
+
568
+ #------------------------commission_________
569
+ #instrument_type: "binary-option"/"turbo-option"/"digital-option"/"crypto"/"forex"/"cfd"
570
+ def subscribe_commission_changed (self ,instrument_type ):
571
+
572
+ self .api .Subscribe_Commission_Changed (instrument_type )
573
+ def unsubscribe_commission_changed (self ,instrument_type ):
574
+ self .api .Unsubscribe_Commission_Changed (instrument_type )
575
+ def get_commission_change (self ,instrument_type ):
576
+ return self .api .subscribe_commission_changed_data [instrument_type ]
577
+
566
578
# -----------------------------------------------
567
579
568
580
# -----------------traders_mood----------------------
@@ -865,6 +877,10 @@ def get_instrument_id_to_bid(data,instrument_id):
865
877
aVar = position ["extra_data" ]["lower_instrument_id" ]
866
878
aVar2 = position ["extra_data" ]["upper_instrument_id" ]
867
879
getRate = position ["currency_rate" ]
880
+ #https://github.com/Lu-Yi-Hsun/iqoptionapi/issues/144#issue-518901797
881
+ #float division by zero
882
+ if spotUpperInstrumentStrike - spotLowerInstrumentStrike == 0 :
883
+ return None
868
884
869
885
#___________________/*position*/_________________
870
886
instrument_quites_generated_data = self .get_instrument_quites_generated_data (ACTIVES , duration )
0 commit comments