Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.7 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.7 KB

AlphaVantage

Build Status

codecov.io

Coverage Status

A Julia wrapper for the Alpha Vantage API.

Overview

This package is a Julia wrapper for the Alpha Vantage API. Alpha Vantage provides free realtime and historical data for equities, digital currencies (i.e. cryptocurrencies), and more than 50 technical indicators (e.g. SMA, EMA, WMA, etc.).

The Alpha Vantage API requires a free API key.

Installation

Pkg.add("AlphaVantage")

and once you have obtained your API key set it as an environment variable.

ENV["ALPHA_VANTAGE_API_KEY"] = "YOURKEY"

If you encounter a clear bug, please file a minimal reproducible example on GitHub.

Usage

using AlphaVantage
using DataFrames
using StatPlots
gr(size=(800,470))
# Get daily S&P 500 data
spy = time_series_daily("SPY", datatype="csv");
# Convert to a DataFrame
data = DataFrame(spy[1]);
# Add column names
data = rename(data, Symbol.(vcat(spy[2]...)));
# Convert timestamp column to Date type
data[!, :timestamp] = Dates.Date.(data[!, :timestamp]);
data[!, :open] = Float64.(data[!, :open])
# Plot the timeseries
plot(data[!, :timestamp], data[!, :open], label=["Open"])
savefig("sp500.png")