Skip to content

Commit

Permalink
docs: Refine live data example
Browse files Browse the repository at this point in the history
  • Loading branch information
bennycode committed May 9, 2024
1 parent 91e58cd commit cfec5c9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,11 @@ const epic = 'UC.D.MSFT.CASH.IP';
const prices = await client.rest.market.price.getPrices(epic, Resolution.DAY, 5);
```

### Subscribe to candle updates
### Subscribe to live data

```ts
const epics = ['UC.D.MSFT.CASH.IP'];
Here is how you can subscribe to live candles and other updates from IG:

client.stream.subscribeCandles(epics, Resolution.SECOND, (epic, candle) => {
console.log(epic);
console.log(candle);
});
```
- [stream.ts](./src/demo/stream.ts)

### More Examples

Expand Down

0 comments on commit cfec5c9

Please sign in to comment.