将蜡烛图直接显示在您的终端中。
Add this to your Cargo.toml
[dependencies]
cli-candlestick-chart = "0.3"
…
Download the latest release for your platform here
…
When requesting the CSV file mode, the library expects a CSV file with open,high,low,close headers fields.
When requesting the JSON or stdin mode, the library expects a JSON with the following format :
[
{
"open": 28994.009766,
"high": 29600.626953,
"low": 28803.585938,
"close": 29374.152344,
"volume": 13456 // Optional
},
...
]
Basic example with CSV parsing : Run with cargo run --example basic-with-csv-parsing --features=serde,csv
Fetch candles from binance : Run with cargo run --example fetch-from-binance --features=serde,reqwest
./cli-candlestick-chart \
--mode=csv-file \
-f=./examples/BTC-USD.csv \
--chart-name="My BTC Chart" \
--bear-color="#b967ff" \
--bull-color="ff6b99"
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 \
--mode=stdin \
--chart-name="My BTC Chart" \
--bear-color="#b967ff" \
--bull-color="ff6b99"
If you prefer Python, there is a port of the library, developed by BoboTiG, right there : https://github.com/BoboTiG/py-candlestick-chart
暂无开放 Issues,或尚未同步最近议题。