https://github.com/duart38/console-candlestick-chart
Japanese candlesticks charts in the console for TypeScript/JavaScript projects.
https://github.com/duart38/console-candlestick-chart
candlestick candlestick-chart chart deno javascript javascript-library trading typescript typescript-library
Last synced: about 2 months ago
JSON representation
Japanese candlesticks charts in the console for TypeScript/JavaScript projects.
- Host: GitHub
- URL: https://github.com/duart38/console-candlestick-chart
- Owner: duart38
- License: gpl-3.0
- Created: 2022-06-06T21:17:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-07T14:38:19.000Z (almost 3 years ago)
- Last Synced: 2024-10-16T16:16:13.593Z (7 months ago)
- Topics: candlestick, candlestick-chart, chart, deno, javascript, javascript-library, trading, typescript, typescript-library
- Language: TypeScript
- Homepage:
- Size: 761 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Render candlestick charts within your terminal
> This is still work in progress. There's quite some issues with some missing candles due to lack of checks for some small granular candles. Performance can also significantly be improved.- Adjusts based on terminal width and height automatically
- Customizable symbols
- Ability to change candle color (e.g., when a pattern is to be displayed in the terminal)
## Example usage
```TypeScript
const data: Array = [...] // your data here
const chart = new Chart(data);// (COMMENTED) example of how to apply an effect to a candle.
// chart.getActiveCandles()[3].addEffect(Color.bgBlue);// rendering of the terminal
console.log(chart+"");// executes callback when terminal size changes
chart.onConsoleSizeChange((e)=>{
// clear the terminal
Deno.stdout.write(new TextEncoder().encode(`\x1B[2J`));
// re-print the chart
console.log(""+chart);
});
```