Skip to content

Commit

Permalink
3.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Lu-Yi-Hsun committed Oct 9, 2019
1 parent f41b0d5 commit 73923e7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/iqoptionapi)

last update:2019/10/5
last update:2019/10/9

Version:3.9.6

add [get_digital_current_profit](#getdigitalcurrentprofit)

https://github.com/Lu-Yi-Hsun/iqoptionapi/issues/121#issuecomment-539793386

Version:3.9.5

Expand Down Expand Up @@ -580,6 +586,26 @@ amount=1
action="call"#put
print(I_want_money.buy_digital_spot(ACTIVES,amount,action,duration))
```
#### <a id=getdigitalcurrentprofit>get_digital_current_profit</a>

get current price profit


```python
from iqoptionapi.stable_api import IQ_Option
import time
import logging
#logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
I_want_money=IQ_Option("email","password")
ACTIVES="EURUSD"
duration=1#minute 1 or 5
I_want_money.subscribe_strike_list(ACTIVES,duration)
while True:
data=I_want_money.get_digital_current_profit(ACTIVES, duration)
print(data)#from first print it may be get false,just wait a second you can get the profit
time.sleep(1)
I_want_money.unsubscribe_strike_list(ACTIVES,duration)
```

#### Buy digit
```python
Expand Down
9 changes: 8 additions & 1 deletion iqoptionapi/stable_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def nested_dict(n, type):


class IQ_Option:
__version__ = "3.9.5"
__version__ = "3.9.6"

def __init__(self, email, password):
self.size = [1, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800,
Expand Down Expand Up @@ -743,6 +743,13 @@ def get_realtime_strike_list(self, ACTIVE, duration):
pass

return ans

def get_digital_current_profit(self, ACTIVE, duration):
profit = self.api.instrument_quites_generated_data[ACTIVE][duration*60]
for key in profit:
if key.find("SPT")!=-1:
return profit[key]
return False
#thank thiagottjv
#https://github.com/Lu-Yi-Hsun/iqoptionapi/issues/65#issuecomment-513998357
def buy_digital_spot(self, active,amount, action, duration):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="iqoptionapi",
version="3.9.5",
version="3.9.6",
packages=find_packages(),
install_requires=["pylint","requests","websocket-client==0.47"],
include_package_data = True,
Expand Down

0 comments on commit 73923e7

Please sign in to comment.