Comments (49)
Hi @j1and1,
In /iqoptionapi/ws/objects/timesync.py replace the content of expiration_timestamp() method with the following code:
return time.mktime(self.expiration_datetime.replace(second=0, microsecond=0).timetuple())
It should appear:
@property
def expiration_timestamp(self):
"""
Property to get expiration timestamp.
:returns: The expiration timestamp.
"""
# return time.mktime(self.expiration_datetime.timetuple())
return time.mktime(self.expiration_datetime.replace(second=0, microsecond=0).timetuple())
I'm sure this will help you.
from iqoptionapi.
Hey @engelkohle thanks that solved the issue with expiration times!
from iqoptionapi.
@j1and1 Check out #17, this gives you open position information in real time and the trade result.
from iqoptionapi.
give me your skype
from iqoptionapi.
Added a little comment to a README.md
from iqoptionapi.
Hi,
after run the api the websocket returns the following json message:
{'msg': {'code': 4, 'isSuccessful': False, 'message': ['Time for purchasing options is over, please try again later.'], 'result': {'request_id': None}}, 'name': 'buyComplete'}
{'msg': 1471594551119, 'name': 'timeSync'}
Have you the same problem?
from iqoptionapi.
hi try to buy on 0 seconds by server time
something like
if api.timesync.servertime.seconds == 0:
api.buy(args)
from iqoptionapi.
@n1nj4z33 And what value goes in args
?
This project needs documentation.
Could you publish a sample of how to use this API?
from iqoptionapi.
@joebrassi Hi, i add sphinx generated documentation http://iqapi.readthedocs.io/en/latest/
I'll add a user guide to wiki soon
from iqoptionapi.
@n1nj4z33 Yes, but that documentation does not say anything about the parameters accepted by the method buy
, it only mentions it. Could you just publish a sample?
from iqoptionapi.
@joebrassi
api.buy(price, active, option, direction)
api.buy(10, 76, "turbo", "call")
from iqoptionapi.
@joebrassi also you can see here https://github.com/n1nj4z33/iqpy
from iqoptionapi.
@n1nj4z33 Thank you very much. And a couple more questions,
- Is there any way to retrieve the current price from the API?
- I see you assign 76 to the parameter "active", what does 76 actually mean?
from iqoptionapi.
- No way yet. You just send your price to buy
- https://github.com/n1nj4z33/iqapi/blob/master/iqapi/constants.py
from iqoptionapi.
- OK.
- Are those the only constants you have? How should I get the number of other symbols?
from iqoptionapi.
@joebrassi
Im get it from chrome devtools in websocket tab
just choose another active ad check
http://i.stack.imgur.com/OIbxT.png
from iqoptionapi.
I see. Well, it seems that it needs to be completed then.
from iqoptionapi.
@joebrassi of course it was )
from iqoptionapi.
@joebrassi and you can help by doing a pull requests )
from iqoptionapi.
OK, let me see what I can do.
from iqoptionapi.
@joebrassi @engelkohle @Marc1993Idel you can find some information in wiki now https://github.com/n1nj4z33/iqoptionapi/wiki.
from iqoptionapi.
{'msg': {'code': 4, 'isSuccessful': False, 'message': ['Time for purchasing options is over, please try again later.'], 'result': {'request_id': None}}, 'name': 'buyComplete'}
{'msg': 1471594551119, 'name': 'timeSync'}
@engelkohle Have you found a away around this?
from iqoptionapi.
May have solved...
{'msg': {'code': 4, 'isSuccessful': False, 'message': ['Time for purchasing options is over, please try again later.'], 'result': {'request_id': None}}, 'name': 'buyComplete'} {'msg': 1471594551119, 'name': 'timeSync'}
This ^^ Is the result of expiration times. When rounding all turbo expirations to up to nearest minute, and binaries up to the nearest 15 minutes, it works.
Using datetime:
def round_up(tm, nearest=15):
upmins = math.ceil(float(tm.minute)/nearest)*nearest
diffmins = upmins - tm.minute
newtime = tm + datetime.timedelta(minutes=diffmins)
newtime = newtime.replace(second=0)
return newtime
from iqoptionapi.
https://github.com/n1nj4z33/iqoptionapi/blob/master/iqoptionapi/ws/objects/timesync.py
@property
def expiration_timestamp(self):
"""Property to get expiration timestamp.
:returns: The expiration timestamp.
"""
return time.mktime(self.expiration_datetime.timetuple())
https://github.com/n1nj4z33/iqoptionapi/blob/master/iqoptionapi/ws/chanels/buyv2.py
so you can try to set expiration time before buy
self.api.timesync.expiration_time = 1
from iqoptionapi.
Are we all agree that these workarounds are used to resolve the trouble about the time to buy, that is possible to do only when the time is zero zero seconds? Or it is possible to buy a position in every time using one of workarounds described before? Have implemented a method that wait until the time is to zero zero seconds and then return true.
from iqoptionapi.
How do you set the volume in a call to:
api.buy(price, active, option, direction)
api.buy(10, 76, "turbo", "call")
from iqoptionapi.
volume? what does it mean "volume"?
from iqoptionapi.
Also called "Trading Size" or "Amount".
from iqoptionapi.
Hi, i want to develop iqoption autotrade bot for my own strategy but i am not a Python programmer and the api script is in the same lang.
Is here anyone who can convert these scripts to .net C#.
I'll helpful to him for this kind job.
Regards
from iqoptionapi.
Sorry @n1nj4z33,
but your suggest:
self.api.timesync.expiration_time = 1
not work absolutely. At the moment I'm using a function waiting that the seconds are zero, like this:
def zero_zero_seconds(self):
logger = logging.getLogger(__name__)
logger.info("Wait for zero zero seconds.")
while not self.timesync.server_datetime.second == 0:
time.sleep(1)
return True
from iqoptionapi.
Hi, did you manage to figure out how to resolve the issue with expiration times? I'm kinda stuck at this...
from iqoptionapi.
hi, how can i retrieve profile data? i would like to get the users balance
from iqoptionapi.
hi @jglydes ,
If I am correct.... After you have created a connection with the api you can use api.profile.balance
to get the balance....
from iqoptionapi.
Hi, I have been trying to access candle information but it comes back empty using
candles= api.getcandles (1,1)
from iqoptionapi.
hi @j1and1 ,
thank you for your response. i just followed the steps on wiki and api.profile.balance returns None. however i managed to get the balance by doing this
profile = api.getprofile()
res = json.loads(profile._content)
balance = res['result']['balance'])
Do you have any idea how can i retrieve the result of buy method? if the trade wins or lose. thanks
from iqoptionapi.
Hi, i thinks that i solved the problem, try with this:
api.getcandles(1,1)
candles = api.candles.candles_data
print candles[-1] # current candle
from iqoptionapi.
Do you have any idea how can i retrieve the result of buy method? if the trade wins or lose. thanks
I'm wondering the same thing....... And I havent investigated it, but for now I have not found method to get reecent deals...... witch would be usefull for buget controll......
from iqoptionapi.
how to get current % of return of an active?
from iqoptionapi.
This is still a huge problem at large dispute the efforts of fixing it by @engelkohle, sadly.
from iqoptionapi.
any update on this guy ? thx you
from iqoptionapi.
@Niks005 There is a way, do you still need it? I can add a issue with a tutorial/code to do it.
from iqoptionapi.
@frxncisjoseph Thanks!!!
from iqoptionapi.
for fix the problem (our csharp line)
expirationtimestamp -= expirationtimestamp % 60;
the server only accept EXACT 60 sec match
from iqoptionapi.
@frxncisjoseph I had got it working. Using http request "all". Thanks.
from iqoptionapi.
Hi.
I'm not using the python api, I'm writing a little application in c#.
I'm able to send the message to setActives with:
{"msg" : {"actives" : 1}, "name" : "setActives"}
and it works fine.
Can you tell me what is the right message to send at websocket to buy an option with buyV2 message in binary mode?
I have tested the following, but any parameters I thing that are wrong, beacuse I don't know any sample to compose it:
{"msg" : {"price" : 1.17779}, "act" : 1, "exp" : 1507636800000 , "type" : 3, "direction" : "put", "time" : 1507636658690, "name" : "buyV2"}
I receive the following response:
{"msg":{"code":26,"codeList":[26],"isSuccessful":false,"message":["Failed to process"],"result":{"request_id":null}},"name":"buyComplete"}
I suppose the they are the right parameter because I have seen in the "buyv2.py" file, but i don't know the right value for field: type, direction.
The "act" i suppose is right and it is the same of "actives" that I have used in "setActives", right?
Where I can find messages that iqoption support, exist any documentation?
What are the right message to send to by an option?
Please can you help me?
Many thanks to all
from iqoptionapi.
just download the iqoption mobile application (apk) and you can see all the code source, since 4 month i didnt worked on the iqoption api so i dont remember the flow
from iqoptionapi.
just download the iqoption mobile application (apk) and you can see all the code source, since 4 month i didnt worked on the iqoption api so i dont remember the flow
@HubSpace2000 many thanks for your reply and suggestion.
I have downloaded the apk but I don't see anything about it... I have searched: buyv2, buy, msg but I haven't found anything ... :(
Have you any suggestion?
from iqoptionapi.
Hi to every body...Is there someone who has been able to send request_id parameter to the buyv2 method and get It into buyComplete response? If Yes..how?
Thx very much
from iqoptionapi.
@HubSpace2000
Hi HubSpace2000, could I receive source code to understand how to complete buyV2 with other parameters? (my skype is the same as github username)
Thank you
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.