Lu-Yi-Hsun / iqoptionapi

IQ Option API
372 stars 288 forks source link

Options Profits #50

Open mymggithub opened 5 years ago

mymggithub commented 5 years ago

Hello @Lu-Yi-Hsun I was looking for a way to get the options potential profit. such as image and image

I was thinking that it maybe I_want_money.get_all_profit() is that correct?

Because I am getting inconsistency with the values of that function. For Example: I am getting this returned {'EURJPY': 0.79, 'GBPUSD': 0.76, 'GOOGLE': 0.65, 'AUDJPY': 0.75, u'GBPNZD': 0.76, 'USDCAD': 0.78, 'APPLE': 0.65, u'EURCHF': 0.72, 'EURUSD': 0.76, 'GBPJPY': 0.8, 'USDSGD': 0.69, 'EURNZD': 0.76, 'NZDUSD-OTC': 0.89, 'USDCHF': 0.7, 'USDCHF-OTC': 0.89, 'EURUSD-OTC': 0.9, 'EURCAD': 0.79, 'GBPAUD': 0.81, 'AUDUSD': 0.76, 'AMAZON': 0.67, 'AUDCAD': 0.81, 'GBPCAD': 0.78, 'AUDCAD-OTC': 0.89, 'EURGBP': 0.77, 'CADCHF': 0.83, 'ALIBABA': 0.65, 'USDJPY': 0.75, 'EURGBP-OTC': 0.89, 'EURAUD': 0.75} but when I look at iqoptions I get image

image

This is obvioulsy not inconsistent in all of them, but it is questionable Why is it doing this?

Lu-Yi-Hsun commented 5 years ago

@mymggithub thank, binary option have two profit(turbo and binary) i will fix the profit!

mymggithub commented 5 years ago

@Lu-Yi-Hsun Ah that makes sense. Thanks for pointing that out. I am also curios,would you be interested in putting the different profit range like for the one passing 5+ minutes?

Lu-Yi-Hsun commented 5 years ago

@mymggithub i fix that ,try latest version

mymggithub commented 5 years ago

Awesome thanks. from iqoptionapi.stable_api import IQ_Option print("login...") I_want_money=IQ_Option("email","password") d=I_want_money.get_all_profit() print(d["CADCHF"]["turbo"]) print(d["CADCHF"]["binary"])

though I am sorry to say it looks like. 'turbo' and 'binary' are all set to 0

Lu-Yi-Hsun commented 5 years ago

@mymggithub where is 0? my result is 0.85 0.81

mymggithub commented 5 years ago

Huh that is strange. If I type I_want_money.get_all_profit()

I get all 0 image

JafferWilson commented 5 years ago

@mymggithub What is the version of your library? I guess you have not updated it.

mymggithub commented 5 years ago

I will try updating again. But the current version is '3.3' I_want_money.__version__

JafferWilson commented 5 years ago

ok. But let me know what type of account you have on the IQOoption. This might happen because of that. If possible connect with me on Skype. But I am getting the proper output. See the image: getprofits

mymggithub commented 5 years ago

I have a basic account on IQOoption set on demo mode. I have a question do you think it could be because of the version of python, I am using 2.7. Before the update I was getting data just fine on IQOoption, as you can see, so I dont think it could be the account.

Hello @Lu-Yi-Hsun I was looking for a way to get the options potential profit. such as image and image

I was thinking that it maybe I_want_money.get_all_profit() is that correct?

