cli-candlestick-chart

CI Latest version

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.

Table of contents

Features

API Usage

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 = vec![ Candle::new(133.520004, 133.610001, 126.760002, 129.410004), Candle::new(128.889999, 131.740005, 128.429993, 131.009995), Candle::new(127.720001, 131.050003, 126.379997, 126.599998), Candle::new(128.360001, 131.630005, 127.860001, 130.919998), Candle::new(132.429993, 132.630005, 130.229996, 132.050003), ];

// 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();

} ```

Binary Usage

``` USAGE: cli-candlestick-chart.exe [OPTIONS]

FLAGS: -h, --help Prints help information -V, --version Prints version information

OPTIONS: --bear-color Sets the descending candles color. --bull-color Sets the ascending candles color. --chart-name Sets the chart name. -f, --file File to read candles from, if reading-mode is *-file. -r, --reading-mode Choose your reading mode. [possible values: stdin, csv-file, json-file] ```

Examples

Api

Binary

Build