Skip to content

Commit cd72662

Browse files
committed
📝 update readme with new bin feat
1 parent 19405f9 commit cd72662

1 file changed

Lines changed: 28 additions & 11 deletions

File tree

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
# Features
2828
- Customizable
2929
- Auto-fit to terminal size
30+
- Shipped as library with simple API
3031
- Shipped as binary for standalone usage
32+
- Can fetch charts from Yahoo Finance.
3133

3234
# API Usage
3335
Add this to your `Cargo.toml`
@@ -68,19 +70,26 @@ Download the latest release for your platform [here](https://github.com/Julien-R
6870

6971
```
7072
USAGE:
71-
cli-candlestick-chart [OPTIONS]
73+
cli-candlestick-chart.exe [OPTIONS] --mode <MODE>
7274
7375
FLAGS:
7476
-h, --help Prints help information
7577
-V, --version Prints version information
7678
7779
OPTIONS:
78-
--bear-color <BEAR_COLOR> Sets the descending candles color.
79-
--bull-color <BULL_COLOR> Sets the ascending candles color.
80-
--chart-name <CHART_NAME> Sets the chart name.
81-
-f, --file <FILE> File to read candles from, if reading-mode is `*-file.`
82-
-r, --reading-mode <READING_MODE> Choose your reading mode.
83-
[possible values: stdin, csv-file, json-file]
80+
--bear-color <BEAR_COLOR> Sets the descending candles color in hexadecimal.
81+
--bull-color <BULL_COLOR> Sets the ascending candles color in hexadecimal.
82+
--chart-name <CHART_NAME> Sets the chart name.
83+
-f, --file <FILE> [MODE:*-file] File to read candles from.`
84+
85+
--interval <INTERVAL> [MODE:*-fetch] The interval you want to retrieve the candles from the API
86+
[default: 1d]
87+
[possible values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo]
88+
89+
-m, --mode <MODE> Select the method for retrieving the candles.
90+
[possible values: stdin, csv-file, json-file, yahoo-fetch]
91+
92+
--ticker <TICKER> [MODE:*-fetch] The broker-side ticker of the asset you want to plot.
8493
```
8594
When requesting the CSV file mode, the library expects a CSV file with `open,high,low,close` headers fields.
8695

@@ -99,15 +108,15 @@ When requesting the JSON or stdin mode, the library expects a JSON with the foll
99108

100109
# Examples
101110
## API
102-
[Basic example with CSV parsing](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/basic-with-csv-parsing.rs) : Run with `cargo run --example basic-with-csv-parsing --features=serde`
111+
[Basic example with CSV parsing](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/basic-with-csv-parsing.rs) : Run with `cargo run --example basic-with-csv-parsing --features=serde,csv`
103112

104-
[Fetch candles from binance](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/fetch-from-binance.rs) : Run with `cargo run --example fetch-from-binance --features=serde`
113+
[Fetch candles from binance](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/fetch-from-binance.rs) : Run with `cargo run --example fetch-from-binance --features=serde,reqwest`
105114

106115
## Binary
107116
- Read CSV from file :
108117
```bash
109118
./cli-candlestick-chart \
110-
-r=csv-file \
119+
--mode=csv-file \
111120
-f=./examples/BTC-USD.csv \
112121
--chart-name="My BTC Chart" \
113122
--bear-color="#b967ff" \
@@ -130,8 +139,16 @@ echo '[
130139
"close": 32127.267578
131140
}
132141
]' | ./cli-candlestick-chart \
133-
-r=stdin \
142+
--mode=stdin \
134143
--chart-name="My BTC Chart" \
135144
--bear-color="#b967ff" \
136145
--bull-color="ff6b99"
137146
```
147+
148+
- Fetch from Yahoo Finance :
149+
```bash
150+
./cli-candlestick-chart \
151+
--mode=yahoo-fetch \
152+
--ticker=UBER
153+
--interval=1d
154+
```

0 commit comments

Comments
 (0)