-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buy id #52
Comments
@mymggithub |
Can you share your code with us,please? The python file which you are trying to execute the API with. |
I grew frustrated and stated from scratch, it reproduces the results of only buying an option displaying the ID.
|
give me log file |
Try Hope this will help. |
It turned out to be a problem with python 2.7. What I was doing for a very bad quick fix was got the ID from open_options.
@JafferWilson do you still want to communicate? |
So you get the problem in python2.7? |
@mymggithub No I do not have any discord. I tried to help. Delighted to know it was Python version issues. |
Thanks @JafferWilson I always appreciate the help, if it wasnt for you I wouldnt have thought it would be the python version. |
@mymggithub you get the None ID because the "purchase time" is zero,so you "buy fail" and you get None ID i think not python2 problem import random
import time
import json
from iqoptionapi.stable_api import IQ_Option
from datetime import datetime
print("login...")
I_want_money = IQ_Option("email", "password")
I_want_money.change_balance("PRACTICE")
ACTIVES="EURUSD-OTC"
ACTION="put"
expirations_mode=1
force_buy= False
cost=1
optionID = 0
while True:
print("")
print("Buying option...")
print("Cost: ${}".format(cost))
optionID = I_want_money.buy(cost,ACTIVES,ACTION,expirations_mode,force_buy)
time.sleep(0)
print(ACTIVES+" - History")
print("--------------------------------")
print("Option ID: {}".format(optionID))
time.sleep(0)
cost=cost+0.01
if optionID==None:
break |
@mymggithub please give """log file"",so i can know what happen |
Yea, this is unbelievable. |
just print log, can get that bug? |
There would be no log to print, as the bug does not appear during that time. |
I Reproduct that bug.. i will try find bug! |
I am using the code from the reply, also there is no
Or am I miss understanding? I just added a try and still nothing. |
The video shows that the bug only shows when there is no. That applies to |
I dont know, its not a big deal.
|
@mymggithub |
@Lu-Yi-Hsun |
Hi @Lu-Yi-Hsun,
Sorry to bug but am I doing it wrong to get the id when I buy a binary option.
I want the id to later put and infinite loop to check if the option is a won or loss.
The thing is, the buy option executes just fine, but when hard coded it returns None to the variable and if done manually in shell it returns the id.
I looked through the other issues and did not find an answer.
I did find #14
what ever happened to "ok"?
ok,id_number=I_want_money.buy(2,"EURUSD","call",1,force_buy=False)
It seamed like a great idea.
Thanks in advanced.
The text was updated successfully, but these errors were encountered: