This Rust library provides functionalities to fetch and process cryptocurrency trading data. It is composed of two main modules:
binance_api
: This module interacts with the Binance cryptocurrency trading platform's API to fetch trading data.oscillators
: This module performs various technical analysis computations on the trading data.To use this library in your project, add the following to your Cargo.toml
:
toml
[dependencies]
oscillatorsetups = { git = "https://github.com/moderncodes/oscillatorsetups", tag = "v0.0.1" }
```rust use crate::binanceapi::klines::{getdatafromsource, ApiParams};
async fn main() { let params = ApiParams { limit: 100, tradingpair: "ETHUSD".tostring(), interval: "15m".tostring(), endpoint: 1, }; let response = getdatafromsource("api", ¶ms).await.unwrap(); println!("{:#?}", response); } ``` You'll need to add an async main and call this function within it since getdatafrom_source is an async function.
```rust
fn main(){
let response:Vec
lhc.pop(); // Data received from binance API contains uncompleted tik data. Removing last index on your discretion
let stoch_data = stochastic(&lhc, 14, 1, 3);
for val in stoch_data {
println!("{:?}", val);
}
}
```
To run the tests for the library, use the command cargo test.
Contributions to this project are welcome! Please create a fork of this repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the Apache License 2.0 License. See the LICENSE file for more information.