harwee / IQOption-Api

** Unmaintained ** I have rewritten some of the functionality using async if you are want to use the updated code you can use the code from `async` branch
Apache License 2.0
52 stars 54 forks source link

How to open binary position as quick as possible #33

Closed aldhosutra closed 5 years ago

aldhosutra commented 5 years ago

After i tried this API several times, i found that i must start the websocket connection first with api.start(), then after that i can execute buy_v2 command.

Delay from api.start() is about 10 seconds in my case. I want to open binary position as soon as my signal is firing.

so, i want to know how i can quickly execute buy_v2 command, maybe without always calling api.start() everytime, or maybe by keeping my session alive? How i can do that?

thanks

harwee commented 5 years ago

api.start is just to initialize the whole session, it sets the session key and everything else to talk to server, the 10 sec delay is to ensure that asynchronous request is completed. if you cant wait for 10 seconds and want to start buying immediately try this branch https://github.com/harwee/IQOption-Api/tree/async it's written using asyncio so no manual delay is added to it other than the network latency and session stability is much higher for the code in that branch, so you can start the session beforehand and buy when ever you want immediately.

aldhosutra commented 5 years ago

cool, thanks for your response. you're doing an amazing job!