Because I am getting inconsistency with the values of that function. For Example: I am getting this returned {'EURJPY': 0.79, 'GBPUSD': 0.76, 'GOOGLE': 0.65, 'AUDJPY': 0.75, u'GBPNZD': 0.76, 'USDCAD': 0.78, 'APPLE': 0.65, u'EURCHF': 0.72, 'EURUSD': 0.76, 'GBPJPY': 0.8, 'USDSGD': 0.69, 'EURNZD': 0.76, 'NZDUSD-OTC': 0.89, 'USDCHF': 0.7, 'USDCHF-OTC': 0.89, 'EURUSD-OTC': 0.9, 'EURCAD': 0.79, 'GBPAUD': 0.81, 'AUDUSD': 0.76, 'AMAZON': 0.67, 'AUDCAD': 0.81, 'GBPCAD': 0.78, 'AUDCAD-OTC': 0.89, 'EURGBP': 0.77, 'CADCHF': 0.83, 'ALIBABA': 0.65, 'USDJPY': 0.75, 'EURGBP-OTC': 0.89, 'EURAUD': 0.75} but when I look at iqoptions I get image

image

This is obvioulsy not inconsistent in all of them, but it is questionable Why is it doing this?

mymggithub commented 5 years ago

Yea it was the version of python. Since python 2.7 and 3 has slight differences in parsing data. image

Sorry about that.

Also the reason why the I was not getting the first option ID on #52 . Thanks for your help. @Lu-Yi-Hsun @JafferWilson

@Lu-Yi-Hsun Do you think there could be backwards compatibility for 2.7?

Lu-Yi-Hsun commented 5 years ago

Ok I will try to find how to fix the bug for python2.7 tomorrow

Lu-Yi-Hsun commented 5 years ago

in next version i will fix @mymggithub @JafferWilson

that will happen because float problem

0=int(0.2)

python2 version get the "int data" from json (if all int ,and output is int)

0=( int(a)-int(b) ) /int(c)

i think python3 version is auto protect that problem,so i miss that QQ

mymggithub commented 5 years ago

@Lu-Yi-Hsun Thank you very much.

mymggithub commented 5 years ago

@Lu-Yi-Hsun I love that you can see the all options potential profit, but was it by design to see the ones that are closed?

image image

