Comments (7)
They added (or req. now) another params in buyV2:
skey - is stored in profile
user_balance_id - not sure if it's required but I added that and works fine
from iqoptionapi.
Hello @kanXuT , please, could you explain what should I do?
My current code is:
PS: How can I get the skey and user_balance_id?
I tried print (api.profile.skey) but the output is None.
from iqoptionapi.
Sorry not using this api and not famiiar with Python, so this is just where you can look for:
you need update buyv2.py ad add something like this:
data = {"price": price, "act": active, "exp": self.api.timesync.expiration_timestamp, "type": option, "direction": direction, "time": self.api.timesync.server_timestamp, "skey": self.api.profile.skey, "user_balance_id": self.api.profile.balance_id }
And if skey and balance_id is not set/deffined, you need fill them up first from profile message ;)
from iqoptionapi.
what we should to do exactly
from iqoptionapi.
@kanXuT i try a version of api have skey and balance difined and the property in profil and i add self.__balance_id = None
profile.py
from iqoptionapi.ws.objects.base import Base
class Profile(Base):
"""Class for IQ Option Profile websocket object."""
def __init__(self):
super(Profile, self).__init__()
self.__name = "profile"
self.__skey = None
self.__balance = None
self.__balance_id = None
@property
def skey(self):
"""Property to get skey value.
:returns: The skey value.
"""
return self.__skey
@skey.setter
def skey(self, skey):
"""Method to set skey value."""
self.__skey = skey
@property
def balance(self):
"""Property to get balance value.
:returns: The balance value.
"""
return self.__balance
@balance.setter
def balance(self, balance):
"""Method to set balance value."""
self.__balance = balance
@property
def balance_id(self):
"""Property to get balance_id value.
:returns: The balance_id value.
"""
return self.__balance_id
@balance_id.setter
def balance_id(self, balance):
"""Method to set balance_id value."""
self.__balance_id = balance_id
buyV2.py
from iqoptionapi.ws.chanels.base import Base
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.
"""
data = {"price": price,
"act": active,
"exp": self.api.timesync.expiration_timestamp,
"type": option,
"direction": direction,
"time": self.api.timesync.server_timestamp,
"skey": self.api.profile.skey,
"user_balance_id": self.api.profile.balance_id
}
self.send_websocket_request(self.name, data)
always buy not happened
i think skey and balance_id is always None
from iqoptionapi.
@yesamine , just a comment: I have the same version, you don't need to modify the call function to:
def call(self, price, active, option, direction,skey,user_balance_id)
?
The thing is, skey and user_balance_id aren't 'None', if you see the log when it connect to the server you will se the values there but I don't know how to retrieve it.
from iqoptionapi.
now i tested the iqoptionbot in TEST mode work good and trade
and i see skey and balance_id in loge file
the probleme this robot not working with other methods like TBL , TBH , ... and have many issues (candles and market ... )
but buy (call , put) work fin thats mean i miss somthing in my simple buy code
import time
from iqoptionapi.api import IQOptionAPI
api = IQOptionAPI("iqoption.com", "[email protected]", "mypass")
api.connect()
time.sleep(1)
balance = api.profile.balance
time.sleep(1)
print (balance)
api.setactives([1, 2])
time.sleep(1)
api.subscribe('tradersPulse')
reslt = api.buy(1, 1, "turbo", "call")
time.sleep(2)
print reslt
from iqoptionapi.
Related Issues (20)
- Delayed iqoption data (Not realtime?) HOT 1
- Get pair list of active assets HOT 2
- API is not placing trades
- metatrader and IQ Option API
- Where did you get the IQOption endpoints ?
- Response <404> error with iqoption.com HOT 4
- how to place the commands on binary options in specifaint the times of expirations
- Asking mail address
- A winning Strategy
- URL iqoption.com/api/login not found HOT 1
- Can't open an option
- Could you attribute a license open source?
- where can i find the api.sell() example?
- amount left in tournamount
- Lower and Higher value of the candle
- How to get order result?
- How can I make the get real-time candles run async
- IQ Option Parameters
- 404 Client Error: Not Found for url: https://iqoption.com/api/login
- https://iqoption.com/api/profile/changebalance Can't change balance?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iqoptionapi.