You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -25,7 +33,7 @@ I did this project mainly to learn Rust, so the code may be not very good at som
25
33
Add this to your `Cargo.toml`
26
34
```toml
27
35
[dependencies]
28
-
cli-candlestick-chart = "0.1"
36
+
cli-candlestick-chart = "0.2"
29
37
```
30
38
31
39
```rust
@@ -42,7 +50,7 @@ fn main() {
42
50
];
43
51
44
52
// Create and display the chart
45
-
letmutchart=Chart::new(candles);
53
+
letmutchart=Chart::new(&candles);
46
54
47
55
// Set the chart title
48
56
chart.set_name(String::from("BTC/USDT"));
@@ -56,6 +64,8 @@ fn main() {
56
64
```
57
65
58
66
# Binary Usage
67
+
68
+
59
69
```
60
70
USAGE:
61
71
cli-candlestick-chart.exe [OPTIONS]
@@ -72,16 +82,26 @@ OPTIONS:
72
82
-r, --reading-mode <READING_MODE> Choose your reading mode.
73
83
[possible values: stdin, csv-file, json-file]
74
84
```
85
+
When requesting the CSV file mode, the library expects a CSV file with `open,high,low,close` headers fields.
75
86
76
-
# Examples
77
-
## Api
78
-
-[Basic example with CSV parsing](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/basic-with-csv-parsing.rs)
79
-
80
-
`cargo run --example basic-with-csv-parsing --features=serde`
87
+
When requesting the JSON or stdin mode, the library expects a JSON with the following format :
88
+
```
89
+
[
90
+
{
91
+
"open": 28994.009766,
92
+
"high": 29600.626953,
93
+
"low": 28803.585938,
94
+
"close": 29374.152344
95
+
},
96
+
...
97
+
]
98
+
```
81
99
82
-
-[Fetch candles from binance](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/fetch-from-binance.rs)
100
+
# Examples
101
+
## 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`
83
103
84
-
`cargo run --example fetch-from-binance --features=serde`
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`
0 commit comments