This library allows you to display candle charts directly in your terminal.
I did this project mainly to learn Rust, so the code may be not very good at some places.
Add this to your Cargo.toml
toml
[dependencies]
cli-candlestick-chart = "0.1"
```rust use clicandlestickchart::{Candle, Chart};
fn main() {
// Add some candles
let candles: Vec
// Create and display the chart
let mut chart = Chart::new(candles);
// Set the chart title
chart.set_name(String::from("BTC/USDT"));
// Set customs colors
chart.set_bear_color(1, 205, 254);
chart.set_bull_color(255, 107, 153);
chart.draw();
} ```
``` USAGE: cli-candlestick-chart.exe [OPTIONS]
FLAGS: -h, --help Prints help information -V, --version Prints version information
OPTIONS:
--bear-color *-file.
-r, --reading-mode
Basic example with CSV parsing
cargo run --example basic-with-csv-parsing --features=serde
cargo run --example fetch-from-binance --features=serde
Read CSV from file :
bash
./cli-candlestick-chart \
-r=csv-file \
-f=./examples/BTC-USD.csv \
--chart-name="My BTC Chart" \
--bear-color="#b967ff" \
--bull-color="ff6b99"
Read from stdin :
bash
echo '[
{
"open": 28994.009766,
"high": 29600.626953,
"low": 28803.585938,
"close": 29374.152344
},
{
"open": 29376.455078,
"high": 33155.117188,
"low": 29091.181641,
"close": 32127.267578
}
]' | ./cli-candlestick-chart -r=stdin \
--chart-name="My BTC Chart" \
--bear-color="#b967ff" \
--bull-color="ff6b99"