Skip to content
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

subscribeCandle only works with "SECOND" Resolution #615

Closed
franck34 opened this issue May 8, 2024 · 1 comment
Closed

subscribeCandle only works with "SECOND" Resolution #615

franck34 opened this issue May 8, 2024 · 1 comment

Comments

@franck34
Copy link
Contributor

franck34 commented May 8, 2024

const epics = [
  'CS.D.BITCOIN.OPTCALL.IP',
  'IX.D.DOW.OPTCALL.IP', // Dow jones
  'IX.D.NASDAQ.OPTCALL.IP', // NQ
  'IX.D.CAC.OPTCALL.IP', // CAC
  'IX.D.DAX.OPTCALL.IP', // DAX
  'IX.D.SPTRD.OPTCALL.IP', // SP500
];

client.stream.subscribeCandles(epics, Resolution.MINUTE, (epic, candle) => { console.log('minute', JSON.stringify(candle, null, 4)); });
client.stream.subscribeCandles(epics, Resolution.MINUTE_5, (epic, candle) => { console.log('minute 5', JSON.stringify(candle, null, 4)); });
client.stream.subscribeCandles(epics, Resolution.MINUTE_30, (epic, candle) => { console.log('minute 30', JSON.stringify(candle, null, 4)); });
client.stream.subscribeCandles(epics, Resolution.SECOND, (epic, candle) => { process.stdout.write('.') } );

You will see some points on the screen, it's candle info for SECOND resolution.

All other subscription never trigger their callbacks.

I've tried to put SECOND resolution first, same thing.

I've tried to comment SECOND resolution, same thing.

Not sure if it's a bug on ig-trading-api module or IG low API.

@bennycode
Copy link
Owner

Hi @franck34, you have to use the ChartResolution enum instead of the Resolution enum.

Example: https://github.com/bennycode/ig-trading-api/blob/v0.13.7/src/demo/stream.ts#L10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants