Open peterszombati opened 3 years ago
Is there anything you can do on your library side that is not a tiny hack since the root 'cause is located on XTB side ? I'm curious, have you tried submitting a bug (through their help desk) on their side ? PS: So far locally, I've found a better solution to do realtime computation of the candles based on the getTickPrices subscription, so I don't have to wait a minute to get a notification from their websocket.
Hi @solarfrantz
Today I sent an email to support @ xhub . pro
@solarfrantz btw they still didn't respond to me, I'm 100% they won't do any changes on their side:)
That's weird because Python code works fine:
import sys
import time
from xAPIConnector import APIClient, APIStreamClient, loginCommand
userId = 999999
password = 'blabla'
client = APIClient()
loginResponse = client.execute(loginCommand(userId=userId, password=password))
if not loginResponse['status']:
print('Login failed. Error code: {0}'.format(loginResponse['errorCode']))
sys.exit()
ssid = loginResponse['streamSessionId']
sclient = APIStreamClient(ssId=ssid)
sclient.execute(dict(command='getCandles', symbol='EURUSD', streamSessionId=ssid))
# make it run for 5 minutes
time.sleep(300)
sclient.disconnect()
client.disconnect()
You need official wrapper (xAPIConnector) from here: http://developers.xstore.pro/api/wrappers/ But I remember that about a year ago getCandles wasn't working at all. Maybe they fixed something?
@wtld I will check this later
@peterszombati any info here?
@peterszombati any update about this problem ?
Thank you very much for this information. I thought I was going crazy. Calling getCandle sometimes worked for me, other times it didn't. I wondered in vain where I was going wrong, even though I was sure I hadn't changed any critical code. In desperation I tried Google and the very first link got me here. When I call the getLastChart function, then subscribe starts working. Weird but works for me.
Thanks again for this information!
2024 and found this issue is still alive. Using https://github.com/sgflt/xapi-websocket-client
2024 i odkryłem, że ten problem jest nadal aktualny. Używając https://github.com/sgflt/xapi-websocket-client
did you manage to solve the problem with Command: getCandles ?
I just call getChartLastRequest before subscription and it seems to be working.
I just call getChartLastRequest before subscription and it seems to be working.
Thanks, I changed the calling order as you wrote and it worked <3
I'm using python that not working for me too. I have the official wrapper but getCandles not working. Sent email to the support waitin for the answer. I'm the only one in this situation. I try call getChartLastRequest before nothing change. Sad
@htimi You must use getChartLastRequest for M1 interval, before retrieving candles
@damiancyrana thanks it works !!!! Maururu (thanks in Polynesia langage)
x.Stream.subscribe.getCandles
doesn't working if you didn't do a price history request for specific symbol example withBITCOIN
:It won't work. You have to do a request to BITCOIN price history then subscribe for candles example with
BITCOIN
: