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

API improvement requests #14

Open burny91 opened 7 years ago

burny91 commented 7 years ago

Hi @n1nj4z33 ,

During the work with your api if have found some points which could be improved.

I do noticed that in your buy method it is not possible to pass the expiration time (1 min, 2 min, 3 min, ...) as a parameter, instead you set the expiration time as default from the current timestamp. Could you please update this? So it would be possible to work also with other expiration times. See modification proposal in code snap.

def __call__(self, price, active, option, **exp_time,** 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.
        """
        data = {"price": price,
                "act": active,
                **"exp": exp_time**
                "type": option,
                "direction": direction,
                "time": self.api.timesync.server_timestamp
               }

        self.send_websocket_request(self.name, data)`

How am I able to check the result of a trade: either win or lose. Which class do I need to use, I didnt find anything appropriate.

Next important thing would be to get a method that give the current percentage of profit from an asset. E.G. getProfit(constants.actives[1]) => output 70 (in percent)

Would be great to get some feedback where I can find these feature in your current api and if not feel free to implement them ;)

BR Burny

crypto-maniac commented 7 years ago

that would be a great addition , i though we could do it already... any update on this please ? thx you

crypto-maniac commented 7 years ago

but its look like we can if you check the code here https://github.com/AlexCollin/IQOption-Bot-Trade-System/blob/master/build/lib/src/api/iqoption/ws/chanels/buyv2.py ??

can you confirm please ?

data = {"price": price, "act": active, "exp": self.api.timesync.expiration_timestamp, "type": option, "direction": direction, "time": self.api.timesync.server_timestamp }

frxncisjoseph commented 7 years ago

I'll test it in a few minutes and validate it for you, it looks OK from my view though.

crypto-maniac commented 7 years ago

hello , i have extract some strings from their mac desktop application there should be more info on the existing API call apistringfromiqoption.txt

hope it contribute (that will certainly help my dev)

frxncisjoseph commented 7 years ago

@crypto-maniac Thank you!