defaultdict(<function <lambda> at 0x05CCB570>, {u'GS': defaultdict(<type 'dict'>, {'binary': 0.68}), u'EURJPY': defaultdict(<type 'dict'>, {'turbo': 0.76, 'binary': 0.82}), u'USDINR': defaultdict(<type 'dict'>, {'binary': 0.61}), u'GBPUSD': defaultdict(<type 'dict'>, {'turbo': 0.8, 'binary': 0.83}), u'GOOGLE': defaultdict(<type 'dict'>, {'turbo': 0.65, 'binary': 0.68}), u'YANDEX': defaultdict(<type 'dict'>, {'binary': 0.65}), u'AUDJPY': defaultdict(<type 'dict'>, {'turbo': 0.86, 'binary': 0.81}), u'GBPNZD': defaultdict(<type 'dict'>, {'turbo': 0.86, 'binary': 0.83}), u'USDCAD': defaultdict(<type 'dict'>, {'turbo': 0.54, 'binary': 0.75}), u'AIG': defaultdict(<type 'dict'>, {'binary': 0.68}), u'MSFT': defaultdict(<type 'dict'>, {'binary': 0.68}), u'INTEL': defaultdict(<type 'dict'>, {'binary': 0.68}), u'MORSTAN': defaultdict(<type 'dict'>, {'binary': 0.68}), u'APPLE': defaultdict(<type 'dict'>, {'turbo': 0.65, 'binary': 0.68}), u'EURCHF': defaultdict(<type 'dict'>, {'turbo': 0.84, 'binary': 0.82}), u'AUDNZD': defaultdict(<type 'dict'>, {'binary': 0.76}), u'EURJPY-OTC': defaultdict(<type 'dict'>, {'binary': 0.87}), u'EURUSD': defaultdict(<type 'dict'>, {'turbo': 0.58, 'binary': 0.77}), u'AUDCHF': defaultdict(<type 'dict'>, {'binary': 0.81}), u'GBPJPY': defaultdict(<type 'dict'>, {'turbo': 0.85}), u'GBPCHF': defaultdict(<type 'dict'>, {'binary': 0.8}), u'USDSGD': defaultdict(<type 'dict'>, {'turbo': 0.51, 'binary': 0.76}), u'FACEBOOK': defaultdict(<type 'dict'>, {'binary': 0.68}), u'USDHKD': defaultdict(<type 'dict'>, {'binary': 0.67}), u'EURNZD': defaultdict(<type 'dict'>, {'turbo': 0.83, 'binary': 0.82}), u'NZDUSD-OTC': defaultdict(<type 'dict'>, {'turbo': 0.89, 'binary': 0.87}), u'USDCHF': defaultdict(<type 'dict'>, {'turbo': 0.82, 'binary': 0.79}), u'USDCHF-OTC': defaultdict(<type 'dict'>, {'turbo': 0.89, 'binary': 0.87}), u'XAUUSD': defaultdict(<type 'dict'>, {'binary': 0.75}), u'EURUSD-OTC': defaultdict(<type 'dict'>, {'turbo': 0.9, 'binary': 0.89}), u'COKE': defaultdict(<type 'dict'>, {'binary': 0.68}), u'EURCAD': defaultdict(<type 'dict'>, {'turbo': 0.61, 'binary': 0.79}), u'GBPAUD': defaultdict(<type 'dict'>, {'turbo': 0.88, 'binary': 0.86}), u'AUDUSD': defaultdict(<type 'dict'>, {'turbo': 0.86, 'binary': 0.81}), u'SNAP': defaultdict(<type 'dict'>, {'binary': 0.79}), u'AMAZON': defaultdict(<type 'dict'>, {'turbo': 0.65, 'binary': 0.68}), u'AUDCAD': defaultdict(<type 'dict'>, {'turbo': 0.87, 'binary': 0.84}), u'USDJPY-OTC': defaultdict(<type 'dict'>, {'binary': 0.87}), u'NIKE': defaultdict(<type 'dict'>, {'binary': 0.68}), u'GBPCAD': defaultdict(<type 'dict'>, {'turbo': 0.83, 'binary': 0.82}), u'GBPUSD-OTC': defaultdict(<type 'dict'>, {'binary': 0.87}), u'USDNOK': defaultdict(<type 'dict'>, {'binary': 0.81}), u'AUDCAD-OTC': defaultdict(<type 'dict'>, {'turbo': 0.89, 'binary': 0.87}), u'JPM': defaultdict(<type 'dict'>, {'binary': 0.68}), u'EURGBP': defaultdict(<type 'dict'>, {'turbo': 0.86, 'binary': 0.84}), u'TESLA': defaultdict(<type 'dict'>, {'binary': 0.74}), u'TWITTER': defaultdict(<type 'dict'>, {'binary': 0.7}), u'CADCHF': defaultdict(<type 'dict'>, {'turbo': 0.86, 'binary': 0.83}), u'YAHOO': defaultdict(<type 'dict'>, {'binary': 0.68}), u'MCDON': defaultdict(<type 'dict'>, {'binary': 0.75}), u'ALIBABA': defaultdict(<type 'dict'>, {'turbo': 0.65, 'binary': 0.68}), u'CITI': defaultdict(<type 'dict'>, {'binary': 0.68}), u'USDJPY': defaultdict(<type 'dict'>, {'turbo': 0.7, 'binary': 0.79}), u'EURGBP-OTC': defaultdict(<type 'dict'>, {'turbo': 0.89, 'binary': 0.87}), u'USDZAR': defaultdict(<type 'dict'>, {'binary': 0.79}), u'NZDUSD': defaultdict(<type 'dict'>, {'binary': 0.81}), u'EURAUD': defaultdict(<type 'dict'>, {'turbo': 0.87, 'binary': 0.84}), u'BAIDU': defaultdict(<type 'dict'>, {'binary': 0.68})})

If so do you have a way to check if the options are closed in the code?

Lu-Yi-Hsun commented 5 years ago

Yes I will add