Expand description

§Alpaca API Client (unofficial)

DO NOT USE IN A SERIOUS PROJECT, NOT LIABLE FOR ANY ISSUES

§Introduction

Alpaca is a trading platform for developers and app makers, and they provide various endpoints to access over http. The goal of this package is to provide the bare minimum tools for using the Alpaca API, and to learn more about open source software building. This is not a batteries included package yet, and still requires a lot of testing.

§Quick Examples

Get bars for a single stock

use alpaca_api_client::get_bars;

let bars = get_bars("BTU", "1Day", Some("start=2023-02-23"));

Get bars for multiple symbols

use alpaca_api_client::get_multi_bars;

let watchlist: [&str; 30] = [
  "META", "DIS", "CMCSA", "VZ", "T", "CHTR", "NFLX", "TMUS", "TWTR", "FOXA", "FOX", "DISH",
  "CBS", "OMC", "TME", "TTWO", "EA", "ATVI", "ZM", "MTCH", "IAC", "NTES", "BIDU", "ROKU", "SPOT",
  "LYV", "IQ", "HUYA", "DOYU", "VIAV",
];

let multi_bars: MultiBars = get_multi_bars(&watchlist, "1Day", Some("start=2022-01-01"));

Place market order

use alpaca_api_client::{place_market_order, OrderSide};

let order = place_market_order("SO", 3.0, OrderSide::Buy);

Structs§

Enums§

Traits§

  • Utility methods for interacting with Bars type

Functions§

Type Aliases§

  • A custom type for a vector of bars
  • A custom type for a hashmap of stock symbols and bars
  • A custom type for a hashmap of stock symbols and latest trade objects
  • A custom type for a hashmap of stock symbols and trade objects