1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
//! This is an unofficial [Oanda](https://wwww.oanda.com/) API client. This client is still //! an experimental work in progress however it is reasonably functional. //! //! The client is generated from the Oanda V20 API definitions. The current state of the client //! API is low-level but usable however I would like to see a more ergonomic layer developed on //! top. //! //! # Installation //! //! ``` //! cargo install fxoanda //! ``` //! //! # Example usage //! //! ``` //! use fxoanda::*; //! //! let api_key = env::var("OANDA_KEY").expect("expected OANDA_KEY environment variable to be set"); //! let api_host = env::var("OANDA_HOST").expect("expected OANDA_HOST environment variable to be set"); //! //! let client = fxoanda::Client { //! host: String::from(api_host), //! reqwest: reqwest::Client::new(), //! authentication: String::from(api_key), //! }; //! match fxoanda::GetInstrumentCandlesRequest::new() //! .with_instrument("EUR_USD".to_string()) //! .with_granularity(CandlestickGranularity::H4) //! .remote(&client) //! { //! Ok(x) => println!("OK: {:#?}", x), //! Err(e) => eprintln!("ERR: {:#?}", e), //! }; //! //! ``` //! //! # Warning //! //! Forex markets are extremely risky. Automated trading is also extremely risky. //! This project is extremely risky. Market conditions, news events, or software bugs //! can wipe out your account in an instant. //! //! # Disclaimer //! //! Use this project at your own risk. The maintainers of this project make no //! claims as to this product being fit for purpose. In fact, the maintainers of this //! project are telling you that you shouldn't use this project. //! #![crate_type = "lib"] #[macro_use] extern crate serde_derive; //#[macro_use] extern crate serde; //#[macro_use] extern crate chrono; extern crate fxoanda_definitions; extern crate fxoanda_serdes; extern crate serde_json; extern crate time; pub mod account; pub mod client; pub mod instrument; pub mod pricing; pub use self::account::*; pub use self::client::*; pub use self::instrument::*; pub use self::pricing::*; pub use fxoanda_definitions::*; pub use fxoanda_serdes::*;