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
120 stars 545 forks source link

price has changed #18

Closed 0xAalaoui closed 7 years ago

0xAalaoui commented 7 years ago

Hello,

Sometimes, the buyV2 request fails and I get this error from the WS:

{"name":"buyComplete","msg":{"isSuccessful":false,"message":["We're sorry, but the price has changed. Please try again."],"result":{"request_id":null}}}

Any ideas? :)

frxncisjoseph commented 7 years ago

Hm, strange... I've never encountered this error before.

Could you give more information for when this has occurred?

0xAalaoui commented 7 years ago

I am using buyv2.py of @gobbluth

It occurs randomly, here some buyV2 messages producing that error:

{"msg": {"direction": "put", "price": 1, "act": 3, "exp": 1490350020, "time": 1490349732, "type": "turbo"}, "name": "buyV2"}"

{"msg": {"direction": "call", "price": 1, "act": 100, "exp": 1490350200, "time": 1490349968, "type": "turbo"}, "name": "buyV2"}"

Olascoaga commented 7 years ago

this error occurred because the time for buy an position is from 0 second until 30 second (with the api) on the broker is distinct

0xAalaoui commented 7 years ago

@Olascoaga what do you mean ? Seems that this error is linked to my slow VM, using a VPS every buyV2 message was successful.

frxncisjoseph commented 7 years ago

I normally sleep for 5 seconds prior to the connection of the api. This ensures the time for buying a position is within the timeframe of the broker. However remember if you're placing a binary trade then normally adding a second (i.e. expiration + 1) will ensure it goes through.