Open MongkonEiadon opened 6 years ago
how you get this respond???
I've tried to use another extensions for google chrome -- "Simple Websocket Client" then i open secured connection by send
{"name":"ssid","msg":"your ssid token after login"}
then this channel will be authorized websocket channel, so when you send any request the response will sent back from iqoption immediately.
for this problem i've solved by this implementation in buyV2.py
class Buyv2(Base):
"""Class for IQ option buy websocket chanel."""
# pylint: disable=too-few-public-methods
name = "buyV2"
def __call__(self, price, active, option, direction):
"""Method to send message to buyv2 websocket chanel.
:param price: The buying price.
:param active: The buying active.
:param option: The buying option.
:param direction: The buying direction.
"""
exp = int(self.api.timesync.expiration_timestamp)
#Round to next full minute
if datetime.datetime.now().second > 30:
exp = exp - (exp % 60) + 60
else:
exp = exp - (exp % 60)
data = {
"price": price,
"act": active,
"exp": exp,
"type": option,
"direction": direction,
"time": self.api.timesync.server_timestamp
}
self.send_websocket_request(self.name, data)
check timestamp. your exp time is less then minute. you must buy not in current minute but for next minute.
I've sent the request with
but the result is respond
I've checked the timeout is in the future,