You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
fromXTBApi.apiimportClientclient=Client()
client.login("{[email protected]}", "{password}") #demo by defaultprint('market: ', client.check_if_market_open([EURUSD]) )
# BUY ONE VOLUME (FOR EURUSD THAT CORRESPONDS TO 100000 units)client.open_trade('buy', EURUSD, 1)
# SEE IF ACTUAL GAIN IS ABOVE X THEN CLOSE THE TRADEtrades=client.update_trades() # GET CURRENT TRADEStrade_ids= [trade_idfortrade_idintrades.keys()]
fortradeintrade_ids:
actual_profit=client.get_trade_profit(trade) # CHECK PROFITifactual_profit>=50:
print('closing..', client.close_trade(trade) ) # CLOSE TRADEclient.close_all_trades()
client.logout()
Its throwing this error:
2020-04-10 12:34:21 - DEBUG - XTBApi.api - BaseClient inited
2020-04-10 12:34:21 - INFO - XTBApi.api.Client - Client inited
2020-04-10 12:34:21 - DEBUG - XTBApi.api.Client - took 0.6212158203125 s.
Traceback (most recent call last):
File "...\XTBApi\api.py", line 151, in login
response = self._send_command(data)
File "...\XTBApi\api.py", line 137, in _send_command
raise CommandFailed(res)
XTBApi.exceptions.CommandFailed: command failed
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
Hey, I'm having trouble logging in:
Its throwing this error:
The text was updated successfully, but these errors were encountered: