n1nj4z33 / iqoptionapi

IQ Option API 4.x (Python 2.7) The project is obsolete and is not supported because of problems with access to IQ Options in Russia
119 stars 542 forks source link

How to buy a 'binary' option? #59

Closed milteven12 closed 6 years ago

milteven12 commented 6 years ago

Hello guys, the buy code just allows us to buy a turbo option (short expiration). Does anyone know how to buy a binary option? (15min expiration or more)

lucianopinheiro commented 6 years ago

Today, with this API, you can not. You have to check ws messages on chrome* while navigating to see the correct syntax of websocket message. So you can create your function. And you have to do a threshold on buy time.

It is not so difficult. The tricky part is to retrieve the available times from iqoption for each active.

milteven12 commented 6 years ago

Hello @lucianopinheiro , thanks for the answer, I will work on it. Do you know how to swap between demo and real account?

lucianopinheiro commented 6 years ago

You need first to know your account numbers (there is one for the real and another for the demo mode). You have to use chrome devtools again. I think the function (and ws command) is changebalance (./http/changebalance.py). I don't remember... You will see in devtools.

martppa commented 6 years ago

Hello Guys, I see this is the most recent post. Does anyone of you know the IQoption API address? I can't find it.

milteven12 commented 6 years ago

@martppa , sorry man, I don't know.

@lucianopinheiro , thank your for your help, now I can switch between demo and real. About the binary option, I'm trying the Websocket thing to see if I can retreive the expiration time for binary options but I can't see in the logs nothing about expiration even when I change the graphic expiration time, do you know a better way to search for it?

lucianopinheiro commented 6 years ago

I just know about ws message api_option_init_all, but I could not get it. I don't know why. On website, it gets at start of the session. It is part of the starting config of everything. I don't know how we get the updates, neither if it is possible. If you get the variable, please post here the solution.

keinbuck commented 6 years ago

To buy a binary option you must call api.buy(1,1,"binary","call") Furthermore you have to update expiration_timestamp in timesync.py or in buyv2.py to the next 15 minute intervall. For me it works perfect.

martppa commented 6 years ago

@milteven12 Thanks for your answer. Anyway I think you don't understand my question. This API written in python uses some kind of http address to connect to the IQoption server. I did search in the whole code and couldn't find it. So it is not hardcoded. You have to introduce the address in order to get it work. Could any one of you tell me which one are you using? I am sorry if I am going out of topic.

lucianopinheiro commented 6 years ago

Please, open another issue