Open jackynguyen93 opened 5 years ago
To me work in real account but not work more in practice please we need of help! buy example
from iqoptionapi.stable_api import IQ_Option
import logging
import time
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
I_want_money=IQ_Option("user","pass")
goal="EURUSD"
print("get candles")
print(I_want_money.get_candles(goal,60,111,time.time()))
Money=2
ACTIVES="EURUSD"
ACTION="call"#or "put"
expirations_mode=1
balance_mode = I_want_money.get_balance_mode()
print(balance_mode)
idbuy = I_want_money.buy(Money,ACTIVES,ACTION,expirations_mode)
print (idbuy)
The output is
...
PRACTICE
2019-09-11 00:21:56,448 {"msg": {"time": 1568172115.639, "direction": "call", "act": 1, "type": "turbo", "exp": 1568172180, "price": 2}, "name": "buyV2", "request_id": ""}
2019-09-11 00:21:56,729 {"name":"timeSync","msg":1568172116650}
2019-09-11 00:21:56,761 {"name":"option-rejected","microserviceName":"binary-options","msg":{"index":64982359,"option_id":5632861306,"reason":"no_money","amount":2000000,"currency":"BRL","enrolled_amount":490000,"balance_type_id":1,"balance_id":243005874,"option_type":"turbo","option_type_id":3,"user_id":50536774,"open_time":1568172116,"expiration_time":1568172180,"profit_percent":177,"direction":"call","value":1.104985,"active_id":1,"platform_id":0,"tournament_id":null,"user_group_id":184}}
2019-09-11 00:21:56,790 {"name":"buyComplete","request_id":"","msg":{"isSuccessful":false,"message":["Insufficient funds for this transaction."],"result":{"request_id":null}}}
(False, None)
@glira @jackynguyen93 PLEASE UPDATE TO v3.9.1 because IQOPTION update the server
!!importance!! before v3.9.1 version the buy() api without add ""user_balance_id":int(self.api.profile.balance_id)" it try to buy in REAL MODE(REAL MONEY)!!! without call change_balance() API
Yeah, thanks @Lu-Yi-Hsun figured out this issue.
Hi @Lu-Yi-Hsun , Still cannot order. After buy it returns (False, None)
ok i check now
@jackynguyen93 I can work! try the code
from iqoptionapi.stable_api import IQ_Option
import logging
import random
import time
from datetime import datetime,timedelta
import logging
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
I_want_money=IQ_Option("email","password")
I_want_money.change_balance("PRACTICE")
#MODE: "PRACTICE"/"REAL"
Money=10
ACTIVES="EURUSD"
ACTION="call"#or "put"
expirations_mode=1
print(I_want_money.buy(Money,ACTIVES,ACTION,expirations_mode))
To me work fine after update! thank Lu-Yi-Hsun !
@glira which python version you are using. I'm using python 3.7 and I got the issue with strftime('%s'). @Lu-Yi-Hsun It's work after I top up my practice balance. lol. Thank you so much
@glira @Lu-Yi-Hsun does check_win function work ? It does not work for me :(
@jackynguyen93 i am use 3.6 3.5 use this check_win_v2
After update new version, the buy function didn't work anymore. It returned success but didn't have any order in iqoption. I have checked function buy_multi but it also did not work. Please check this important issue. Thanks