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 551 forks source link

How do I call or Put $10 using the API? #31

Open joelmm1 opened 7 years ago

joelmm1 commented 7 years ago

How can I call EUR/USD with an amount of exactly $10.

MadOne199 commented 7 years ago

https://github.com/n1nj4z33/iqoptionapi/wiki

MadOne199 commented 7 years ago

so, with reference to the above response... a call stake of 10.00 for EUR/USD is api.buy(10, 1, "turbo", "call")

a put stake of 4.11 on GBPJPY is api.buy(4.11, 3, "turbo", "put")

the actives number (1 and 3 above) can be seen in API constants constants.py

After you use the above commands, a websocket (wss) message is created and sent. To identify how it is made up you need to follow the code. For example...api.buy(10, 1, "turbo", "call") will send the following wss note: nextCandleCloseTime and PlaceStakeTimeNextCandleOpenMinus1Sec will be numbers relating to a time eg. 1499369340 = time in milliseconds from epoch / 1000 = time in seconds (there are 1000 milliseconds in a second)

{"msg": {"price": 10,"act": 1,"exp": nextCandleCloseTime,"type": "turbo","direction": "call","time": PlaceStakeTimeNextCandleOpenMinus1Sec}, "name": "buyV2"});