The xStation5 API Python library provides a simple and easy-to-use API for interacting with the xStation5 trading platform. With this library, you can connect to the xStation5 platform, retrieve market data, and execute trades.
As I understand it, it should return results every 1 minute. Unfortunately, no data is coming in, and I'm not receiving any error or session disconnection information either. Am I correct in assuming that the XTB operator has stopped sending data in response to this request?
Hello,
Thanks for this Library!
While working on it I hit the issue, I cannot Close opened transaction, here is my code:
open_trades = await x.socket.getTrades(openedOnly=True)
open_trades = open_trades["returnData"]
for trade in open_trades:
response = await x.socket.tradeTransaction(
symbol=trade['symbol'],
cmd=xapi.TradeCmd(value=trade['cmd']),
type=xapi.TradeType.CLOSE,
price=trade['close_price'],
volume=trade['volume'],
order=trade['order'],
)
API returns error:
{'status': False, 'errorCode': 'SE199', 'errorDescr': 'Internal error'}
any suggestions?