angelocarbone / pyiqoapi

pyiqoapi is a python wrapper for IQOption's API.
6 stars 9 forks source link
api iqoption python websocket-client

pyiqoapi

pyiqoapi is a python wrapper for IQOption's API.

Install

Using pip:

    $ pip install git+https://github.com/angelocarbone/pyiqoapi.git

pyiqoapi depends to some packages, which will be installed automatically.

Usage

Include the pyiqoapi module and create an pyiqoapi instance with your account credentials.

import pyiqoapi

api = pyiqoapi.PyiqoAPI(username="yourusername", password="yoursecret")
api.connect()

Examples

Open position and get result

import time
import pyiqoapi

result = None
price = 1.50   
active = 1
option = 'turbo'
direction = 'call'
expiry = 60

api = pyiqoapi.PyiqoAPI(username="yourusername", password="yoursecret")
api.connect()
ticket_num = api.open_position(price, active, option, direction, expiry)

while not result:
    result = api.get_result(ticket_num)
    time.sleep(1)

print(result.win)